OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Namespaces | Data Structures | Typedefs | Functions
ost::seq::alg Namespace Reference

Namespaces

namespace  mat
namespace  renumber

Data Structures

struct  AlignmentOpts
 options for local and global sequence alignment algorithms More...
class  InsDel
 get insertions and deletions of an alignment More...
struct  RefMode
class  SubstWeightMatrix
 position-independet substitution weight matrix More...

Typedefs

typedef boost::shared_ptr
< SubstWeightMatrix
SubstWeightMatrixPtr

Functions

std::vector< Real >
DLLEXPORT_OST_SEQ_ALG 
Conservation (const AlignmentHandle &aln, bool assign=true, const String &prop_name="cons", bool ignore_gap=false)
std::vector< Real > DLLIMPORT ShannonEntropy (const AlignmentHandle &aln, bool ignore_gaps=true)
AlignmentList DLLIMPORT GlobalAlign (const ConstSequenceHandle &s1, const ConstSequenceHandle &s2, SubstWeightMatrixPtr &subst, int gap_open=-5, int gap_ext=-2)
AlignmentList DLLIMPORT LocalAlign (const ConstSequenceHandle &s1, const ConstSequenceHandle &s2, SubstWeightMatrixPtr &subst, int gap_open=-5, int gap_ext=-2)
AlignmentHandle
DLLEXPORT_OST_SEQ_ALG 
MergePairwiseAlignments (const AlignmentList &pairwise_alns, const ConstSequenceHandle &ref_seq)
Real DLLEXPORT_OST_SEQ_ALG SequenceIdentity (const AlignmentHandle &aln, RefMode::Type ref_mode=RefMode::LONGER_SEQUENCE, int seq_a=0, int seq_b=1)
def ValidateSEQRESAlignment
def AlignToSEQRES
def AlignmentFromChainView

Typedef Documentation

typedef boost::shared_ptr<SubstWeightMatrix> SubstWeightMatrixPtr

Definition at line 36 of file subst_weight_matrix.hh.


Function Documentation

def ost.seq.alg.AlignmentFromChainView (   chain,
  handle_seq_name = 'handle',
  view_seq_name = 'view' 
)
Creates and returns the sequence alignment of the given chain view to the 
chain handle. The alignment contains two sequences, the first containing all 
non-ligand peptide-linking residues, the second containing all non-ligand 
peptide-linking residues that are part of the view. 

:param chain: A valid chain
:type chain: :class:`~ost.mol.ChainView`

:param handle_seq_name: Name of the handle sequence in the output alignment
:param view_seq_name: Name of the view sequence in the output alignment
:returns: The alignment
:rtype: :class:`~ost.seq.AlignmentHandle`

Definition at line 136 of file __init__.py.

def ost.seq.alg.AlignToSEQRES (   chain,
  seqres,
  try_resnum_first = False,
  validate = True 
)
Aligns the residues of chain to the SEQRES sequence, inserting gaps where 
needed. The function uses the connectivity of the protein backbone to find 
consecutive peptide fragments. These fragments are then aligned to the SEQRES 
sequence.

All the non-ligand, peptide-linking residues of the chain must be listed in 
SEQRES. If there are any additional residues in the chain, the function
raises a ValueError.

If 'try_resnum_first' is set, building the alignment following residue numbers
is tried first.

If 'validate' is set (default), the alignment is checked using
:func:`~ost.seq.alg.ValidateSEQRESAlignment`.

:param chain: Source of the sequence
:type chain: :class:`~ost.mol.ChainHandle`
:param seqres: SEQRES sequence
:type seqres: :class:`str`
:param try_resnum_first: Try to align by residue number
:type try_resnum_first: :class:`bool`
:param validate: Validate alignment by
                 :func:`~ost.seq.alg.ValidateSEQRESAlignment`
:type validate: :class:`bool`

:returns: The alignment of the residues in the chain and the SEQRES entries.
:rtype: :class:`~ost.seq.AlignmentHandle`

Definition at line 58 of file __init__.py.

std::vector<Real> DLLEXPORT_OST_SEQ_ALG ost::seq::alg::Conservation ( const AlignmentHandle &  aln,
bool  assign = true,
const String prop_name = "cons",
bool  ignore_gap = false 
)

Calculates conservation scores for each column in the alignment.

The conservation score is a value between 0 and 1. The bigger the number the more conserved the aligned residues are.

assign If true, the conservation scores are assigned to attached residues. The name of the property can be changed with the prop_name parameter. Useful when coloring entities based on sequence conservation. prop_name The property name for assigning the conservation to attached residues. Defaults to 'cons'. ignore_gap If true, the dissimilarity between two gaps is increased to 6.0 instead of 0.5 as defined in the original version. Without this, a stretch where in the alignment there is only one sequence which is aligned to only gaps, is considered highly conserved (depending on the number of gap sequences).

AlignmentList DLLIMPORT ost::seq::alg::GlobalAlign ( const ConstSequenceHandle &  s1,
const ConstSequenceHandle &  s2,
SubstWeightMatrixPtr &  subst,
int  gap_open = -5,
int  gap_ext = -2 
)
AlignmentList DLLIMPORT ost::seq::alg::LocalAlign ( const ConstSequenceHandle &  s1,
const ConstSequenceHandle &  s2,
SubstWeightMatrixPtr &  subst,
int  gap_open = -5,
int  gap_ext = -2 
)
AlignmentHandle DLLEXPORT_OST_SEQ_ALG ost::seq::alg::MergePairwiseAlignments ( const AlignmentList &  pairwise_alns,
const ConstSequenceHandle &  ref_seq 
)

merge a list of pairwise alignments into one multiple sequence alignment

All sequences in the pairwise sequence alignments are a realigned to the reference sequence. This is useful to merge the results of a BLAST or HMM database search into one multiple sequence alignment.

The method does not produce the optimal multiple sequence alignemnt for all the sequences.

Parameters:
pairwise_alignmentsis a list of AlignmentHandles, each containing two sequences
ref_seqis the reference sequence. The reference sequence must not contain any gaps.
Real DLLEXPORT_OST_SEQ_ALG ost::seq::alg::SequenceIdentity ( const AlignmentHandle &  aln,
RefMode::Type  ref_mode = RefMode::LONGER_SEQUENCE,
int  seq_a = 0,
int  seq_b = 1 
)

calculate sequence identity for two sequences in an alignment

Parameters:
ref_modeinfluences the way the sequence identity is calculated. When set to LONGER_SEQUENCE, the sequence identity is calculated as the number of matches divided by the length of the longer sequence. If set to ALIGNMENT, the sequence identity is calculated as the number of matches divided by the number of aligned residues.
seq_ais the index of the first sequence
seq_bis the index of the second sequence
alnis the sequence alignment
Returns:
sequence identity in the range 0 to 100
std::vector<Real> DLLIMPORT ost::seq::alg::ShannonEntropy ( const AlignmentHandle &  aln,
bool  ignore_gaps = true 
)

calculates the Shannon entropy for each column in the alignment

def ost.seq.alg.ValidateSEQRESAlignment (   aln,
  chain = None 
)
Checks a sequence aligned to a SEQRES sequence to be free of strand breaks.
Residues divided by gaps are not considered as breakage but may also not be
connected.

:param aln: Alignment
:type aln: :class:`~ost.seq.AlignmentHandle`
:param chain: Source of the sequence
:type chain: :class:`~ost.mol.ChainHandle`

:returns: True if all residues (beside gapped ones) are connected, False
          otherwise.

Definition at line 4 of file __init__.py.