OpenStructure
Public Types | Public Member Functions
AlignmentHandle Class Reference

#include <alignment_handle.hh>

Public Types

typedef AlignedColumnIterator iterator
 

Public Member Functions

 AlignmentHandle ()
 
int GetPos (int seq_index, int residue_index) const
 
int GetResidueIndex (int seq_index, int pos) const
 
mol::ResidueView GetResidue (int seq_index, int pos) const
 
char GetOneLetterCode (int seq_index, int pos) const
 
void AddSequence (const ConstSequenceHandle &sequence)
 
ConstSequenceHandle GetSequence (int seq_id) const
 
void RemoveSequence (int seq_index)
 
String ToString (int width=80) const
 
int GetLength () const
 
AlignmentHandle Copy () const
 
ConstSequenceHandle FindSequence (const String &name) const
 
int FindSequenceIndex (const String &name) const
 
void AttachView (int seq_index, const mol::EntityView &view)
 
void AttachView (int seq_index, const mol::EntityView &view, const String &chain_name)
 
mol::EntityViewPair GetMatchingBackboneViews (int idx0=0, int idx1=1) const
 
void SetSequenceName (int seq_index, const String &name)
 
void SetSequenceOffset (int seq_index, int offset)
 
int GetSequenceOffset (int seq_index)
 
ConstSequenceList GetSequences () const
 
AlignedRegion MakeRegion (int start, int n, int master=-1) const
 
int GetCount () const
 
bool operator== (const AlignmentHandle &rhs) const
 
bool operator!= (const AlignmentHandle &rhs) const
 
AlignedColumn operator[] (int index) const
 
 AlignmentHandle (const impl::SequenceListImplPtr &impl)
 
void Cut (int start, int end)
 
void Replace (const AlignedRegion &rhs, int start, int end)
 
void ShiftRegion (int start, int end, int amount, int master=-1)
 
iterator begin () const
 
iterator end () const
 
bool IsValid () const
 
Real GetCoverage (int seq_index) const
 
const StringGetSequenceRole (int seq_index)
 
void SetSequenceRole (int seq_index, const String &role)
 

Detailed Description

representation of a multiple sequence alignemnt consisting of two or more sequences

A sequence alignment consists of two or more sequences. The number of sequences in the alignment can be obtained by GetCount(). All sequences are of length GetLength().

Typically sequence alignments are used column-based, i.e by looking at an aligned columns in the sequence alignment. To get a row-based (sequence) view on the sequence list, use AlignmentHandle::GetSequences(). For an overview of how to use the sequence module, see here

All operators that operate on an alignment will again produce a valid alignment. This mean that it is not possible to change the length of one sequence, without adjusting the other sequences, too.

Definition at line 53 of file alignment_handle.hh.

Member Typedef Documentation

◆ iterator

Definition at line 56 of file alignment_handle.hh.

Constructor & Destructor Documentation

◆ AlignmentHandle() [1/2]

◆ AlignmentHandle() [2/2]

Member Function Documentation

◆ AddSequence()

void AddSequence ( const ConstSequenceHandle sequence)

Add new sequence to multiple sequence alignment.

If the sequence length does not match with the length of the other sequences in the alignment, an InvalidSequence() exception is thrown.

◆ AttachView() [1/2]

void AttachView ( int  seq_index,
const mol::EntityView view 
)

attach view to given sequence

See also
SequenceHandle::AttachView(const mol::EntityView&)

◆ AttachView() [2/2]

void AttachView ( int  seq_index,
const mol::EntityView view,
const String chain_name 
)

◆ begin()

iterator begin ( ) const

Column iterator start-point.

◆ Copy()

AlignmentHandle Copy ( ) const

deep-copy multi sequence alignment

◆ Cut()

void Cut ( int  start,
int  end 
)

cut out half-closed interval start, end

◆ end()

iterator end ( ) const

Column iterator end-point.

◆ FindSequence()

ConstSequenceHandle FindSequence ( const String name) const

find sequence by name.

If several sequences have the same name, the first matching sequence will be returned.

◆ FindSequenceIndex()

int FindSequenceIndex ( const String name) const

◆ GetCount()

int GetCount ( ) const

get number of sequences in alignment

◆ GetCoverage()

Real GetCoverage ( int  seq_index) const

get coverage of a specifi sequence

returns a value representing how extensively the specified sequence covers the first sequence (sequence 0). The function return a value between 0 (no coverage) and 1 (full coverage)

◆ GetLength()

int GetLength ( ) const

Get length of sequences in alignment.

◆ GetMatchingBackboneViews()

mol::EntityViewPair GetMatchingBackboneViews ( int  idx0 = 0,
int  idx1 = 1 
) const

◆ GetOneLetterCode()

char GetOneLetterCode ( int  seq_index,
int  pos 
) const

◆ GetPos()

int GetPos ( int  seq_index,
int  residue_index 
) const

Get position in sequence with index seq_index that corresponds to the given residue index.

Identical to msa->GetSequence(seq_id)->GetPos(index)

◆ GetResidue()

mol::ResidueView GetResidue ( int  seq_index,
int  pos 
) const

◆ GetResidueIndex()

int GetResidueIndex ( int  seq_index,
int  pos 
) const

Get residue index for seq_index and alignment position.

Identitical to msa->GetSequence(seq_id)->GetResidueIndex(pos)

◆ GetSequence()

ConstSequenceHandle GetSequence ( int  seq_id) const

Get sequence with given index.

Returns
sequence or invalid handle if the index is out of bounds

◆ GetSequenceOffset()

int GetSequenceOffset ( int  seq_index)

◆ GetSequenceRole()

const String& GetSequenceRole ( int  seq_index)

◆ GetSequences()

ConstSequenceList GetSequences ( ) const

Get list of sequences (read-only)

◆ IsValid()

bool IsValid ( ) const
inline

Definition at line 164 of file alignment_handle.hh.

◆ MakeRegion()

AlignedRegion MakeRegion ( int  start,
int  n,
int  master = -1 
) const

create an aligned region.

Parameters
startis the index of the first column
nis the length of the sequence
masteris the reference system for operations such as shifting. If set to -1, no master sequence is defined and the operations will affect all sequences

If the aligned region is out of bounds, a std::out_of_bounds exeception will be thrown.

◆ operator!=()

bool operator!= ( const AlignmentHandle rhs) const

◆ operator==()

bool operator== ( const AlignmentHandle rhs) const

◆ operator[]()

AlignedColumn operator[] ( int  index) const

get aligned column at index

This method does not throw any exception. Upon accessing methods of the aligned column, exceptions might be thrown when the index is out of bounds.

◆ RemoveSequence()

void RemoveSequence ( int  seq_index)

remove sequence at seq_index from alignment

◆ Replace()

void Replace ( const AlignedRegion rhs,
int  start,
int  end 
)

Replace part of an alignment.

◆ SetSequenceName()

void SetSequenceName ( int  seq_index,
const String name 
)

set name of sequence

◆ SetSequenceOffset()

void SetSequenceOffset ( int  seq_index,
int  offset 
)

◆ SetSequenceRole()

void SetSequenceRole ( int  seq_index,
const String role 
)

◆ ShiftRegion()

void ShiftRegion ( int  start,
int  end,
int  amount,
int  master = -1 
)

shift half-closed interval by amount

if master is -1, all sequences of the alignment will be shifted. Otherwise only the sequence with given index is affected.

◆ ToString()

String ToString ( int  width = 80) const

Convert multiple sequence alignment to string.


The documentation for this class was generated from the following file: