bpp-seq3
3.0.0
|
A SymbolList object. More...
#include <Bpp/Seq/SymbolList.h>
Public Member Functions | |
SymbolList (const Alphabet *alpha) | |
Build a new void SymbolList object with the specified alphabet. More... | |
SymbolList (const std::vector< T > &list, const Alphabet *alpha) | |
Build a new SymbolList object with the specified alphabet. The content of the site is initialized from a vector of T objects. More... | |
SymbolList (const SymbolList< T > &list) | |
The generic copy constructor. More... | |
SymbolList (const CoreSymbolList< T > &list) | |
The copy constructor. More... | |
SymbolList< T > & | operator= (const CoreSymbolList< T > &list) |
The generic assignment operator. More... | |
SymbolList< T > & | operator= (const SymbolList< T > &list) |
The assignment operator. More... | |
virtual | ~SymbolList () |
const Alphabet * | getAlphabet () const |
Get the alphabet associated to the list. More... | |
size_t | size () const |
Get the number of elements in the list. More... | |
virtual void | setContent (const std::vector< T > &list) |
Set the whole content of the list. More... | |
virtual const std::vector< T > & | getContent () const |
virtual std::string | toString () const |
Convert the list as a string. More... | |
void | deleteElement (size_t pos) |
Remove the element at position 'pos'. More... | |
void | deleteElements (size_t pos, size_t len) |
Remove the elements at position 'pos'. More... | |
void | addElement (const T &v) |
Add a character to the end of the list. More... | |
void | addElement (size_t pos, const T &v) |
Add a character at a certain position in the list. More... | |
void | setElement (size_t pos, const T &v) |
Set the element at position 'pos' to character 'c'. More... | |
virtual const T & | getElement (size_t pos) const |
Get the element at position 'pos' as a character. More... | |
virtual const T & | getValue (size_t pos) const |
checked access to a character in list. More... | |
virtual const T & | operator[] (size_t pos) const |
Operator [] overloaded for quick access to a character in list. More... | |
virtual T & | operator[] (size_t pos) |
Operator [] overloaded for quick access to a character in list. More... | |
virtual void | shuffle () |
Randomly shuffle the content of the list, with linear complexity. More... | |
virtual double | getStateValueAt (size_t siteIndex, int state) const |
virtual double | operator() (size_t siteIndex, int state) const |
The Clonable interface | |
virtual SymbolList< T > * | clone () const =0 |
Protected Attributes | |
std::vector< T > | content_ |
The list content. More... | |
Private Attributes | |
const Alphabet * | alphabet_ |
The Alphabet attribute must be initialized in constructor and then can never be changed. More... | |
A SymbolList object.
This is a general purpose container, containing an ordered list of T states. The states that allowed to be present in the list are defined by an alphabet object, which is passed to the list constructor by a pointer.
Definition at line 70 of file SymbolList.h.
|
inline |
Build a new void SymbolList object with the specified alphabet.
alpha | The alphabet to use. |
Definition at line 94 of file SymbolList.h.
|
inline |
Build a new SymbolList object with the specified alphabet. The content of the site is initialized from a vector of T objects.
list | The content of the site. |
alpha | The alphabet to use. |
Definition at line 104 of file SymbolList.h.
References bpp::SymbolList< T >::setContent().
|
inline |
The generic copy constructor.
Definition at line 114 of file SymbolList.h.
|
inline |
The copy constructor.
Definition at line 122 of file SymbolList.h.
References bpp::SymbolList< T >::content_, and bpp::CruxSymbolList::size().
|
inlinevirtual |
Definition at line 166 of file SymbolList.h.
|
inlinevirtual |
Add a character to the end of the list.
c | The character to add. |
Implements bpp::CoreSymbolList< T >.
Reimplemented in bpp::EdSymbolList< T >.
Definition at line 199 of file SymbolList.h.
References bpp::SymbolList< T >::content_.
Referenced by bpp::EdSymbolList< T >::addElement().
|
inlinevirtual |
Add a character at a certain position in the list.
pos | The postion where to insert the element. |
c | The character to add. |
Implements bpp::CoreSymbolList< T >.
Reimplemented in bpp::EdSymbolList< T >.
Definition at line 204 of file SymbolList.h.
References bpp::SymbolList< T >::content_, and bpp::SymbolList< T >::size().
|
pure virtual |
|
inlinevirtual |
Remove the element at position 'pos'.
pos | The position of the element to remove. |
Implements bpp::CruxSymbolList.
Reimplemented in bpp::EdSymbolList< T >, and bpp::EdSymbolList< int >.
Definition at line 185 of file SymbolList.h.
References bpp::SymbolList< T >::content_, and bpp::SymbolList< T >::size().
Referenced by bpp::EdSymbolList< T >::deleteElement().
|
inlinevirtual |
Remove the elements at position 'pos'.
pos | The position of the first element to remove. |
len | The length of the region to remove. |
Implements bpp::CruxSymbolList.
Reimplemented in bpp::EdSymbolList< T >, and bpp::EdSymbolList< int >.
Definition at line 192 of file SymbolList.h.
References bpp::SymbolList< T >::content_, and bpp::SymbolList< T >::size().
Referenced by bpp::EdSymbolList< T >::deleteElements().
|
inlinevirtual |
Get the alphabet associated to the list.
Implements bpp::CruxSymbolList.
Definition at line 169 of file SymbolList.h.
References bpp::SymbolList< T >::alphabet_.
Referenced by bpp::SequenceWithQualityTools::complement(), bpp::SequenceWithQualityTools::concatenate(), bpp::SequenceWithAnnotation::merge(), bpp::SequenceWithQualityTools::removeGaps(), bpp::SequenceWithQualityTools::reverseTranscript(), bpp::SequenceWithQualityTools::subseq(), and bpp::SequenceWithQualityTools::transcript().
|
inlinevirtual |
Implements bpp::CoreSymbolList< T >.
Definition at line 178 of file SymbolList.h.
References bpp::SymbolList< T >::content_.
|
inlinevirtual |
Get the element at position 'pos' as a character.
pos | The position of the character to retrieve. |
Implements bpp::CoreSymbolList< T >.
Definition at line 220 of file SymbolList.h.
References bpp::SymbolList< T >::content_, and bpp::SymbolList< T >::size().
|
inlinevirtualinherited |
Reimplemented in bpp::BasicProbabilisticSymbolList, bpp::BasicIntSymbolList, and bpp::EdCoreSymbolList< T >.
Definition at line 147 of file CoreSymbolList.h.
Referenced by bpp::VectorProbabilisticSiteContainer::addSequence(), bpp::BasicProbabilisticSymbolList::BasicProbabilisticSymbolList(), bpp::VectorProbabilisticSequenceContainer::getStateValueAt(), bpp::VectorSequenceContainer::getStateValueAt(), bpp::EdCoreSymbolList< T >::getStateValueAt(), and bpp::Pasta::writeSequence().
|
inlinevirtual |
checked access to a character in list.
pos | The position to retrieve. |
Implements bpp::CoreSymbolList< T >.
Definition at line 227 of file SymbolList.h.
References bpp::SymbolList< T >::content_, and bpp::SymbolList< T >::size().
Referenced by bpp::CodonSiteTools::generateCodonSiteWithoutRareVariant(), bpp::CodonSiteTools::isFourFoldDegenerated(), and bpp::CodonSiteTools::numberOfSubstitutions().
|
inlinevirtualinherited |
Reimplemented in bpp::BasicProbabilisticSymbolList, bpp::BasicIntSymbolList, and bpp::EdCoreSymbolList< T >.
Definition at line 154 of file CoreSymbolList.h.
Referenced by bpp::EdCoreSymbolList< T >::operator()().
|
inline |
The generic assignment operator.
Definition at line 135 of file SymbolList.h.
References bpp::SymbolList< T >::alphabet_, bpp::SymbolList< T >::content_, bpp::CruxSymbolList::getAlphabet(), and bpp::CruxSymbolList::size().
Referenced by bpp::BasicIntSymbolList::operator=(), and bpp::EdSymbolList< T >::operator=().
|
inline |
The assignment operator.
Definition at line 149 of file SymbolList.h.
References bpp::SymbolList< T >::alphabet_, and bpp::SymbolList< T >::content_.
|
inlinevirtual |
Operator [] overloaded for quick access to a character in list.
pos | The position to retrieve. |
Implements bpp::CoreSymbolList< T >.
Definition at line 236 of file SymbolList.h.
References bpp::SymbolList< T >::content_.
|
inlinevirtual |
Operator [] overloaded for quick access to a character in list.
pos | The position to retrieve. |
Implements bpp::CoreSymbolList< T >.
Definition at line 234 of file SymbolList.h.
References bpp::SymbolList< T >::content_.
|
inlinevirtual |
Set the whole content of the list.
list | The new content of the list. |
Implements bpp::CoreSymbolList< T >.
Reimplemented in bpp::EdSymbolList< T >, bpp::EdSymbolList< int >, bpp::SequenceWithAnnotation, bpp::BasicSequence, bpp::EdIntSymbolList, and bpp::BasicIntSymbolList.
Definition at line 173 of file SymbolList.h.
References bpp::SymbolList< T >::content_.
Referenced by bpp::BasicIntSymbolList::setContent(), bpp::EdSymbolList< T >::setContent(), and bpp::SymbolList< T >::SymbolList().
|
inlinevirtual |
Set the element at position 'pos' to character 'c'.
pos | The position of the character to set. |
c | The value of the element. |
Implements bpp::CoreSymbolList< T >.
Reimplemented in bpp::EdSymbolList< T >.
Definition at line 212 of file SymbolList.h.
References bpp::SymbolList< T >::content_, and bpp::SymbolList< T >::size().
Referenced by bpp::EdSymbolList< T >::setElement().
|
inlinevirtual |
Randomly shuffle the content of the list, with linear complexity.
Implements bpp::CruxSymbolList.
Definition at line 238 of file SymbolList.h.
References bpp::SymbolList< T >::content_.
|
inlinevirtual |
Get the number of elements in the list.
Implements bpp::CruxSymbolList.
Definition at line 171 of file SymbolList.h.
References bpp::SymbolList< T >::content_.
Referenced by bpp::SymbolList< T >::addElement(), bpp::SymbolList< T >::deleteElement(), bpp::SymbolList< T >::deleteElements(), bpp::SymbolList< T >::getElement(), bpp::SymbolList< T >::getValue(), bpp::SequenceMask::isValidWith(), bpp::SequenceQuality::isValidWith(), bpp::SequenceWithQualityTools::removeGaps(), bpp::SymbolList< T >::setElement(), and bpp::SequenceWithQualityTools::subseq().
|
inlinevirtual |
Convert the list as a string.
This method is useful for dumping a list to a file or to the screen for display.
Implements bpp::CruxSymbolList.
Reimplemented in bpp::BasicSequence, bpp::EdIntSymbolList, and bpp::BasicIntSymbolList.
Definition at line 180 of file SymbolList.h.
|
private |
The Alphabet attribute must be initialized in constructor and then can never be changed.
To apply another alphabet to a list you'll have to create a new list.
Definition at line 79 of file SymbolList.h.
Referenced by bpp::SymbolList< T >::getAlphabet(), and bpp::SymbolList< T >::operator=().
|
protected |
The list content.
Definition at line 85 of file SymbolList.h.
Referenced by bpp::SymbolList< T >::addElement(), bpp::SymbolList< T >::deleteElement(), bpp::SymbolList< T >::deleteElements(), bpp::SymbolList< T >::getContent(), bpp::SymbolList< T >::getElement(), bpp::SymbolList< T >::getValue(), bpp::SymbolList< T >::operator=(), bpp::SymbolList< T >::operator[](), bpp::SymbolList< T >::setContent(), bpp::SymbolList< T >::setElement(), bpp::SymbolList< T >::shuffle(), bpp::SymbolList< T >::size(), and bpp::SymbolList< T >::SymbolList().