#include <sequence_handle.hh>
Inherits GenericPropContainer< SequenceHandle >.
Sequences are mostly used as part of a multiple sequence alignment. The class allows for fast mapping between residue index and position in the sequence. The GetResidueIndex() method maps from position in the sequence to residue index, taking the sequence offset into account. The reverse mapping is done with GetPos().
Optionally, an entity view may be attached to the sequence with AttachView(). If HasAttachedView() is true, the GetResidue() method can be used directly to map from sequence position to residue. Note that it is required that the entity view has only one chain. Sequences are created from string as
String seq_str="ALGW--ALN" SequenceHandle seq=CreateSequence("NAME", seq_str);
Sequences IO is dealt with in the sequence module. For more information, consult this page.
Definition at line 158 of file sequence_handle.hh.
| SequenceHandle | ( | ) |
| SequenceHandle | ( | const impl::SequenceImplPtr & | impl | ) |
| void AttachView | ( | const mol::EntityView & | view, | |
| const String & | chain_name | |||
| ) |
attach entity view to sequence
The sequence is mapped onto the chain with given name
| void AttachView | ( | const mol::EntityView & | view | ) |
attach entity view to sequence
| IntegrityError | when the view contains more than one chain |
| SequenceHandle Copy | ( | ) | const |
create copy sequence The newly created sequence has the same attached view.
| mol::EntityView GetAttachedView | ( | ) | const |
get attached view. may be an invalid entity view
| int GetFirstNonGap | ( | ) | const |
Get position of first non-gap character in sequence.
| String GetGaplessString | ( | ) | const |
Get sequence as string ignoring gaps.
| int GetLastNonGap | ( | ) | const |
Get position of last non-gap character in sequence.
| int GetLength | ( | ) | const |
Get lenght of sequence, including gaps.
| const String& GetName | ( | ) | const |
| char GetOneLetterCode | ( | int | position | ) | const |
get one letter code of residue at position
| int GetPos | ( | int | residue_index | ) | const |
Get zero-based index for given residue number.
| out_of_range,if | number is not included in sequence. |
| mol::ResidueView GetResidue | ( | int | position | ) | const |
get residue at position
will return the residue view at the given sequence position or an invalid residue view when no view is attached, the index is out of bounds or the position contains a gap.
| int GetResidueIndex | ( | int | pos | ) | const |
Get residue index corresponding to given sequence position.
| pos | zero-based index |
| out_of_range | if pos is not in [0, length-1]. |
| int GetSequenceOffset | ( | ) | const |
| const String& GetString | ( | ) | const |
| const GenericPropContainerImpl* GpImpl | ( | ) | const |
| GenericPropContainerImpl* GpImpl | ( | ) |
| bool HasAttachedView | ( | ) | const |
whether the sequence has an attached view
| impl::SequenceImplPtr& Impl | ( | ) | const |
| bool IsValid | ( | ) | const |
whether the sequence is valid
| operator ConstSequenceHandle | ( | ) | const |
| bool operator!= | ( | const SequenceHandle & | rhs | ) | const |
| bool operator== | ( | const SequenceHandle & | rhs | ) | const |
| void SetName | ( | const String & | name | ) |
set name of sequence
| void SetSequenceOffset | ( | int | offset | ) |
Set sequence offset.
By default the sequence offset is zero, i.e. the beginning of the sequence lies exactly at the N-terminus. Setting the sequence offset to a positive number will shift the sequence towards the C-terminus.
| void SetString | ( | const String & | seq | ) |
Set sequence String.
friend class AlignmentHandle [friend] |
Definition at line 164 of file sequence_handle.hh.
friend class ConstSequenceList [friend] |
Definition at line 165 of file sequence_handle.hh.
friend class GenericPropContainer< SequenceHandle > [friend] |
Definition at line 161 of file sequence_handle.hh.
friend class SequenceList [friend] |
Definition at line 162 of file sequence_handle.hh.
1.5.8