OpenStructure
Data Structures | Public Member Functions | Static Public Member Functions
SequenceImpl Class Reference

#include <sequence_impl.hh>

Inherits GenericPropContainerImpl.

Public Member Functions

int GetResidueIndex (int pos) const
 
int GetPos (int residue_index) const
 
int GetFirstNonGap () const
 
int GetLastNonGap () const
 
const StringGetName () const
 
void SetName (const String &name)
 
void Cut (int start, int n)
 
void ShiftRegion (int start, int end, int amount)
 
const StringGetString () const
 
void SetString (const String &seq)
 
void Normalise ()
 
void Replace (const String &str, int start, int end)
 
String GetGaplessString () const
 
int GetOffset () const
 
int GetIndex (const String &substr) const
 
void SetOffset (int offset)
 
int GetLength () const
 
 SequenceImpl (const String &seq_name, const String &sequence_string, const String &role)
 
char GetOneLetterCode (int position) const
 
void SetOneLetterCode (int position, char new_char)
 
mol::ResidueView GetResidue (int position) const
 
mol::EntityView GetAttachedView () const
 
void AttachView (const mol::EntityView &view)
 
SequenceImplPtr Copy () const
 
void AttachView (const mol::EntityView &view, const String &chain_name)
 
bool HasAttachedView () const
 
void Append (char olc)
 
char & operator[] (size_t index)
 
char operator[] (size_t index) const
 
const StringGetRole () const
 
void SetRole (const String &role)
 
- Public Member Functions inherited from GenericPropContainerImpl
 GenericPropContainerImpl ()
 
 ~GenericPropContainerImpl ()
 
 GenericPropContainerImpl (const GenericPropContainerImpl &rhs)
 
GenericPropContainerImploperator= (const GenericPropContainerImpl &r)
 
GenericPropValueGenericProp (const String &key)
 
const GenericPropValueGenericProp (const String &key) const
 
bool HasProp (const String &key) const
 
void ClearProps ()
 
void RemoveProp (const String &key)
 
void Assign (const GenericPropContainerImpl &impl)
 
PropertyMap GetPropMap () const
 
std::vector< StringGetPropList () const
 

Static Public Member Functions

static SequenceImplPtr FromString (const String &seq_name, const String &sequence_string, const String &role="UNKNOWN")
 

Detailed Description

Definition at line 49 of file sequence_impl.hh.

Constructor & Destructor Documentation

◆ SequenceImpl()

SequenceImpl ( const String seq_name,
const String sequence_string,
const String role 
)

Construct new sequence object from sequence_string.

If you want to check whether the sequence String does only contain valid characters use CreateSequence instead.

Member Function Documentation

◆ Append()

void Append ( char  olc)

◆ AttachView() [1/2]

void AttachView ( const mol::EntityView view)

attach entity view to sequence

Exceptions
IntegrityErrorwhen the view contains more than one chain

◆ AttachView() [2/2]

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

◆ Copy()

SequenceImplPtr Copy ( ) const

create copy sequence

The newly created sequence has the same attached view.

◆ Cut()

void Cut ( int  start,
int  n 
)

◆ FromString()

static SequenceImplPtr FromString ( const String seq_name,
const String sequence_string,
const String role = "UNKNOWN" 
)
static

Construct new sequence object from sequence_string.

◆ GetAttachedView()

mol::EntityView GetAttachedView ( ) const

get attached view. may be an invalid entity view

◆ GetFirstNonGap()

int GetFirstNonGap ( ) const

Get position of first non-gap character in sequence.

◆ GetGaplessString()

String GetGaplessString ( ) const

Get sequence as String ignoring gaps.

◆ GetIndex()

int GetIndex ( const String substr) const

◆ GetLastNonGap()

int GetLastNonGap ( ) const

Get position of last non-gap character in sequence.

◆ GetLength()

int GetLength ( ) const

Get lenght of sequence, including gaps.

◆ GetName()

const String& GetName ( ) const

◆ GetOffset()

int GetOffset ( ) const

Get sequence offset from N-terminus.

See also
SetOffset

◆ GetOneLetterCode()

char GetOneLetterCode ( int  position) const

get one letter code of residue at position

◆ GetPos()

int GetPos ( int  residue_index) const

Get zero-based index for given residue number.

Exceptions
out_of_range,ifnumber is not included in sequence.

◆ GetResidue()

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.

◆ GetResidueIndex()

int GetResidueIndex ( int  pos) const

Get residue index corresponding to given sequence position.

Parameters
poszero-based index
Exceptions
out_of_rangeif pos is not in [0, length-1].

◆ GetRole()

const String& GetRole ( ) const
inline

Definition at line 156 of file sequence_impl.hh.

◆ GetString()

const String& GetString ( ) const
inline

Definition at line 78 of file sequence_impl.hh.

◆ HasAttachedView()

bool HasAttachedView ( ) const

whether the sequence has an attached view

◆ Normalise()

void Normalise ( )

Remove everything 'unusual' from sequence.

◆ operator[]() [1/2]

char& operator[] ( size_t  index)
inline

Definition at line 148 of file sequence_impl.hh.

◆ operator[]() [2/2]

char operator[] ( size_t  index) const
inline

Definition at line 152 of file sequence_impl.hh.

◆ Replace()

void Replace ( const String str,
int  start,
int  end 
)

replace substring starting from start to end

◆ SetName()

void SetName ( const String name)

◆ SetOffset()

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.

◆ SetOneLetterCode()

void SetOneLetterCode ( int  position,
char  new_char 
)

◆ SetRole()

void SetRole ( const String role)
inline

Definition at line 161 of file sequence_impl.hh.

◆ SetString()

void SetString ( const String seq)

Set sequence String.

◆ ShiftRegion()

void ShiftRegion ( int  start,
int  end,
int  amount 
)

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