OpenStructure
|
#include <sequence_handle.hh>
Inherits GenericPropContainer< SequenceHandle >.
Public Types | |
typedef String::const_iterator | iterator |
Public Member Functions | |
int | GetResidueIndex (int pos) const |
int | GetPos (int residue_index) const |
int | GetFirstNonGap () const |
int | GetLastNonGap () const |
const String & | GetName () const |
const String & | GetString () const |
String | GetGaplessString () const |
int | GetOffset () const |
int | GetLength () const |
char | GetOneLetterCode (int position) const |
int | GetIndex (const String &substr) const |
mol::ResidueView | GetResidue (int position) const |
mol::EntityView | GetAttachedView () const |
void | Normalise () |
SequenceHandle | Copy () const |
bool | HasAttachedView () const |
bool | operator== (const SequenceHandle &rhs) const |
bool | operator!= (const SequenceHandle &rhs) const |
bool | IsValid () const |
SequenceHandle () | |
void | SetName (const String &name) |
void | SetString (const String &seq) |
void | SetOffset (int offset) |
void | AttachView (const mol::EntityView &view) |
void | SetOneLetterCode (int position, char new_char) |
char | operator[] (size_t index) const |
iterator | begin () const |
iterator | end () const |
void | Append (char olc) |
operator ConstSequenceHandle () const | |
void | AttachView (const mol::EntityView &view, const String &chain_name) |
SequenceHandle (const impl::SequenceImplPtr &impl) | |
const String & | GetRole () const |
void | SetRole (const String &role) const |
impl::SequenceImplPtr & | Impl () const |
GenericPropContainerImpl * | GpImpl () |
const GenericPropContainerImpl * | GpImpl () const |
Public Member Functions inherited from GenericPropContainer< SequenceHandle > | |
void | ClearProps () |
void | SetStringProp (const String &key, const String &value) |
void | SetFloatProp (const String &key, Real value) |
void | SetIntProp (const String &key, int value) |
void | SetBoolProp (const String &key, bool value) |
void | SetVec3Prop (const String &key, geom::Vec3 value) |
void | RemoveProp (const String &key) |
Public Member Functions inherited from ConstGenericPropContainer< SequenceHandle > | |
bool | HasProp (const String &key) const |
String | GetPropAsString (const String &key) const |
String | GetStringProp (const String &key) const |
String | GetStringProp (const String &key, const String &def) const |
Real | GetFloatProp (const String &key) const |
Real | GetFloatProp (const String &key, Real def) const |
int | GetIntProp (const String &key) const |
int | GetIntProp (const String &key, int def) const |
bool | GetBoolProp (const String &key) const |
bool | GetBoolProp (const String &key, bool def) const |
geom::Vec3 | GetVec3Prop (const String &key) const |
std::map< String, GenericPropValue > | GetPropMap () const |
std::vector< String > | GetPropList () const |
Friends | |
class | GenericPropContainer< SequenceHandle > |
class | SequenceList |
class | AlignmentHandle |
class | ConstSequenceList |
Additional Inherited Members | |
Protected Member Functions inherited from ConstGenericPropContainer< SequenceHandle > | |
T | gp_get (const String &key) const |
T | gp_get (const String &key, const T &def) const |
GenericPropContainerImpl * | GetImpl () |
const GenericPropContainerImpl * | GetImpl () const |
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.
typedef String::const_iterator iterator |
Definition at line 175 of file sequence_handle.hh.
SequenceHandle | ( | ) |
create invalid sequence handle
SequenceHandle | ( | const impl::SequenceImplPtr & | impl | ) |
void Append | ( | char | olc | ) |
void AttachView | ( | const mol::EntityView & | view | ) |
attach entity view to sequence
IntegrityError | when the view contains more than one chain |
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
|
inline |
Definition at line 281 of file sequence_handle.hh.
SequenceHandle Copy | ( | ) | const |
create copy sequence The newly created sequence has the same attached view.
|
inline |
Definition at line 282 of file sequence_handle.hh.
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 GetIndex | ( | const String & | substr | ) | const |
get index of substring
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 |
Get name of sequence.
int GetOffset | ( | ) | const |
Get sequence offset from N-terminus.
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]. |
const String& GetRole | ( | ) | const |
const String& GetString | ( | ) | const |
get sequence as a string, including all the gaps
GenericPropContainerImpl* GpImpl | ( | ) |
const GenericPropContainerImpl* GpImpl | ( | ) | const |
bool HasAttachedView | ( | ) | const |
whether the sequence has an attached view
impl::SequenceImplPtr& Impl | ( | ) | const |
bool IsValid | ( | ) | const |
whether the sequence is valid
void Normalise | ( | ) |
remove '.', '-' as gaps and make sequence all-uppercase Changes happen in place.
operator ConstSequenceHandle | ( | ) | const |
bool operator!= | ( | const SequenceHandle & | rhs | ) | const |
bool operator== | ( | const SequenceHandle & | rhs | ) | const |
char operator[] | ( | size_t | index | ) | const |
void SetName | ( | const String & | name | ) |
set name of sequence
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 | ) |
Set sequence String.
|
friend |
Definition at line 179 of file sequence_handle.hh.
|
friend |
Definition at line 180 of file sequence_handle.hh.
|
friend |
Definition at line 176 of file sequence_handle.hh.
|
friend |
Definition at line 177 of file sequence_handle.hh.