[chimerax-users] Perframe and distance
Elaine Meng
meng at cgl.ucsf.edu
Fri Dec 9 11:43:40 PST 2022
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 at N:4 at 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 at N:4 at 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 at 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 at NH1 /B:42 at OD1;distance save dist$1.txt;~distance /D:15 at NH1 /B:42 at 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
More information about the ChimeraX-users
mailing list