Package schrodinger :: Package application :: Package bioluminate :: Module protein :: Class Consensus
[hide private]
[frames] | no frames]

Class Consensus

Access the atoms, residues, and molecules (or just their indices) that are considered to be consensus objects for a template structure and query structure. All properties are returned as an OrderedDict that maps the template objects to their consensus objects from the query structure.

Here is an example of how to get all the consensus waters between two protein structures. We define the cutoff here at 2 Angstroms:

 from schrodinger.structure import StructureReader
 from schrodinger.application.bioluminate import protein

 pt = maestro.project_table_get()

 # Create an ASL map for all ligands in the WS
 asl_map = []
 for row in pt.included_rows:
     st = row.getStructure()
     ligands = analyze.find_ligands(st)
     if not ligands:
         continue
     indices = []
     for ligand in ligands:
         indices.extend([str(i) for i in ligand.atom_indexes])

     asl = 'atom.n %s' % ','.join(indices)

     asl_map.append((st, asl))

 # Create a consensus of all ligands, specifying that at least three
 # structures must have a ligand atom within 2A from one another.
 consensus = protein.Consensus(asl_map, 3, dist_cutoff=2)

 # To get the atom objects
 consensus_atoms = consensus.atoms

 # To get the molecule objects
 molecules = consensus.molecules
Instance Methods [hide private]
 
__init__(self, asl_map, minimum_number, dist_cutoff=2.0)
 
_setIndexMap(self)
Private method called in __init__.
 
getClosest(self, ref_atom, mob_atoms)
Gets the closest atom to the ref_atom from mob_atoms.
list of lists
_createByAtomProperty(self, attr, is_callable=False)
Private method to get an atom property.
Class Variables [hide private]
  ASL_WATER = 'water and NOT (atom.ele H)'
  ASL_IONS = 'ions'
  ASL_LIGAND = '(((m.atoms 5-130)) and not ((ions) or (res.pt AC...
Instance Variables [hide private]
  _consensus_atoms
Atom indices mapping template and query consensus
Properties [hide private]
OrderedDict of atom objects where the keys are the template atoms and their values are the consensus atoms from the query. atoms
Get the map of atom objects of consensus atoms.
OrderedDict of ints where the keys are the template atom indices and their values are the consensus atom indices from the query. atom_indices
Get the map of atom indices of consensus atoms.
list of unique consensus residue objects for each structure in self.asl_map. (Order is maintained) residues
Get the list of residue objects of consensus atoms for each structure in self.asl_map.
list of unique consensus residue indices for each structure in self.asl_map. (Order is maintained) residue_indices
Get the map of residue indices of consensus atoms.
list of unique consensus molecule objects for each structure in self.asl_map. (Order is maintained) molecules
Get the map of molecule objects of consensus atoms.
list of unique consensus molecule indices for each structure in self.asl_map. (Order is maintained) molecule_indices
Get the map of molecule indices of consensus atoms.
Method Details [hide private]

__init__(self, asl_map, minimum_number, dist_cutoff=2.0)
(Constructor)

 
Parameters:
  • asl_map (tuple of (structure, ASL)) - List of structures and the ASL used to limit the atoms used when calculating the consensus
  • minimum_number (int) - The minimum number of matches within structures. An atom will be considered a "consensus" atom if it is within the dist_cutoff of at least minimum_number of structures in the list of passed in structures.
  • dist_cutoff (float) - Distance in Angstroms used to define a consensus match

Attention: The list of consensus atoms (or molecules, residues, indices, etc. depending on the property called, i.e. self.molecules) will all be unique and will depend on the ASL passed in. If the ASL is not specific enough you may end up with poor results.

_setIndexMap(self)

 

Private method called in __init__. Finds the consensus atom indices between the template and query.

_createByAtomProperty(self, attr, is_callable=False)

 

Private method to get an atom property.

Parameters:
  • attr (str) - The attribute to get from the consensus atoms
  • is_callable (bool) - Whether the prop arg is a callable
Returns: list of lists
A list of lists of the new entities created from the properties

Class Variable Details [hide private]

ASL_LIGAND

Value:
'(((m.atoms 5-130)) and not ((ions) or (res.pt ACE ACT ACY BCT BME BOG\
 CAC CIT CO3 DMS EDO EGL EPE FES FMT FS3 FS4 GOL HEC HED HEM IOD IPA M\
ES MO6 MPD MYR NAG NCO NH2 NH3 NO3 PG4 PO4 POP SEO SO4 SPD SPM SUC SUL\
 TRS )))'

Property Details [hide private]

atoms

Get the map of atom objects of consensus atoms.

Get Method:
unreachable.atoms(self) - Get the map of atom objects of consensus atoms.
Type:
OrderedDict of atom objects where the keys are the template atoms and their values are the consensus atoms from the query.

atom_indices

Get the map of atom indices of consensus atoms.

Get Method:
unreachable.atom_indices(self) - Get the map of atom indices of consensus atoms.
Type:
OrderedDict of ints where the keys are the template atom indices and their values are the consensus atom indices from the query.

residues

Get the list of residue objects of consensus atoms for each structure in self.asl_map.

Get Method:
unreachable.residues(self) - Get the list of residue objects of consensus atoms for each structure in self.asl_map.
Type:
list of unique consensus residue objects for each structure in self.asl_map. (Order is maintained)

residue_indices

Get the map of residue indices of consensus atoms.

Get Method:
unreachable.residue_indices(self) - Get the map of residue indices of consensus atoms.
Type:
list of unique consensus residue indices for each structure in self.asl_map. (Order is maintained)

molecules

Get the map of molecule objects of consensus atoms.

Get Method:
unreachable.molecules(self) - Get the map of molecule objects of consensus atoms.
Type:
list of unique consensus molecule objects for each structure in self.asl_map. (Order is maintained)

molecule_indices

Get the map of molecule indices of consensus atoms.

Get Method:
unreachable.molecule_indices(self) - Get the map of molecule indices of consensus atoms.
Type:
list of unique consensus molecule indices for each structure in self.asl_map. (Order is maintained)