
Hi team! I have what I hope is an easy question. I'm accessing ChimeraX commands via python script, and I need a list of the Chain IDs. I'm currently getting the number of chains using the num_chains property. I've done quite a bit of digging through documentation and can only find ways to rename, or view interfaces, but I can't seem to find any specific command to list them. I feel as though it must be so basic, no one has needed to ask. :) Thanks for your help, Diana Lee Graduate Student Luque Lab, SDSU VII

Hi Diana, If m is your model, then the list of polymeric chain IDs is m.chains.chain_ids. If you want all chain IDs including those containing only ligands/water, try m.residues.unique_chain_ids. Best regards, Tristan ________________________________ From: ChimeraX-users <chimerax-users-bounces@cgl.ucsf.edu> on behalf of Diana Lee via ChimeraX-users <chimerax-users@cgl.ucsf.edu> Sent: 29 June 2021 19:44 To: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: [chimerax-users] Accessing Chain IDs Hi team! I have what I hope is an easy question. I'm accessing ChimeraX commands via python script, and I need a list of the Chain IDs. I'm currently getting the number of chains using the num_chains property. I've done quite a bit of digging through documentation and can only find ways to rename, or view interfaces, but I can't seem to find any specific command to list them. I feel as though it must be so basic, no one has needed to ask. :) Thanks for your help, Diana Lee Graduate Student Luque Lab, SDSU VII

Hi Diana, Tristan's answer is 100% accurate. Just wanted to apologize for how hard it is to find, but it is in there. The documentation for the Chain class is linked to from Python Classes — ChimeraX 1.3 documentation <https://www.cgl.ucsf.edu/chimerax/docs/devel/classes.html>. Unfortunately almost all the useful attributes are in Chain's StructureSeq base class, so you have to follow the link to the base class to see them. Another trick is that if you're in the Python shell (Tools→General→Shell) and you have an instance of something and you want to know its attributes/methods then dir(something) will list those. --Eric Eric Pettersen UCSF Computer Graphics Lab
On Jun 29, 2021, at 11:59 AM, Tristan Croll via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi Diana,
If m is your model, then the list of polymeric chain IDs is m.chains.chain_ids. If you want all chain IDs including those containing only ligands/water, try m.residues.unique_chain_ids.
Best regards, Tristan From: ChimeraX-users <chimerax-users-bounces@cgl.ucsf.edu> on behalf of Diana Lee via ChimeraX-users <chimerax-users@cgl.ucsf.edu> Sent: 29 June 2021 19:44 To: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: [chimerax-users] Accessing Chain IDs
Hi team! I have what I hope is an easy question. I'm accessing ChimeraX commands via python script, and I need a list of the Chain IDs. I'm currently getting the number of chains using the num_chains property. I've done quite a bit of digging through documentation and can only find ways to rename, or view interfaces, but I can't seem to find any specific command to list them. I feel as though it must be so basic, no one has needed to ask. :)
Thanks for your help, Diana Lee
Graduate Student Luque Lab, SDSU VII _______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
participants (3)
-
Diana Lee
-
Eric Pettersen
-
Tristan Croll