SequenceHandle Class Reference
mutable sequence handle.
More...
#include <sequence_handle.hh>
Inherits GenericPropContainer< SequenceHandle >.
Detailed Description
mutable sequence handle.
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
Sequences IO is dealt with in the sequence module. For more information, consult this page.
Definition at line 172 of file sequence_handle.hh.
Member Typedef Documentation
Constructor & Destructor Documentation
create invalid sequence handle
- See also:
- IsValid()
Member Function Documentation
attach entity view to sequence
The sequence is mapped onto the chain with given name
attach entity view to sequence
- Exceptions:
-
create copy sequence The newly created sequence has the same attached view.
| int GetFirstNonGap |
( |
|
) |
const |
Get position of first non-gap character in sequence.
| String GetGaplessString |
( |
|
) |
const |
Get sequence as string ignoring gaps.
| int GetIndex |
( |
const String & |
substr |
) |
const |
| int GetLastNonGap |
( |
|
) |
const |
Get position of last non-gap character in sequence.
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.
- Exceptions:
-
| out_of_range,if | number is not included in sequence. |
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.
- Parameters:
-
- Exceptions:
-
| out_of_range | if pos is not in [0, length-1]. |
| const String& GetRole |
( |
|
) |
const |
| const String& GetString |
( |
|
) |
const |
| bool HasAttachedView |
( |
|
) |
const |
whether the sequence is valid
remove '.', '-' as gaps and make sequence all-uppercase Changes happen in place.
| char operator[] |
( |
size_t |
index |
) |
const |
| void SetName |
( |
const String & |
name |
) |
|
| void SetOffset |
( |
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 SetOneLetterCode |
( |
int |
position, |
|
|
char |
new_char | |
|
) |
| | |
| void SetRole |
( |
const String & |
role |
) |
const |
| void SetString |
( |
const String & |
seq |
) |
|
Friends And Related Function Documentation
The documentation for this class was generated from the following file: