MDA
|
A class to represent a protein sequence. More...
#include <ProteinSequence.hpp>
Public Member Functions | |
Constructors & Destructors | |
ProteinSequence (const std::string &seq_name, const std::string &seq, const std::string &comment_="", size_t seq_id=0) | |
ProteinSequence (const std::string &seq_name, const std::string &comment_, unsigned int seq_length, size_t seq_id=0) | |
ProteinSequence (const Sequence &seq) | |
virtual | ~ProteinSequence () |
Domain related methods | |
void | add_domain (const Domain &dom) |
Append a domain to the existing set. More... | |
DomainArchitecture & | dom_archi () |
Returns the DomainArchitecture of the sequence. More... | |
const DomainArchitecture & | dom_archi () const |
Domain & | domain (size_t index) |
Returns a domain at a specific position. More... | |
size_t | n_domains () const |
The number of domains of the sequence. More... | |
Operators | |
char & | operator[] (unsigned int index) |
Access operator. More... | |
const char & | operator[] (unsigned int index) const |
Basic methods | |
const std::string & | name () const |
Returns the name of the sequence. More... | |
void | name (const std::string &na) |
const std::string & | sequence () const |
Returns the sequence as a string. More... | |
void | sequence (const std::string &seq) |
Sets the sequence. More... | |
const std::string & | comment () const |
Returns the comment of a string. More... | |
void | comment (const std::string &com) |
Sets the comment. More... | |
size_t | size () const |
The length of the sequence. More... | |
size_t | length () const |
The length of the sequence. More... | |
size_t | ungapped_size () const |
The size of the sequence without gaps. More... | |
size_t | id () const |
Returns the sequence id of the sequence. More... | |
void | id (size_t val) |
Sets the id of the sequence. More... | |
Manipulation methods | |
template<class T > | |
void | append (const T &seq) |
Appends a string to the sequence. | |
void | append (const Sequence &seq) |
Appends a string to the sequence. | |
void | append (char c) |
Appends a char to the sequence. | |
void | resize (unsigned int new_length) |
Resizes the sequence. More... | |
void | to_upper () |
Turns all charachters of the sequence to uppercase. | |
void | to_lower () |
Turns all characters of the sequence to lowercase. | |
void | reverse () |
Reverses the order of characters in the sequence. | |
void | insert_gaps (const std::vector< std::pair< unsigned int, unsigned int > > vec) |
Inserts gaps into the sequence. More... | |
void | insert_gaps (const std::string &edit_string) |
Related Functions | |
(Note that these are not member functions.) | |
template<typename SequenceType > | |
SequenceType | substr (const SequenceType &seq, size_t start, size_t length) |
returns a new Sequence that is a substring of an existing one. More... | |
template<typename SequenceType > | |
SequenceType | substr_no_renaming (const SequenceType &seq, size_t start, size_t length) |
returns a new Sequence that is a substring of an existing one. More... | |
template<typename SequenceType > | |
SequenceType * | substr_end (const SequenceType &seq, size_t start, size_t end) |
returns a new Sequence that is a substring of an existing one. More... | |
template<typename SequenceType > | |
void | reverse_complement (SequenceType &seq) |
Computes the reverse complement of a DNA sequence. More... | |
template<typename SequenceTypeIn , typename SequenceTypeOut > | |
SequenceTypeOut | dna2prot (const SequenceTypeIn &seq) |
Turns a DNA sequence into a ProteinSequence. More... | |
A class to represent a protein sequence.
Beside the normal information it allows to store domain information.
MDAT::ProteinSequence::ProteinSequence | ( | const std::string & | seq_name, |
const std::string & | seq, | ||
const std::string & | comment_ = "" , |
||
size_t | seq_id = 0 |
||
) |
Full initialization.
MDAT::ProteinSequence::ProteinSequence | ( | const std::string & | seq_name, |
const std::string & | comment_, | ||
unsigned int | seq_length, | ||
size_t | seq_id = 0 |
||
) |
Reserves the necessary space
MDAT::ProteinSequence::ProteinSequence | ( | const Sequence & | seq | ) |
Copy constructor
|
inline |
Append a domain to the existing set.
dom | The domain to append. |
|
inlineinherited |
Returns the comment of a string.
|
inlineinherited |
Sets the comment.
com | The comment. |
|
inline |
Returns the DomainArchitecture of the sequence.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Returns a domain at a specific position.
index | The index. |
|
inlineinherited |
Returns the sequence id of the sequence.
It represents the order in which the sequences were read.
|
inlineinherited |
Sets the id of the sequence.
val | The new value. |
|
inherited |
Inserts gaps into the sequence.
vec | A vector of pairs. The first value of a pair gives the position of the gap, the second one the length of it. |
|
inlineinherited |
The length of the sequence.
|
inline |
The number of domains of the sequence.
|
inlineinherited |
Returns the name of the sequence.
|
inlineinherited |
Access operator.
index | The index of to access. |
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineinherited |
Resizes the sequence.
new_length | The new_length. |
|
inlineinherited |
Returns the sequence as a string.
|
inlineinherited |
Sets the sequence.
seq | The sequence |
|
inlineinherited |
The length of the sequence.
|
inherited |
The size of the sequence without gaps.
|
related |
Turns a DNA sequence into a ProteinSequence.
SequenceTypeIn | The type of the sequence input |
SequenceTypeOut | The outputType of the sequence |
seq | The sequence to translate. |
|
related |
Computes the reverse complement of a DNA sequence.
seq | The sequence to change. |
|
related |
returns a new Sequence that is a substring of an existing one.
seq | The sequence to produce the new one from. |
start | The start position of the substring. |
length | The lengths of the substr. |
|
related |
returns a new Sequence that is a substring of an existing one.
seq | The sequence to produce the new one from. |
start | The start position of the substring. |
end | The last position of the substring in sequence. |
|
related |
returns a new Sequence that is a substring of an existing one.
seq | The sequence to produce the new one from. |
start | The start position of the substring. |
length | The lengths of the substr. |