[chimerax-users] Reproduce exact view

Alexis Rohou a.rohou at gmail.com
Mon Feb 10 13:22:22 PST 2020


Thanks Elaine,

I should have added some explanation for my workflow:
1. I read a while back that ChimeraX sessions may or may not be forward
compatible, and I wanted to ensure long-term reproducibility of my figures
2. a requirement I have is that I should be able to quickly remake the
exact same figure after I change the input files. For example, perhaps I
prototype an elaborate figure using a PDB that's a work in progress and
later re-make it with an updated PDB. The advantage of a .cxc script is
that I just have to change the filename near the beginning of the script
and everything else stays the same. I can regenerate all my figures pretty
quickly that way. That's the big payoff for investing the time to write a
script upfront.

The view functionality does sound very nice though, especially since I
don't currently have a way to achieve transitions with my scripts (other
than perhaps creating views within the scripts themselves?). Elaine, is
there a way to use sessions so that I could replace a model or map with a
new version of a file after I've already created a session?

Cheers,
Alexis

On Mon, Feb 10, 2020 at 9:26 AM Elaine Meng <meng at cgl.ucsf.edu> wrote:

> Hello,
> Maybe I’m missing something, but the “view” command allows saving and
> restoring named views.  These are included in saved session files.  I agree
> window size is also a factor, so you would make sure to set the same window
> size too.
>
> E.g. once you have the view you like then use a command like:
>
> view name myview
>
> <http://rbvi.ucsf.edu/chimerax/docs/user/commands/view.html#name>
>
> Then you can save the session file and/or move things around.  Later in
> the same session or after restoring the previously saved session from file,
>
> view myview
>
> …will restore that view.  Restoring the session restores window size if
> you have that Window Preference set:
> <http://rbvi.ucsf.edu/chimerax/docs/user/preferences.html#window>
>
> or you could have noted the window size when you saved the view:
>
> windowsize
>
> …and then use the reported values later to restore that size, e.g.
>
> windowsize 600 400
>
> <http://rbvi.ucsf.edu/chimerax/docs/user/commands/windowsize.html>
>
> I hope this helps,
> Elaine
> -----
> Elaine C. Meng, Ph.D.
> UCSF Chimera(X) team
> Department of Pharmaceutical Chemistry
> University of California, San Francisco
>
> > On Feb 10, 2020, at 8:53 AM, Alexis Rohou <a.rohou at gmail.com> wrote:
> >
> > Hi Christophe,
> >
> > I prepare my figures using ChimeraX command (.cxc) scripts and I believe
> I have a workflow that lets me reproduce exact views. I know it's not 100%
> robust, but it's reliable enough for me. It basically relies on a sequence
> of close; windowsize; view matrix; zoom; clip; save.
> >
> > Here is a pseudo script. To work out the values you need for the
> matrices, just move your point of view and your models until you are happy,
> then do "view matrix".  I have not worked out a good way to get the
> distances for the clip planes. So I just play with them on the command line
> until I get the look I want, then save the values in my cxc file.
> >
> > Hope this helps & that more experienced users can chime in with
> improvements.
> >
> > Cheers,
> > Alexis
> >
> >
> > # close anything currently open
> > close
> > # go to relevant directory
> > cd /my/absolute/path
> > #
> > windowsize 1200 1200
> > camera ortho
> > clip near off far off front off back off
> > # Open files
> > open my_model.pdb name "my model"
> > open my_map.mrc name "my map"
> > # etc.
> >
> > #insert here coloring, styles, for the model/map/background etc
> >
> > # Go to your favorite view point, save a shot
> > view matrix camera 1,0,0,182.59,0,1,0,229.79,0,0,1,352.89
> > zoom 0.33
> > clip near off far off front off back off; clip near -100.0 far +100.0
> front off back off
> > ~select
> > save my_figure.png supersample 3 transparentBackground false
> >
> > # If you need to move your models
> > view matrix models
> #1,0.91269,-0.0093359,-0.40855,59.153,-0.40865,-0.018906,-0.91249,368.7,0.00079806,0.99977,-0.02107,-44.893,#2,-0.83654,-0.058918,-0.54474,344.52,-0.54355,-0.035951,0.83861,293.33,-0.068993,0.99762,-0.0019503,-42.032
> >
> > # then take another shot
> > view matrix camera
> 0.98289,-0.005269,-0.18408,131.07,-0.17421,-0.3506,-0.92018,70.662,-0.059691,0.93651,-0.34553,163.8
> > clip near off far off front off back off; clip near -20.0 far +12.0
> front off back off
> > save Figures/TRPA1_3551_binding_site_details1.png supersample 3
> transparentBackground false
> >
> >
> >
> >
> > On Sun, Feb 9, 2020 at 10:01 AM Christophe Leterrier <
> christophe.leterrier at gmail.com> wrote:
> > Hi,
> >
> > I haven't been able to find how to
> > - log
> > - set
> > - store
> > - recall
> >
> > a precise view (ie get the same exact image if I do a snapshot).
> >
> > First use case would within the same session (fixed computer, window
> size, no restart of the application in between). Second use case (more
> tricky?) would be independently of computer / window size / current session.
> >
> > Thanks for your help!
> >
> > Christophe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimerax-users/attachments/20200210/31e61cb0/attachment.html>


More information about the ChimeraX-users mailing list