Thank you, Tom.

Best,
Siyoung

On Jan 19, 2024, at 6:13 PM, Tom Goddard <goddard@sonic.net> wrote:

The ChimeraX command language does not have variables, it is not like a unix shell.  You would use Python to do ChimeraX scripting that needs variables or loops or if statements.  Examples of ChimeraX Python scripts are here

https://rbvi.github.io/chimerax-recipes/

Tom

On Jan 19, 2024, at 2:48 PM, kkssy141--- via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:

Hello,

Would it be possible to define a variable that represents the number of models? I want to make a chimerax script that aligns #1-#(N-1) to #N.

For instance, if I have a script like this where N represents the number of models opened in ChimeraX and save it as test.cxc
mm #1-#(N-1) to #N

In bash, I can open my PDB files that are aligned to a crystal structure 1be9:
chimerax *.pdb 1be9 test.cxc

The number of models (N) will be a dynamic variable depending on how many PDB files I have.
Thank you.

Best,
Siyoung

------------------
While writing, I figured the below would work.

test.cxc:
mm ~#1 to #1

In bash:
chimerax 1be9 *.pdb test.cxc

But I still want to ask this question to know whether it is possible to retrieve the number of models opened and set this to a variable in ChimeraX. Thanks.
_______________________________________________
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/