<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Isabelle,<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>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:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>from chimerax.core.commands import run</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>s = run(session, "open <i class="">my_structure_file</i><span style="font-style: normal;" class="">")[0]</span></div><div class=""><span style="font-style: normal;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>for chain in s.chains:</span></div><div class=""><span class="Apple-tab-span" style="font-style: normal; white-space: pre;"> </span>if chain.chain_id == "A":</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>s.renumber_residues(chain.existing_residues, -7)</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class=""><div class="">--Eric</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Eric Pettersen</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>UCSF Computer Graphics Lab</div></div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On May 13, 2022, at 2:56 PM, Phan, Isabelle via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">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.<br class=""><br class="">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:<br class=""><br class="">from chimerax.core.commands import run<br class="">run(renumber_residues('#1/A:*', -7))<br class=""># FAIL<br class=""><br class="">Sorry if this is trivial, I am still completely baffled by ChimeraX despite using it for years.<br class=""><br class="">Thanks,<br class=""><br class="">Isabelle<br class="">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.<br class=""><br class="">_______________________________________________<br class="">ChimeraX-users mailing list<br class=""><a href="mailto:ChimeraX-users@cgl.ucsf.edu" class="">ChimeraX-users@cgl.ucsf.edu</a><br class="">Manage subscription:<br class="">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users<br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>