Hi,

I second Guillaume's and Moritz's.
Scripts (.cxc) also have the advantage that we can replace the pdb/map (and solve the other thread of replacing a model in a session file). Or when making the same figure, but with an alternating pdb as I'm doing now.

In Pymol, the clipping is done from the centering position, which can vary if we choose to recenter to a different position. It is thus relative to the center point and defining clipping according to this position might be a way to go ?

Best
Vincent

Le 30/08/2023 à 18:28, Guillaume Gaullier via ChimeraX-users a écrit :

Session files are good while actively working on figures, but they are more difficult to share than a command file (most session files are too big to attach to an email), and also take up more space for archival. I like preparing figures with command files, this way I can always re-create the session from the command file if I need it, and I can also post these command files online once the paper is published (see https://github.com/Guillawme/chimerax-viz/ ; git would choke with many large session files while it's a breeze with command files).


Guillaume



From: Tom Goddard via ChimeraX-users <chimerax-users@cgl.ucsf.edu>
Sent: Wednesday, August 30, 2023 5:57:17 PM
To: Hunkeler, Moritz
Cc: ChimeraX Users Help
Subject: [chimerax-users] Re: save "side view" settings
 
Hi Moritz,

  The way to create figures and later change them in ChimeraX is to save a session "save figure1.cxs", then later when you decide you want to change it "open figure1.cxs".  This works very well.  Usually I name the session file the same as the image name "save figure1.png".  In theory you could record all the info with commands, including lots you left out like which atoms are shown, what ribbons, what surfaces, their colors, what text labels are shown, the window aspect ratio, ..., but I don't see the advantage of figuring out all the commands to reproduce the scene.  Is that how it is done in PyMol?

  Regarding using the center of the box for the clip plane reference point, it is not great, because if you decide to hide one chain then the center is now in a different position and the clip plane positions are different.

Tom


On Aug 30, 2023, at 7:27 AM, Hunkeler, Moritz via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:

Hi Tom,
 
I understand that it can get complicated without a defined point of reference. And again, it’s possible to get around it by just ‘clip off’ in figure scripts, so this discussion is just about details. I guess it is just confusing sometimes, as I have seen people struggling with this before.
 
For me it’s more a matter of ease-of-use. As in I would like to have a command that writes out all necessary settings to recreate a view of a model/map. For example, why can the point of reference not be (and stay) the center of the surrounding box for the displayed model(s), irrespective of already applied clipping planes? And then write out the position of the clipping planes plus the depth cue values when using e.g. ‘view matrix’ (or some other command). Like this all the important information for recreating a certain view (of these model(s)) could be written out from a single command and could then be copied into a script . Again, that would be similar to ‘get_view’ in pyMOL (https://pymolwiki.org/index.php/Get_View). Right now, to recreate a view reproducibly looks something like this:
 
  1. ‘view matrix’ -> copy paste the camera values into the  script
  2. ‘clip list’ -> copy paste the clip values into the script after a clip off command
  3. Decide what lighting and depth cue values -> copy paste into script
  4. Then the script will look somewhat like this
 
view matrix camera -0.18203,-0.11049,-0.97707,-138.8,-0.96294,-0.1811,0.19988,197.66,-0.19904,0.97724,-0.073424,107.97
clip off
clip near -3
clip far 30
lighting soft depthCueStart  0.5 depthCueEnd  0.7
save "PNG/example.png"
 
Which is completely fine, but it would save some copy-pasting if everything was accessible from a single command.
 
Best,
Moritz
 
 

From: Tom Goddard <goddard@sonic.net>
Date: Tuesday, August 29, 2023 at 9:35 PM
To: Hunkeler, Moritz <Moritz_Hunkeler@DFCI.HARVARD.EDU>
Cc: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu>, vincent Chaptal <vincent.chaptal@ibcp.fr>
Subject: Re: [chimerax-users] save "side view" settings

        External Email - Use Caution        

Hi Moritz,
 
  I agree that absolute clip plane positions can be useful.  The question is what are the absolute positions measure relative to?  For example if I say "clip near 8" that is supposed to be 8 Angstroms in front of what point?  The rules the ChimeraX clip command uses are a bit complicated because what reference point to measure distances from is not obvious.  So if no clip planes are shown then the 0 position is the center of the bounding box of the displayed models.  If the clip plane is shown then 0 means the current plane position.  And if you want to define your own reference point then use the position option "clip near 8 position /B:123@CA" means the 0 point is at the C-alpha atom of residue 123 in chain B.
 
  To get reproducible clip plane positions you need a reproducible reference point that the distances are measured relative to.
 
Tom
 


On Aug 28, 2023, at 10:25 AM, Hunkeler, Moritz via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
 
Not 100% sure I understand the question correctly, but maybe the confusing part is the following: The clip numbers are not absolute, but are additive. As in every time you use the following command:

 

clip far 35

 

the far clipping plane would be moved by 35. This can lead to some inconsistencies, for example when one uses ‘clip list’ and gets a value of 210, and then puts that value into a script that changes the clipping plane several times for different views. Safest way to not have that problem is: put a ‘clip off’ in front of all clipping commands in a script. This way the exact view will be reproduced every time. E.g.

 

.
.
.
#set view 1
view matrix camera  -0.20791,2.5127e-09,-0.97815,-250.33,-0.97815,-4.5356e-09,0.20791,309.25,-9.8669e-09,1,4.8527e-09,229.38
clip off
clip near -1
clip far 134
save "PNG/view_1.png" 

 

#set view 2
view matrix camera  -0.96824,-0.21649,0.12504,-223.03,-0.075286,-0.22447,-0.97157,-549.26,0.2384,-0.95013,0.20104,356.85
clip off
clip near -16
clip far 35
save "PNG/view_2.png" 
.
.
.

 

In this example, the first view will be at clipping near/far of -1/134, and the second view will be at -16/35. If one omits the ‘clip off’, the second view would be at clip near=-17 and clip far=169 (instead of the intended -16, 35)

 

For me personally absolute values would be more intuitive (I guess similar to pymol (which many people might be used to), where ‘get_view’ would give you a matrix that reproduces both view and also clipping/fogging every time, no matter whether there is already fog/clipping present.)

 

Best,
Moritz

 

 

 

From: Elaine Meng via ChimeraX-users <chimerax-users@cgl.ucsf.edu>
Date: Monday, August 28, 2023 at 11:59 AM
To: vincent Chaptal <
vincent.chaptal@ibcp.fr>
Cc: ChimeraX Users Help <
chimerax-users@cgl.ucsf.edu>
Subject: [chimerax-users] Re: save "side view" settings

        External Email - Use Caution        

Hi Vincent,
I always save a session file with the view for each publication image.  Trying to do it this other way is much harder, in my opinion, and I have never tried it myself.  As far as I know, the "view matrix" command should report (and restore) the camera and model positions, and "clip list" report (and "clip" restore) the clipping plane position(s): 

<
https://secure-web.cisco.com/1MVnhhzN19WBilS9gDO4_Q4yCh88PWvZfX-39fwyPLIlx6y4Vz3erktHutC1_lKG0kNF5i7X1vpZ7EWpHymhI9own4UCYQDyy245qU8KiJfSeI282n3t0Lt4kYQGx7NLjSiWQYIRlp84o6PVH6X9EUHJBZzTt2SRhRejzqbrEhvgPa64B1kDYW8xNta0vRQDIBmq8mjNAC3NY5px5EfwuoG0iTlnewXuEifYJRWHp6ACyMas0YrxHVwJfshSUq8ank_K2DLemsI1f6ECTd8K7bZCVQ4RFPwUkWmX8Tr41j_tEfbkruTRSi5UoMb6FcMAsNnE9QFKwhNLqfOFG2hXo_w/https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fview.html%23matrix>
<
https://secure-web.cisco.com/1rH6UOFHJhkT9dijsnzAEc3Hc8ARJKTd5xv5ALjfH1y-k5g4IK3l8co6LiNk9qjkgrwKk9eMLlyWjhtYrdPqg4Siy0MRjcp9fZngrYrOFiTM8kjV3bxH7udnPoeNhGW3st_N9PH9-pYscgbTW9E508Wf4-U5IkR2tVGRqGOimTv68XGSjgm5QqZMsIdGZUJS0Ahkn2CPJYnNE450ekgoCE5nUnXSenyXxRNbUq8__qZTIas3sBteUOb1Enmo05OXaswwSZLia_YEYuK6XbH5Ewb13Fht0YRaay0qjzUobh05clvM-qA550zp_NjZAUGpXKviIAWGEh5Io-IFqO0pUvQ/https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fclip.html>

What you showed for results from "clip list" does not make sense:  the near and far planes do not have a tilt axis, so their axis will only be 0,0,1 or 0,0,-1.  But you said "modified" so maybe you edited it?  It is impossible for me to tell what is really in your session if you don't include the whole results for clip list. 

Then if you want it to look the same you should set exactly the same clip plane(s) as reported by clip list.  If you have a front or back plane, you should also set the reported axis ("axis" option of "clip", see help above) and point cordinates  ("position" option of "clip").

If it is not working and you feel it is a bug, please use Help... Report a Bug and attach the session, and the details of how you tried to reproduce it; however, that would put your data in a publicly available repository.  If you have a simpler example you could attach that to the bug report instead.

I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.                       
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco


> On Aug 28, 2023, at 7:48 AM, vincent Chaptal via ChimeraX-users <
chimerax-users@cgl.ucsf.edu> wrote:
> 
> Hi Elaine, 
> 
> I've been playing around with it but I can't get to what I want. 
> The second option of saving views works within a session, but it is lost if I restart ChimeraX or changes session, so what I'm looking for is really some numbers to place in a script so I can touch up my figure for publication multiple times. 
> 
> Using "clip list" does list me an offset for the "far", as I modified it: 
> Using 1 clip planes:
> far offset -1.5964, axis 0.032,-0.040,0.999, point 106.7,107.9,112.8)
> 
> I am trying to reproduce the view with:
> view matrix camera 0.051145,-0.99818,0.03201,113.43,0.99794,0.049838,-0.040387,99.325,0.038719,0.034009,0.99867,323.92
> clip front 0 far -1.5964
> 
> (and varying flavors) but it doesn't recreate the same view. The clipping offset is much more drastic with my command line compared to the manual twicking of the far plane. 
> Could you please point me in the right direction? 
> Thank you
> Vincent
> 
> 
> Le 22/08/2023 à 17:08, Elaine Meng a écrit :
>> Hi Vincent,
>> You can report current clip settings in the Log with command:
>> 
>> clip list
>> 
>> 
>> <
https://secure-web.cisco.com/1rH6UOFHJhkT9dijsnzAEc3Hc8ARJKTd5xv5ALjfH1y-k5g4IK3l8co6LiNk9qjkgrwKk9eMLlyWjhtYrdPqg4Siy0MRjcp9fZngrYrOFiTM8kjV3bxH7udnPoeNhGW3st_N9PH9-pYscgbTW9E508Wf4-U5IkR2tVGRqGOimTv68XGSjgm5QqZMsIdGZUJS0Ahkn2CPJYnNE450ekgoCE5nUnXSenyXxRNbUq8__qZTIas3sBteUOb1Enmo05OXaswwSZLia_YEYuK6XbH5Ewb13Fht0YRaay0qjzUobh05clvM-qA550zp_NjZAUGpXKviIAWGEh5Io-IFqO0pUvQ/https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fclip.html>
>> 
>> 
>> More to your point, however, you can save the current view (which includes the clipping plane positions) with command:
>> 
>> view name myviewname
>> 
>> ....of course you can name it something else, and you can have multiple saved views with different names.  Then later in the same session, either not quitting ChimeraX between, or from saving a session file after you saved the view(s) and later restoring the session from the file, you can get back to that view with command:
>> 
>> view myviewname
>> 
>> ...there are various command options, like gradually moving to the view over a number of frames as is often done for recording a movie, see the help:
>> 
>> <
https://secure-web.cisco.com/1QzMfrb2bZI0tVknJWm-znSsYye9DecegVUfz15eWNt_8AzFuzOAXgIKZHBreojVsS73FrNrwRrBkd1UE6S9pAAamQqPRyDDZpT89CZXZntBovx5URBa_xBs8IfMrD3wLZEvvwUAzrWsz9CWHBWQL_su4yWaM0qW8ffrI5NlHt4dFq_nntTiGdUqU-BsNjJX6g-2Tp2mo_eAnYDw34TAbUD5IYF-t_5kUJrLOSpz_MWw4dELuErBKnv50drbgJl4KhiovI4fsA6zDL0ybgaxcv5n6Vm4noNShHARvqUWPNI8YAPpxGbCnOGZ8fL-rqwoVhPI7bCw8EaLQuu9syS9Fuw/https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fview.html%23name>
>> 
>> 
>> I hope this helps,
>> Elaine
>> -----
>> Elaine C. Meng, Ph.D.                       
>> UCSF Chimera(X) team
>> Department of Pharmaceutical Chemistry
>> University of California, San Francisco
>> 
>> 
>>> On Aug 22, 2023, at 3:34 AM, vincent Chaptal via ChimeraX-users <
chimerax-users@cgl.ucsf.edu>
>>>  wrote:
>>> 
>>> Hi, 
>>> 
>>> I opened the side view dialog window and adjusted the view planes for a nice figure. 
>>> I would like to save the parameters so I can go back and modify the figure at a later stage, but the setting are not stored in the "view matrix" command. 
>>> Could you tell me which command can save these settings? (I'm using chimeraX 1.5).
>>> 
>>> Thank you.
>>> Best
>>> Vincent
>>> 
> 
> -- 
> Vincent Chaptal, PhD
> Director of GdR APPICOM
> Drug Resistance and Membrane Proteins Lab
> 
> MMSB -UMR5086
> 7 passage du Vercors 
> 69007 LYON
> FRANCE
> +33 4 37 65 29 01
> 
http://secure-web.cisco.com/1Jw2wqm82BlLwDhGvezoCHIjxc5KT0yVHQFrUSCIA7tGyJPdm1lKrSZkNAyLH5cAW7SzFeIeGsL8e5nT0xTPdSWiHINNqNlVqgCK82ewBZ8cNSYNZ1FxBu0WYTm2jm70Ej0RNO6N7_NYMCQWJ_X0rPKe5ui_9UpkqMBLqdG74-vsos7XlfPMhzhiQIvkBw5svcpBQVx9tUcTDIM_eghTeLo86IbDBN7RK1UM4FnZ4duYIq6DjV4rGVa44bljPdWSRiZQ3Ci62V6Bd2UhevNjlEvFxVFA75YBcMhVvkMn3uNTu63BgQlXrDJs6mIJ_MWqC76K-INoP37N0RnXoCDj9Vg/http%3A%2F%2Fwww.appicom.cnrs.fr
> 
http://secure-web.cisco.com/1dJbUg3FMhRO53a0TOcDiRztwiHxyX5efun_yRGQmanKtYpGNq5N8NEkU0Ue3Cfis0qxa2vhV5DLdY4xFgQAMQDUm8sWgXeE9TIfJhvuVPWEwwbACWxcW4q79ljZyCGtmOp57DEVWdS8Tq7oh3HQgtMYh7avWs2IyqQKTuG3cXf6W3BfoXtPLeAp_vb2grhFK6Jv9ykGUbLxfEdTaq2ZFky600yHermrAOVi2FWgQN1jizGH834gp2_skw5fGeI3fBWtvjhJ5aue0_PTMgGFYOlhFRTe1vju-bX02u43F8WDgC89aeIglsyKRy07-p2d2co6KZgOfg-HudF3C5IJTBQ/http%3A%2F%2Fmmsb.cnrs.fr%2Fen%2F
> 
> _______________________________________________
> ChimeraX-users mailing list -- 
chimerax-users@cgl.ucsf.edu
> To unsubscribe send an email to 
chimerax-users-leave@cgl.ucsf.edu
> Archives: 
https://secure-web.cisco.com/1Bq4XXRT5xl47h-0oUXAvH6QIe8H0yGPknLwTmCVuBiEgkRNGZMNBBXh6yY7vkIcxr3lJxlxupJCjmD3PuyAgU3RmX0p3OLst4tI8vUFzRSe7mTUqaoEoT6SKt_nM7zirPypE_GlXaTCEGg18ULrRcJ9OmaY39m2s3GrCgT_KxO1DK2ZodWT4hYkJhXZJ5GAsnjbCQYNv58gBIH5CRZWOv7vcOu7lxBnlGEUMWLPZr9K_ly_Rty_dXRFcZdsgnzwOjmourF-UG-sS3cA6XWek5KBjhiI-4T8zaUYk7kfD9acDSiMeA5G3w35WJr2SK0f3doxqJSkxcedKBoGjcO1ong/https%3A%2F%2Fmail.cgl.ucsf.edu%2Fmailman%2Farchives%2Flist%2Fchimerax-users%40cgl.ucsf.edu%2F


_______________________________________________
ChimeraX-users mailing list -- 
chimerax-users@cgl.ucsf.edu
To unsubscribe send an email to 
chimerax-users-leave@cgl.ucsf.edu
Archives: 
https://secure-web.cisco.com/1Bq4XXRT5xl47h-0oUXAvH6QIe8H0yGPknLwTmCVuBiEgkRNGZMNBBXh6yY7vkIcxr3lJxlxupJCjmD3PuyAgU3RmX0p3OLst4tI8vUFzRSe7mTUqaoEoT6SKt_nM7zirPypE_GlXaTCEGg18ULrRcJ9OmaY39m2s3GrCgT_KxO1DK2ZodWT4hYkJhXZJ5GAsnjbCQYNv58gBIH5CRZWOv7vcOu7lxBnlGEUMWLPZr9K_ly_Rty_dXRFcZdsgnzwOjmourF-UG-sS3cA6XWek5KBjhiI-4T8zaUYk7kfD9acDSiMeA5G3w35WJr2SK0f3doxqJSkxcedKBoGjcO1ong/https%3A%2F%2Fmail.cgl.ucsf.edu%2Fmailman%2Farchives%2Flist%2Fchimerax-users%40cgl.ucsf.edu%2F
The information in this e-mail is intended only for the person to whom it is addressed.  If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline .
 
Please note that this e-mail is not secure (encrypted).  If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately.  Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.  
_______________________________________________
ChimeraX-users mailing list -- 
chimerax-users@cgl.ucsf.edu
To unsubscribe send an email to 
chimerax-users-leave@cgl.ucsf.edu
Archives: 
https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
 
The information in this e-mail is intended only for the person to whom it is addressed.  If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline .

Please note that this e-mail is not secure (encrypted).  If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately.  Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.  
_______________________________________________
ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/


VARNING: Klicka inte på länkar och öppna inte bilagor om du inte känner igen avsändaren och vet att innehållet är säkert.
CAUTION: Do not click on links or open attachments unless you recognise the sender and know the content is safe.
Page Title







När du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/

E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here: http://www.uu.se/en/about-uu/data-protection-policy
_______________________________________________
ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

--

Vincent Chaptal, PhD

Director of GdR APPICOM

Drug Resistance and Membrane Proteins Lab


MMSB -UMR5086

7 passage du Vercors 

69007 LYON

FRANCE

+33 4 37 65 29 01

http://www.appicom.cnrs.fr

http://mmsb.cnrs.fr/en/