p3d.atom module

From p3d
Jump to: navigation, search

The atom module holds the Atom class with a set of functions. The Atom class itself inherits all properties, functions and methods of the p3d.vector.Vector class. Therefore Atoms can be used as vectors and the p3d.geo classes Plane and TransformationMatrix can be used accordingly.

Atom class

p3d.atom.Atom(pdbfile-line)

Initialising an Atom object requires a line from a pdb file from which all the above mentioned attributes are extracted.

Attributes

x ⇒ x coordinate

y ⇒ y coordinate

z ⇒ z coordinate

idx ⇒ index number in original pdb file

atype ⇒ atom type: e.g. "OD2"

aa ⇒ residue name, e.g. HEM or ALA

chain ⇒ chain identifier e.g. A

resid ⇒ residue identifier e.g. 12 (is integer)

desc ⇒ placeholder for history log of vector operations

beta ⇒ beta value

user ⇒ user value

type ⇒ ATOM or HETATM

protein ⇒ pointer to the protein object in memory. This allows recursive queries

e.g. atom.protein.info()

model ⇒ model number (NMR structures)

pos_in_list ⇒ index position in the protein.atoms list, required for history log

altConf ⇒ alternative conformer labeled at position 1

altConf2 ⇒ alternative conformer labeled at position 2

elementType ⇒ element Type

charge ⇒ Charge

Methods

The atom class inherits all methods from the p3d.vector.

allAtomsOfSameResidue()
Returns a set of all atoms that are part of the same residue as the given atom.
allAtomsOfSameChain()
Returns a set of all atoms that are part of the same chain as the given atom.
calcPhiPsi(precision=0,allowAlternativeConfs=True)
Returns a list of tuples (phi,psi) in degrees for given residue.
optional keys are:
precision
usage: precision will round the calculated angle with the given precision
default: 0, e.g 129.0˚
allowAlternativeConfs
usage: allowAlternativeConfs gives the option to have only one phi,psi pair returned if for example multiple alternative conformers for the backbone are specified in the pdb file.
default: True

Input can be any amino acid atom. If an atom that is required to calculate phi or psi is missing in the structure a default value of -777 is returned. This allows for example to generate phi,psi angles for all residues although the first and the last residue can only provide psi and phi, respectively.

for atom in a.query("backbone and oxygen and (resid 1..10 or resid > 130)"):
   print(atom.info(),atom.calcPhiPsi())
       O   LEU A    3 [(-79.0, 57.0)]
       O   GLY A  131 [(95.0, -777)]
       O   THR A    4 [(-78.0, 169.0)]
       O   PRO A    5 [(-48.0, -46.0)]
       O   LEU A    8 [(-86.0, -12.0)]
       O   VAL A    7 [(-66.0, -43.0)]
       O   ALA A    1 [(-777, -98.0)]
       O   GLU A    2 [(-98.0, 173.0)]
       O   VAL A   10 [(-136.0, 164.0)]
       O   GLU A    6 [(-68.0, -33.0)]
       O   THR A    9 [(-97.0, 124.0)]
isHelical(mode='both')
Returns True of False if residue is helical by calling self.calcPhiPsi()
Helical boundaries are defined as:
phi = range(-82,42)
psi = range(-60,21)
Optional mode='both|phi|psi' to have both or only one dihedral checked.
minDistancetoResidue(ResidueAtom)
Returns the minimum Distance between the atom and a given Residue. Any residue atom can be used as an argument.
minDistancetoChain(ChainAtom)
Returns the minimum Distance between the atom and a given Chain. Any chain atom can be used as an argument.