rotamer module

Documentation and manipulation of protein side-chain rotamers.

Module author: Michael S. Chapman <chapmami@ohsu.edu>

Authors:

Michael S. Chapman <chapmami@ohsu.edu>,

Oregon Health & Science University

Version:

0.5, March 23, 2016

Changed in version 0.1.1: 10/23/12 Start

Changed in version 0.5.0: (5/2/15) ReStructured Text documentation

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.

Variables:
  • index – 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.
Parameters:
  • atoms (class Atoms) – Coordinate set
  • residue (int) – residue number
  • chain (str (len=1)) – Chain label
  • segid (str (len=4)) – Segment identified, optional
  • quiet (bool) – suppress warnings
Z = {'C': 6, 'H': 1, 'O': 8, 'N': 7, 'S': 16, 'O1-': 8}
all_atoms = None

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 = None

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 = None

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