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. Takes **ent_a** and **ent_b**, extracts
the sequences chain-wise and aligns them in Needleman/Wunsch manner using the
BLOSUM62 matrix for scoring. 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 240 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. 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 219 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' 
)
Superposes the model entity onto the reference. To do so, two views are
created, returned with the result. **atoms** describes what goes in to these
views and **match** the selection method. For superposition,
:func:`~ost.mol.alg.SuperposeSVD` is called. For matching, following methods
are recognised:

* ``number`` - select residues by residue number, includes **atoms**, calls
  :func:`~ost.mol.alg.MatchResidueByNum`

* ``index`` - select residues by index in chain, includes **atoms**, calls
  :func:`~ost.mol.alg.MatchResidueByIdx`

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

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

:param ent_a: The model entity
: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`
:returns: An instance of :class:`SuperpositionResult`, containing members

          * ``rmsd`` - RMSD of the superposed entities

          * ``view1`` - First :class:`~ost.mol.EntityView` used

          * ``view2`` - Second :class:`~ost.mol.EntityView` used

Definition at line 262 of file superpose.py.