Rosetta  3.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
calccontacts Namespace Reference

Classes

class  atom_contact
 
class  contactProtein
 
class  resContact
 
class  shellAtom
 

Functions

def addMax_radius
 
def makeContactPDB
 
def parse_and_pair
 
def pair_close_internal
 
def pair_close_interface
 
def filterContacts
 
def makeContactProfile
 
def makeShellProfile
 
def initialize_global_flags
 
def addContacts
 
def makeContactMap
 

Variables

int smartfilter = 1
 
string contactAtoms = 'all'
 
float contactFilter = 8.0
 
string contactType = 'full'
 
string getAtoms = 'centroid'
 
int ligandFlag = 1
 
 refChain = None
 

Function Documentation

def calccontacts.addContacts (   startProtein,
  mode,
  parserule 
)
Add contacts to a Protein object from loadPDB.py
This is somewhat complicated because I need to convert the Protein into a
loadedPDB to calculate the contacts and then convert it back again.
However, this works efficiently because the getAllRes() function of a
Protein object maintains the original order of residues so that when
the protein is recreated using parse(), the original structure is
maintained.
def calccontacts.addMax_radius (   loadedPDBres)

References coordlib.dist_sq(), and max().

Referenced by makeContactPDB().

def calccontacts.filterContacts (   close_residue_list)
Filter a close_residue_list (output of pair_close_refAtoms) for residues
with at least one atom-atom contact of < 4.0A+
(the filter can be set to another distance in class contactProtein)

References coordlib.dist_sq().

Referenced by makeContactMap().

def calccontacts.initialize_global_flags (   mode)
global flags dependent on mode:

smartfilter:  filter on centroid-centroid distance in full atom mode,
but not in CA-CA mode or sidechain-sidechain centroid mode

contactAtoms:  defines atom list to iterate over when calculating contacts.
Allows full atom mode and single atom modes to use the same contact-
counting function

contactType:  control creation and printing of certain contact attributes
(Ncontacts, Nhbonds) only relevant to full atom mode

contactFilter:  the contact distance cutoff is dependent on the mode.
Currently, it is 4.0A for full atom mode, 7.0A for CA-CA mode, and 6.0A for
sidechain-sidechain centroid mode.

getAtoms:  global flag to determine if (whole residue) centroid and
sidechain centroid need to be initialized.  To save computing time.

Referenced by makeContactMap().

def calccontacts.makeContactMap (   pdb1,
  pdb2 
)
Calculate contacts between any two pdbs

References filterContacts(), initialize_global_flags(), makeContactPDB(), and pair_close_interface().

def calccontacts.makeContactPDB (   loadedPDB)
Add certain attributes to loadedPDB to make it a contactPDB:
centroid:  centroid of the residue or ligand
max_radius:  farthest atom from the centroid

To be computed later:
contactList:  a list of all contacts made by that residue
Ncontacts
Nhbonds

References addMax_radius().

Referenced by calccontacts.contactProtein.find_contacts(), and makeContactMap().

def calccontacts.makeContactProfile (   contactMap,
  loadedPDB 
)
Takes the contactMap of a contactProtein structure and adds the contacts
into the original loadedPDB
In makeContactPDB(loadedPDB), an empty contactList was added to each
residue in the loaded PDB.  This list will now be filled up with all the
contacts that each residue makes.

Also fill in Ncontacts and Nhbonds for each residue, which were initialized
to zero.

Referenced by calccontacts.contactProtein.initContactProfile().

def calccontacts.makeShellProfile (   contactProfile)
This converts a contact profile (list of residue-residue contacts for each
residue) to a shell profile (list of the atomic shell for each residue).

Contact profile format is useful for listing residues that contact a
particular residue, but it is tedious for analyzing the atomic shell of a
residue since one must search the atoms of each residue in the list.  Here
is an example:

contact profile format:

contacts for residue LYS A 4:
GLU A 3  N,CA,OE1
PRO A 5  CA,CB,CG

contact shell format:

shell for residue LYS A 4:
atom 1:  GLU A 3 N
atom 2:  GLU A 3 CA
etc.

This allows direct iteration over the atomic shell without having to iterate
through particular residues first.

Practically, for each atom in the shell, I want to keep track of printid
(residue label), index (list identifier used to compare different pdbs),
atom name, counts (used if multiple monomers are added), and an
I will keep an atom label that combines the index and the name for easy
referencing.  These attributes will be recorded in the shellatom class
at the top.

Referenced by calccontacts.contactProtein.convert_to_shell().

def calccontacts.pair_close_interface (   partnerA,
  partnerB 
)
Input:  partner A and partner B of a contactPDB
In internal case, just [partnerA] is given to save memory

Output:  all pairs of residues between partner A and
partner B for which a contact is possible according to the reference
distances for each group

References coordlib.dist_sq(), ObjexxFCL.len(), and basic::options::OptionKeys::relax::range.range.

Referenced by makeContactMap(), and parse_and_pair().

def calccontacts.pair_close_internal (   contactPDBsubset)
Input:  subset of contact PDB

Output:  all pairs of residue pairs i, j where a contact is possible
according to the reference (max radius to centroid) distances for
each group plus 5.0A

References coordlib.dist_sq(), ObjexxFCL.len(), and basic::options::OptionKeys::relax::range.range.

Referenced by parse_and_pair().

def calccontacts.parse_and_pair (   contactPDB,
  parserule 
)
This is the major function that allows one find-contacts script to
calculate contacts in a variety of different ways.
Using the parserule, the appropriate segment(s) of the pdb are extracted.

Two types of contact calculations are enabled by this routine, and the
type of calculation determines the inputs and actions:
internal contacts   (no '-' in the parserule)
interface/binding site contacts  ('-' in the parserule determining which
subsets of the protein to use)

For internal calculations:
The following types of input are accepted:
'all' - all residues in the protein, including all chains and any ligand
groups in the pdb
'A' - chain A only, all internal contacts
'AB' - chains A and B, all internal + A-B interface

action:  this subroutine extracts the appropriate portion of the pdb and
then passes it to pair_close_internal(contactPDB), and returns the result

For interface calculations:
'A-B', 'AB-C', 'AB-CD', etc:  docking partners.  Can be multiple chains
per partner
'A-ligand', 'AB-ligand', 'ligand-A' - subset of protein vs. all ligands
'all-ligand' - all protein vs. all ligands
action:  extracts the units separated by '-' and passes them through
pair_close_interface, and returns the result.
    

Input:  contactPDB (see class contactProtein)
Output:  [partnerA, partnerB] where partnerA and partnerB are subsets of
the contactPDB such that partnerA-partnerB contacts are calculated but not
internal contacts within either partner A or partner B.  A parsing rule is
used to split loadePDB into partners A and B.
Currently, 3 parsing rules are implemented:

This routine is flexible so that new parsing rules can be
added independently of any previous rules

References loadPDB.extractChains(), pair_close_interface(), pair_close_internal(), and loadPDB.popLigands().

Referenced by calccontacts.contactProtein.find_contacts().

Variable Documentation

string calccontacts.contactAtoms = 'all'
float calccontacts.contactFilter = 8.0
string calccontacts.contactType = 'full'
string calccontacts.getAtoms = 'centroid'
int calccontacts.ligandFlag = 1
calccontacts.refChain = None
int calccontacts.smartfilter = 1