representation of a multiple sequence alignemnt consisting of two or more sequences More...
#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 String & | GetSequenceRole (int seq_index) |
void | SetSequenceRole (int seq_index, const String &role) |
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::GetSequenceList(). 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.
typedef AlignedColumnIterator iterator |
Definition at line 56 of file alignment_handle.hh.
AlignmentHandle | ( | ) |
AlignmentHandle | ( | const impl::SequenceListImplPtr & | impl | ) |
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.
void AttachView | ( | int | seq_index, | |
const mol::EntityView & | view, | |||
const String & | chain_name | |||
) |
attach view to given sequence
void AttachView | ( | int | seq_index, | |
const mol::EntityView & | view | |||
) |
attach view to given sequence
iterator begin | ( | ) | const |
Column iterator start-point.
AlignmentHandle Copy | ( | ) | const |
deep-copy multi sequence alignment
void Cut | ( | int | start, | |
int | end | |||
) |
cut out half-closed interval start, end
iterator end | ( | ) | const |
Column iterator end-point.
ConstSequenceHandle FindSequence | ( | const String & | name | ) | const |
find sequence by name.
If several sequences have the same name, the first matching sequence will be returned.
int FindSequenceIndex | ( | const String & | name | ) | const |
int GetCount | ( | ) | const |
get number of sequences in alignment
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)
int GetLength | ( | ) | const |
Get length of sequences in alignment.
mol::EntityViewPair GetMatchingBackboneViews | ( | int | idx0 = 0 , |
|
int | idx1 = 1 | |||
) | const |
char GetOneLetterCode | ( | int | seq_index, | |
int | pos | |||
) | const |
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)
mol::ResidueView GetResidue | ( | int | seq_index, | |
int | pos | |||
) | const |
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)
ConstSequenceHandle GetSequence | ( | int | seq_id | ) | const |
Get sequence with given index.
int GetSequenceOffset | ( | int | seq_index | ) |
const String& GetSequenceRole | ( | int | seq_index | ) |
ConstSequenceList GetSequences | ( | ) | const |
Get list of sequences (read-only).
bool IsValid | ( | ) | const [inline] |
Definition at line 164 of file alignment_handle.hh.
AlignedRegion MakeRegion | ( | int | start, | |
int | n, | |||
int | master = -1 | |||
) | const |
create an aligned region.
start | is the index of the first column | |
n | is the length of the sequence | |
master | is 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.
bool operator!= | ( | const AlignmentHandle & | rhs | ) | const |
bool operator== | ( | const AlignmentHandle & | rhs | ) | const |
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.
void RemoveSequence | ( | int | seq_index | ) |
remove sequence at seq_index from alignment
void Replace | ( | const AlignedRegion & | rhs, | |
int | start, | |||
int | end | |||
) |
Replace part of an alignment.
void SetSequenceName | ( | int | seq_index, | |
const String & | name | |||
) |
set name of sequence
void SetSequenceOffset | ( | int | seq_index, | |
int | offset | |||
) |
void SetSequenceRole | ( | int | seq_index, | |
const String & | role | |||
) |
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.
String ToString | ( | int | width = 80 |
) | const |
Convert multiple sequence alignment to string.