== OVERVIEW ==
This script will renumber all the residues such that the first one is numbered 0. This is often helpful when dealing with alignments.
Ordering from Sequence End
If you want to change numbering based off the last residue's number in the sequence, just replace first in the code with last.
EXAMPLE
zero_residues 1AFK
zero_residues *
# make the first residue's number, 30.
zero_residues 1AFK, 30
INSTALL
Copy the source code below, to "zero_residues.py" and then simply run the file. The command, "zero_residues" will now be defined and can be used as in the examples above.
CODE
<source lang="python">
from pymol import cmd, stored
def zero_residues(sel1,offset=0,chains=0):
"""
DESCRIPTION
Renumbers the residues so that the first one is zero, or offset
USAGE
zero_residues selection [, offset [, chains ]]
EXAMPLES
zero_residues protName # first residue is 0
zero_residues protName, 5 # first residue is 5
..→