rotamer module¶
Documentation and manipulation of protein side-chain rotamers.
Module author: Michael S. Chapman <chapmanms@missouri.edu>
Module author: Andrew Trzynka
- Authors:
Michael S. Chapman <chapmanms@missouri.edu>
Oregon Health & Science University & University of Missouri
- Version:
1, Nov 26, 2024
Changed in version 0.1.1: 10/23/12 Start
Changed in version 0.5.0: (5/2/15) ReStructured Text documentation
Changed in version 0.5.1: (5/23/18) When looking up Z in Rotamer.extendIndex(), strip ‘1234+-’ (Andrew)
Changed in version 1.0.0: (10/06/20) Python 2.7 –> 3.6
- class rotamer.Rotamer(atoms, residue, chain=None, segid=None, quiet=False)¶
Bases:
object
Tested by regression, Chi angle compared with Coot for examples of all 20. Should be a good test of extendIndex and Chi.
- Parameters:
atoms (Atoms) – Coordinate set
residue (int) – residue number
chain (str) – Chain label (single character)
segid (str) – Segment identified, optional (four character)
quiet (bool) – suppress warnings
- Variables:
~.index (list(int)) – Atom indices from N through side-chain along the path defining chi angles. Note that need not be complete as can be shortcut once ambiguities for IUPAC conventions are resolved and the chi for all non-H atoms are defined.
type (str) – residue type.
num_chi (int) – number of variable chi angles that affect non-H atoms.
~.error (bool) – error ocurred during instantiation, eg. unsupported alternative conformers - residue rotamer cannot be used.
- Z = {'C': 6, 'H': 1, 'N': 7, 'O': 8, 'O1-': 8, 'S': 16}¶
- all_atoms¶
slice, residue atoms
- chi(angle=None, degrees=False)¶
Side chain torsion angle(s).
- Parameters:
angle (int or NoneType) – specified n as in χn, or None for all.
degrees (bool) – convert to degrees (from radians).
- Returns:
angle(s) or None if no variable χ-angles.
- Return type:
float or list(float) or NoneType
- error¶
False if unambigous etc..
- extendIndex(index, assertSuccess=False)¶
Add the next atom index along the side chain.
- Parameters:
index (list(int)) – Atom indices, primed with at least N, CA, CB
assertSuccess (bool) – require an atom to be added.
- Returns:
index, Z-number of atom added (0 if failed).
- Return type:
list(int), int
- Uses IUPAC-like rules:
Next atom should be unused neighbor of highest mass.
Tie-breaker goes to atom bonded to atom of higher mass.
Applies above recursively until no more atoms.
If still tied, goes back to the branch point and chooses lower in alphanumeric ranking, i.e. CD before CE and O1 before O2.
Above is short-cut if extension path converges on same atom, implying a closed ring.
- index¶
atom indices fr N down chi-defining side chain atoms
- rotate(n, angle)¶
Rotate χn by angle (rad), standard conventions.
- Returns:
self.atoms (modified).
- Return type:
Atoms
- rotamer.flip(moving, reference, referenceIndex=None, residue_types=['glu', 'gln', 'asp', 'asn', 'his', 'phe', 'tyr', 'arg'], verbosity=0)¶
χ += 180deg for (pseudo-)symmetrical side chains if closer to reference.
Adds 180 deg to χ if that brings it closer to the corresponding χ of the reference structure. Thus, it is a local evaluation that is dependent upon atom pairing, but not on their coordinate superimposition.
- Parameters:
moving (
Atoms
) – Coordinates that are being superimposed / changing.reference (
Atoms
) – Coordinates that are fixed.referenceIndex (dict) – optional dictionary whose keys are indices to moving atoms and whose values are indices of reference atoms (if None, assumes 1:1 correspondence).
residue_types (list of strings) – to be tested
verbosity (int) – 1 for verbose output, 0 terse, -1 quiet, 2 debugging.
- Returns:
moving (updated)
- Return type:
Atoms