Abstract interface to sequence objects.
More...
#include <Sequence/Seq.hpp>
List of all members.
Detailed Description
Abstract interface to sequence objects.
Abstract interface to sequence objects. A sequence consists of a name and a sequence, both of which are stored as C++ std::strings. Sequence::Seq inherits publicly from std::pair<std::string,std::string> to store the sequence name and data. The public member "first" is the name, and "second" is the data. These can be used to directly access the name and/or data. Most of the rest of the member functions of this class are to make the behavior of Sequence::Seq more "std::string"-like.
Definition at line 49 of file Seq.hpp.
Member Typedef Documentation
Const iterator to sequence elements. Iterators access the data, not the seuquence name. Value type de-references to char
Definition at line 72 of file Seq.hpp.
Iterator to sequence elements. Iterators access the data, not the seuquence name. Value type de-references to char
Definition at line 66 of file Seq.hpp.
Constructor & Destructor Documentation
| Sequence::Seq::Seq |
( |
void |
|
) |
|
creates an empty sequence
Definition at line 31 of file Seq.cc.
| Sequence::Seq::Seq |
( |
const Seq & |
seq |
) |
|
copy constructor
Definition at line 42 of file Seq.cc.
Member Function Documentation
- Returns:
- a const iterator to the beginning of the sequence
Definition at line 209 of file Seq.cc.
- Returns:
- an iterator to the beginning of the sequence
- Examples:
- valid_dna.cc.
Definition at line 193 of file Seq.cc.
| const char * Sequence::Seq::c_str |
( |
void |
|
) |
const |
- Returns:
- the the C-style string representing the sequence as a cont char *
Definition at line 225 of file Seq.cc.
| void Sequence::Seq::Complement |
( |
void |
|
) |
|
Complement the Sequence
- Note:
- This modifies the data in the object by changing the std::string--if you want to keep the original sequence, you need to make a copy of the object first.
Definition at line 169 of file Seq.cc.
- Returns:
- a const iterator to the end of the sequence
Definition at line 217 of file Seq.cc.
- Returns:
- an iterator to the end of the sequence
- Examples:
- valid_dna.cc.
Definition at line 201 of file Seq.cc.
| std::string Sequence::Seq::GetName |
( |
void |
|
) |
const |
| std::string Sequence::Seq::GetSeq |
( |
void |
|
) |
const |
Return the sequence itself
Definition at line 53 of file Seq.cc.
| bool Sequence::Seq::IsGapped |
( |
void |
|
) |
const |
Returns 1 if the sequence contaings the gap character '-', 0 otherwise
Definition at line 145 of file Seq.cc.
| Seq::size_type Sequence::Seq::length |
( |
void |
|
) |
const |
Return the total length of the sequence
- Examples:
- codons.cc.
Definition at line 77 of file Seq.cc.
| Sequence::Seq::operator std::string |
( |
|
) |
const |
allows (implict) cast to std::string
Definition at line 127 of file Seq.cc.
| bool Sequence::Seq::operator!= |
( |
const Seq & |
rhs |
) |
const |
- Returns:
- false if the sequences contain the same data, true otherwise.
- Note:
- only the sequences (i.e. this->second and rhs.second) are compared
Definition at line 117 of file Seq.cc.
| bool Sequence::Seq::operator== |
( |
const Seq & |
rhs |
) |
const |
- Returns:
- true if the sequences contain the same data, false otherwise.
- Note:
- only the sequences (i.e. this->second and rhs.second) are compared
Definition at line 107 of file Seq.cc.
| Seq::const_reference Sequence::Seq::operator[] |
( |
const size_type & |
i |
) |
const |
Return the i-th element of the sequence.
- Note:
- range-checking is done by assert()
Definition at line 97 of file Seq.cc.
| Seq::reference Sequence::Seq::operator[] |
( |
const size_type & |
i |
) |
|
Return the i-th element of the sequence.
- Note:
- range-checking is done by assert()
Definition at line 86 of file Seq.cc.
| virtual std::ostream& Sequence::Seq::print |
( |
std::ostream & |
s |
) |
const [pure virtual] |
| virtual std::istream& Sequence::Seq::read |
( |
std::istream & |
s |
) |
throw (Sequence::badFormat,std::exception) [pure virtual] |
| void Sequence::Seq::Revcom |
( |
void |
|
) |
|
Reverse and complement the sequence.
- Note:
- This function modifies the data in the object by changing the std::string--if you want to keep the original sequence, you need to make a copy of the object first.
- Returns:
- *this
Definition at line 180 of file Seq.cc.
| void Sequence::Seq::Subseq |
( |
unsigned |
beg, |
|
|
unsigned |
length | |
|
) |
| | |
- Parameters:
-
| beg | the index along the sequence at which the substring begins |
| length | the length of the subseq Acts via std::string.substr(). Note that this modifies the data in the object by changing thestd::string--if you want to keep the original sequence, you need to make a copy of the object first. |
- Note:
- range-checking done by assert()
Definition at line 154 of file Seq.cc.
| std::string Sequence::Seq::substr |
( |
unsigned |
beg |
) |
const |
Mimics the standardstd::string member function of the same name.
Definition at line 69 of file Seq.cc.
| std::string Sequence::Seq::substr |
( |
unsigned |
beg, |
|
|
unsigned |
len | |
|
) |
| | const |
Mimics the std::string member function of the same name.
Definition at line 61 of file Seq.cc.
| Seq::size_type Sequence::Seq::UngappedLength |
( |
void |
|
) |
const |
Return length of sequence, excluding the gap character '-'
Definition at line 136 of file Seq.cc.
The documentation for this class was generated from the following files: