Determine an atom-spec from a selection
Hello chimerax-users, I am comparing different structures that all look mostly identical, and I have to generate figures of some interesting place, but they of course don't all have the same residue numbers and chain IDs (would be too easy...). I managed to work around this problem this way: - open reference structure in which I know the chain IDs and residue numbers I want to look at - open another structure, align it to the reference with mmaker - use 'select zone' with option 'residues true' and an appropriate distance cutoff from the reference structure to select the equivalent residues in the structure under scrutiny: works nicely, I simply have to tweak the distance cutoff interactively depending on how different the current structure is compared to the reference, but it is easier than looking up residue numbers and chain IDs and keeping track of all this different info per structure I am missing one thing: I would like to save these selections as named selections, so I can easily select them again further down in the script. So I need a way to say 'name someName sel' except I can't use that last 'sel' keyword because it is never expanded to the actual atom-spec that would make this trick work, and instead always points to whatever is currently selected. Is there a way to do this? I looked at 'info sel level residue' that prints to the Log something close to what I need (although more than just the atom-spec). Ideally I would like this to work from a command script, so I can automate the generation of the picture of that interesting location from many structures. Thank you in advance, Guillaume 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
Hi Guillaume, If I understand correctly, you can do what you want with "name frozen" instead of just "name" -- for example, name frozen blahblah sel Then blahblah will refer to what is selected at the time you issued the command above, regardless of what (if anything) is selected later. <https://rbvi.ucsf.edu/chimerax/docs/user/commands/name.html> I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Resource for Biocomputing, Visualization, and Informatics Department of Pharmaceutical Chemistry University of California, San Francisco
On Sep 8, 2025, at 7:25 AM, Guillaume Gaullier via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hello chimerax-users,
I am comparing different structures that all look mostly identical, and I have to generate figures of some interesting place, but they of course don't all have the same residue numbers and chain IDs (would be too easy...). I managed to work around this problem this way:
- open reference structure in which I know the chain IDs and residue numbers I want to look at - open another structure, align it to the reference with mmaker - use 'select zone' with option 'residues true' and an appropriate distance cutoff from the reference structure to select the equivalent residues in the structure under scrutiny: works nicely, I simply have to tweak the distance cutoff interactively depending on how different the current structure is compared to the reference, but it is easier than looking up residue numbers and chain IDs and keeping track of all this different info per structure
I am missing one thing: I would like to save these selections as named selections, so I can easily select them again further down in the script. So I need a way to say 'name someName sel' except I can't use that last 'sel' keyword because it is never expanded to the actual atom-spec that would make this trick work, and instead always points to whatever is currently selected.
Is there a way to do this? I looked at 'info sel level residue' that prints to the Log something close to what I need (although more than just the atom-spec). Ideally I would like this to work from a command script, so I can automate the generation of the picture of that interesting location from many structures.
Thank you in advance,
Guillaume
Yes this is exactly what I was looking for, thank you! This will make my current task a lot easier. Cheers, Guillaume ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: Monday, September 8, 2025 5:07:30 PM To: Guillaume Gaullier Cc: ChimeraX Users Help Subject: Re: [chimerax-users] Determine an atom-spec from a selection Hi Guillaume, If I understand correctly, you can do what you want with "name frozen" instead of just "name" -- for example, name frozen blahblah sel Then blahblah will refer to what is selected at the time you issued the command above, regardless of what (if anything) is selected later. <https://rbvi.ucsf.edu/chimerax/docs/user/commands/name.html> I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Chimera(X) team Resource for Biocomputing, Visualization, and Informatics Department of Pharmaceutical Chemistry University of California, San Francisco
On Sep 8, 2025, at 7:25 AM, Guillaume Gaullier via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hello chimerax-users,
I am comparing different structures that all look mostly identical, and I have to generate figures of some interesting place, but they of course don't all have the same residue numbers and chain IDs (would be too easy...). I managed to work around this problem this way:
- open reference structure in which I know the chain IDs and residue numbers I want to look at - open another structure, align it to the reference with mmaker - use 'select zone' with option 'residues true' and an appropriate distance cutoff from the reference structure to select the equivalent residues in the structure under scrutiny: works nicely, I simply have to tweak the distance cutoff interactively depending on how different the current structure is compared to the reference, but it is easier than looking up residue numbers and chain IDs and keeping track of all this different info per structure
I am missing one thing: I would like to save these selections as named selections, so I can easily select them again further down in the script. So I need a way to say 'name someName sel' except I can't use that last 'sel' keyword because it is never expanded to the actual atom-spec that would make this trick work, and instead always points to whatever is currently selected.
Is there a way to do this? I looked at 'info sel level residue' that prints to the Log something close to what I need (although more than just the atom-spec). Ideally I would like this to work from a command script, so I can automate the generation of the picture of that interesting location from many structures.
Thank you in advance,
Guillaume
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. 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
participants (2)
-
Elaine Meng -
Guillaume Gaullier