[chimerax-users] Where is the renumber sequence tool in ChimeraX?
Phan, Isabelle
Isabelle.Phan at seattlechildrens.org
Mon May 16 17:25:22 PDT 2022
That’s exactly what I needed, thank you Eric!
Isabelle
> On May 16, 2022, at 4:57 PM, Eric Pettersen <pett at cgl.ucsf.edu> wrote:
>
> CAUTION: This email originated outside of this organization.
>
> Hi Isabelle,
> To answer your question directly, chain.existing_residues is all the residues in the chain with atomic coordinates, in chain order, and can be used like a list. So, to renumber the first 10 residues starting with -7:
>
> s.renumber_residues(chain.existing_residues[:10], -7)
>
> To renumber the next 28 residues starting with 35:
>
> s.renumber_residues(chain.existing_residues[10:38], 35)
>
> and so forth. However if all you want to do is subtract a certain amount from each residue number (e.g. 8, to change residue number 1 to -7 and so forth) then this is simpler:
>
> for chain in s.chains:
> if chain.chain_id == "A":
> for r in chain.existing_residues:
> r.number -= 8
>
> --Eric
>
>> On May 16, 2022, at 4:43 PM, Phan, Isabelle via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
>>
>> Thanks Eric, this is very helpful.
>> Is it possible to renumber only a selected stretch of residues? That way I could start from the last gap to the C-term and work my way up the chain.
>>
>> Isabelle
>>
>>> On May 16, 2022, at 1:53 PM, Eric Pettersen <pett at cgl.ucsf.edu> wrote:
>>>
>>> CAUTION: This email originated outside of this organization.
>>> Hi Isabelle,
>>> Yes, there is no user-friendly way to renumber residues in ChimeraX yet. The renumber_residues() method that you found can do it, if you know how to call it correctly. Here is some code to renumber chain A in a structure starting from -7:
>>>
>>> from chimerax.core.commands import run
>>> s = run(session, "open my_structure_file")[0]
>>> for chain in s.chains:
>>> if chain.chain_id == "A":
>>> s.renumber_residues(chain.existing_residues, -7)
>>>
>>> The caveat is that if the chain has any missing residues, this renumbering won't maintain any jumps in numbering across those gaps -- the numbering will simply be consecutive. You would need fancier code to maintain jumps in numbering.
>>>
>>> --Eric
>>>
>>> Eric Pettersen
>>> UCSF Computer Graphics Lab
>>>
>>>> On May 13, 2022, at 2:56 PM, Phan, Isabelle via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
>>>>
>>>> The sequence of my structure includes a tag and I want to renumber from -7 so that the first residue is the start Met. I tried the old chimera command resrenumber = FAIL. I googled and searched the docs, read the list of commands one by one, and still could not figure it out.
>>>>
>>>> The API has a renumber_sequence() function but I don't understand the description (what’s "the given residues”? The chain?) and was unable to find an example on how to call this from the interface. I opened the python shell and typed:
>>>>
>>>> from chimerax.core.commands import run
>>>> run(renumber_residues('#1/A:*', -7))
>>>> # FAIL
>>>>
>>>> Sorry if this is trivial, I am still completely baffled by ChimeraX despite using it for years.
>>>>
>>>> Thanks,
>>>>
>>>> Isabelle
>>>> CONFIDENTIALITY NOTICE: This e-mail, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
>>>>
>>>> _______________________________________________
>>>> ChimeraX-users mailing list
>>>> ChimeraX-users at cgl.ucsf.edu
>>>> Manage subscription:
>>>> https://urldefense.com/v3/__https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users__;!!NuzbfyPwt6ZyPHQ!ubWYWCyaDXqs3EdCNDOFU2w-Kwf3WxJxrkrcDbt-a8TVKP5SjRkYKyI18qu7y-vUh_r3kn3IrnxC8KYAv8BDIad77ck$
>>>>
>>>
>>
>> CONFIDENTIALITY NOTICE: This e-mail, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
>>
>> _______________________________________________
>> ChimeraX-users mailing list
>> ChimeraX-users at cgl.ucsf.edu
>> Manage subscription:
>> https://urldefense.com/v3/__https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users__;!!NuzbfyPwt6ZyPHQ!ubWYWCyaDXqs3EdCNDOFU2w-Kwf3WxJxrkrcDbt-a8TVKP5SjRkYKyI18qu7y-vUh_r3kn3IrnxC8KYAv8BDIad77ck$
CONFIDENTIALITY NOTICE: This e-mail, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
More information about the ChimeraX-users
mailing list