OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
ost.mol.alg.superpose Namespace Reference

Functions

def ParseAtomNames
 
def MatchResidueByNum
 
def MatchResidueByIdx
 
def MatchResidueByLocalAln
 
def MatchResidueByGlobalAln
 
def Superpose
 

Detailed Description

Superposition of structures made simple.

Authors: Stefan Bienert

Function Documentation

def ost.mol.alg.superpose.MatchResidueByGlobalAln (   ent_a,
  ent_b,
  atoms = 'all' 
)
Match residues by global alignment.
Same as :func:`MatchResidueByLocalAln` but performs a global Needleman/Wunsch
alignment of the sequences using the BLOSUM62 matrix for scoring.

:param ent_a: The first entity
:type ent_a: :class:`~ost.mol.EntityView` or :class:`~ost.mol.EntityHandle`
:param ent_b: The second entity
:type ent_b: :class:`~ost.mol.EntityView` or :class:`~ost.mol.EntityHandle`
:param atoms: The subset of atoms to be included in the two views.
:type atoms: :class:`str`, :class:`list`, :class:`set`
:returns: Two :class:`~ost.mol.EntityView` instances with the same number of
          residues. Each residue will have the same number & type of atoms.

Definition at line 261 of file superpose.py.

def ost.mol.alg.superpose.MatchResidueByIdx (   ent_a,
  ent_b,
  atoms = 'all' 
)
Returns a tuple of views containing exactly the same number of atoms.
Residues are matched by position in the chains of an entity. A subset of
atoms to be included in the views can be specified in the **atoms** argument.
Regardless of what the list of **atoms** says, only those present in two
matched residues will be included in the views. Chains are processed in order
of appearance. If **ent_a** and **ent_b** contain a different number of
chains, processing stops with the lower count. The number of residues per
chain is supposed to be the same.

:param ent_a: The first entity
:type ent_a: :class:`~ost.mol.EntityView` or :class:`~ost.mol.EntityHandle`
:param ent_b: The second entity
:type ent_b: :class:`~ost.mol.EntityView` or :class:`~ost.mol.EntityHandle`
:param atoms: The subset of atoms to be included in the two views.
:type atoms: :class:`str`, :class:`list`, :class:`set`
:returns: Two :class:`~ost.mol.EntityView` instances with the same amount of
          residues matched by position. Each residue will have the same number
          & type of atoms.

Definition at line 139 of file superpose.py.

def ost.mol.alg.superpose.MatchResidueByLocalAln (   ent_a,
  ent_b,
  atoms = 'all' 
)
Match residues by local alignment. Takes **ent_a** and **ent_b**, extracts the
sequences chain-wise and aligns them in Smith/Waterman manner using the
BLOSUM62 matrix for scoring. Only residues which are marked as :attr:`peptide
linking <ost.mol.ResidueHandle.peptide_linking>` are considered for alignment.
The residues of the entities are then matched based on this alignment. Only
atoms present in both residues are included in the views. Chains are processed
in order of appearance. If **ent_a** and **ent_b** contain a different number
of chains, processing stops with the lower count.

:param ent_a: The first entity
:type ent_a: :class:`~ost.mol.EntityView` or :class:`~ost.mol.EntityHandle`
:param ent_b: The second entity
:type ent_b: :class:`~ost.mol.EntityView` or :class:`~ost.mol.EntityHandle`
:param atoms: The subset of atoms to be included in the two views.
:type atoms: :class:`str`, :class:`list`, :class:`set`
:returns: Two :class:`~ost.mol.EntityView` instances with the same number of
          residues. Each residue will have the same number & type of atoms.

Definition at line 239 of file superpose.py.

def ost.mol.alg.superpose.MatchResidueByNum (   ent_a,
  ent_b,
  atoms = 'all' 
)
Returns a tuple of views containing exactly the same number of atoms.
Residues are matched by residue number. A subset of atoms to be included in
the views can be specified in the **atoms** argument. Regardless of what the
list of **atoms** says, only those present in two matched residues will be
included in the views. Chains are processed in the order they occur in the
entities. If **ent_a** and **ent_b** contain a different number of chains,
processing stops with the lower count.

:param ent_a: The first entity
:type ent_a: :class:`~ost.mol.EntityView` or :class:`~ost.mol.EntityHandle`
:param ent_b: The second entity
:type ent_b: :class:`~ost.mol.EntityView` or :class:`~ost.mol.EntityHandle`
:param atoms: The subset of atoms to be included in the two views.
:type atoms: :class:`str`, :class:`list`, :class:`set`
:returns: Two :class:`~ost.mol.EntityView` instances with the same amount of
          residues matched by number. Each residue will have the same number
          & type of atoms.

Definition at line 77 of file superpose.py.

def ost.mol.alg.superpose.ParseAtomNames (   atoms)
Parses different representations of a list of atom names and returns a
:class:`set`, understandable by :func:`~ost.mol.alg.MatchResidueByNum`. In
essence, this function translates

* None to ``None``

* 'all' to ``None``

* 'backbone' to ``set(['N', 'CA', 'C', 'O'])``

* 'aname1, aname2' to ``set(['aname1', 'aname2'])``

* ``['aname1', 'aname2']``  to ``set(['aname1', 'aname2'])``

:param atoms: Identifier or list of atoms
:type atoms: :class:`str`, :class:`list`, :class:`set`
:returns: A :class:`set` of atoms.

Definition at line 11 of file superpose.py.

def ost.mol.alg.superpose.Superpose (   ent_a,
  ent_b,
  match = 'number',
  atoms = 'all',
  iterative = False,
  max_iterations = 5,
  distance_threshold = 3.0 
)
Superposes the model entity onto the reference. To do so, two views are
created, returned with the result. *atoms* describes what goes into these
views and *match* the selection method. For superposition,
:func:`SuperposeSVD` or :func:`IterativeSuperposeSVD` are called (depending on
*iterative*). For matching, the following methods are recognised:

* ``number`` - select residues by residue number, includes *atoms*, calls
  :func:`MatchResidueByNum`

* ``index`` - select residues by index in chain, includes *atoms*, calls
  :func:`MatchResidueByIdx`

* ``local-aln`` - select residues from a Smith/Waterman alignment, includes
  *atoms*, calls :func:`MatchResidueByLocalAln`

* ``global-aln`` - select residues from a Needleman/Wunsch alignment, includes
  *atoms*, calls :func:`MatchResidueByGlobalAln`

:param ent_a: The model entity (superposition transform is applied on full
              entity handle here)
:type ent_a: :class:`~ost.mol.EntityView` or :class:`~ost.mol.EntityHandle`

:param ent_b: The reference entity
:type ent_b: :class:`~ost.mol.EntityView` or :class:`~ost.mol.EntityHandle`

:param match: Method to gather residues/ atoms
:type match: :class:`str`

:param atoms: The subset of atoms to be used in the superposition
:type atoms: :class:`str`, :class:`list`, :class:`set`

:param iterative: Whether or not to use iterative superpositon.
:type iterative:  :class:`bool`

:param max_iterations: Max. number of iterations for
                       :func:`IterativeSuperposeSVD`
                       (only if *iterative* = True)
:type max_iterations: :class:`int`

:param distance_threshold: Distance threshold for
                           :func:`IterativeSuperposeSVD`
                           (only if *iterative* = True)
:type distance_threshold: :class:`float`

:returns: An instance of :class:`SuperpositionResult`.

Definition at line 280 of file superpose.py.