
Hello! I am trying to measure the distance between two atoms in my trajectory in every 10th frame. My approach was to use the perframe command paired with the distance command. Below was my attempt: perframe "distance /D:15@NH1 /B:42@OD1;distance save dist$1.txt;~distance /D:15@NH1 /B:42@OD1" interval 10 However, it instead simply outputs the distance of the currently displayed frame over and over again. Any help would be appreciated! Ben ......................................... Benjamin Simonson MCIBS PhD Candidate Penn State University

Hi Ben, You also need a "coordset" command to actually play the trajectory. The perframe frames are graphics frames, not trajectory frames: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/perframe.html> Here is an example using an NMR structure opened as a trajectory: open 1plx coord true perframe "distance /A:1@N:4@CG; distance save dist$1.txt; ~distance" range 10,80,10; coordset #1; wait 80; ~perframe Note that it isn't necessary to name the atoms in the ~distance command. Simply giving ~distance will remove all current distance monitors. The example above will give files dist10.txt, dist20.txt ... dist 80.txt. Or alternatively, to name files dist1.txt, dist2.txt ... dist8.txt: perframe "distance /A:1@N:4@CG; distance save dist$1.txt; ~distance" ; coordset #1 10,80,10; wait 8; ~perframe In that second example, one tricky thing is that you need a space between the end quote and the semicolon that follows it. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Dec 9, 2022, at 8:18 AM, Simonson, Benjamin Thomas via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hello! I am trying to measure the distance between two atoms in my trajectory in every 10th frame. My approach was to use the perframe command paired with the distance command. Below was my attempt:
perframe "distance /D:15@NH1 /B:42@OD1;distance save dist$1.txt;~distance /D:15@NH1 /B:42@OD1" interval 10
However, it instead simply outputs the distance of the currently displayed frame over and over again. Any help would be appreciated!
Ben

Hi Elaine, Thanks so much for your help, I actually figured out I needed coordset about 2 minutes before you sent your email! And thank you for the other suggestions as well. Best, Ben ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: Friday, December 9, 2022 2:43 PM To: Simonson, Benjamin Thomas <bts5242@psu.edu> Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Perframe and distance [You don't often get email from meng@cgl.ucsf.edu. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi Ben, You also need a "coordset" command to actually play the trajectory. The perframe frames are graphics frames, not trajectory frames: <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Frbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fperframe.html&data=05%7C01%7Cbts5242%40psu.edu%7C0279a5cc1513488de84508dada1daebf%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C638062118279090465%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=iLEFLB2tf79o6ZgR9ZGgHRrXDRXkiBXTAiA00xAF%2B68%3D&reserved=0> Here is an example using an NMR structure opened as a trajectory: open 1plx coord true perframe "distance /A:1@N:4@CG; distance save dist$1.txt; ~distance" range 10,80,10; coordset #1; wait 80; ~perframe Note that it isn't necessary to name the atoms in the ~distance command. Simply giving ~distance will remove all current distance monitors. The example above will give files dist10.txt, dist20.txt ... dist 80.txt. Or alternatively, to name files dist1.txt, dist2.txt ... dist8.txt: perframe "distance /A:1@N:4@CG; distance save dist$1.txt; ~distance" ; coordset #1 10,80,10; wait 8; ~perframe In that second example, one tricky thing is that you need a space between the end quote and the semicolon that follows it. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Department of Pharmaceutical Chemistry University of California, San Francisco
On Dec 9, 2022, at 8:18 AM, Simonson, Benjamin Thomas via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hello! I am trying to measure the distance between two atoms in my trajectory in every 10th frame. My approach was to use the perframe command paired with the distance command. Below was my attempt:
perframe "distance /D:15@NH1 /B:42@OD1;distance save dist$1.txt;~distance /D:15@NH1 /B:42@OD1" interval 10
However, it instead simply outputs the distance of the currently displayed frame over and over again. Any help would be appreciated!
Ben
participants (2)
-
Elaine Meng
-
Simonson, Benjamin Thomas