bpp-seq3
3.0.0
|
A event-driven IntSymbolList object. More...
#include <Bpp/Seq/IntSymbolList.h>
Public Member Functions | |
EdIntSymbolList (const Alphabet *alpha) | |
Build a new void EdIntSymbolList object with the specified alphabet. More... | |
EdIntSymbolList (const std::vector< std::string > &list, const Alphabet *alpha) | |
Build a new EdIntSymbolList object with the specified alphabet. The content of the site is initialized from a vector of characters. More... | |
EdIntSymbolList (const std::vector< int > &list, const Alphabet *alpha) | |
Build a new EdIntSymbolList object with the specified alphabet. The content of the site is initialized from a vector of integers. More... | |
EdIntSymbolList (const IntSymbolList &list) | |
The generic copy constructor. More... | |
EdIntSymbolList (const EdIntSymbolList &list) | |
The copy constructor. More... | |
EdIntSymbolList & | operator= (const IntSymbolList &list) |
The generic assignment operator. More... | |
EdIntSymbolList & | operator= (const EdIntSymbolList &list) |
The assignment operator. More... | |
~EdIntSymbolList () | |
virtual void | setContent (const std::vector< std::string > &list) |
void | setContent (const std::vector< int > &list) |
virtual std::string | toString () const |
Convert the list as a string. More... | |
virtual void | addElement (const std::string &c) |
virtual void | addElement (size_t pos, const std::string &c) |
virtual void | setElement (size_t pos, const std::string &c) |
virtual std::string | getChar (size_t pos) const |
void | addIntSymbolListListener (IntSymbolListListener *listener) |
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... | |
virtual void | addElement (const int &v) |
Add a character to the end of the list. More... | |
virtual void | addElement (size_t pos, const int &v) |
Add a character at a certain position in the list. More... | |
virtual void | setElement (size_t pos, const int &v) |
Set the element at position 'pos' to character 'c'. More... | |
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 const std::vector< int > & | getContent () const |
virtual const int & | getElement (size_t pos) const |
Get the element at position 'pos' as a character. More... | |
virtual const int & | getValue (size_t pos) const |
checked access to a character in list. More... | |
virtual const int & | operator[] (size_t pos) const |
Operator [] overloaded for quick access to a character in list. More... | |
virtual int & | 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 | getStateValueAt (size_t siteIndex, int state) const |
From CruxSymbolList. More... | |
virtual double | operator() (size_t siteIndex, int state) const |
virtual double | operator() (size_t siteIndex, int state) const |
The Clonable interface | |
EdIntSymbolList * | clone () const |
Acting on the content of the list. | |
virtual void | setContent (const std::vector< T > &list)=0 |
Set the whole content of the list. More... | |
Edition methods. | |
virtual void | addElement (const T &c)=0 |
Add a character to the end of the list. More... | |
virtual void | addElement (size_t pos, const T &c)=0 |
Add a character at a certain position in the list. More... | |
virtual void | setElement (size_t pos, const T &c)=0 |
Set the element at position 'pos' to character 'c'. More... | |
Protected Member Functions | |
virtual void | beforeSequenceChanged (const IntSymbolListEditionEvent &event) |
virtual void | afterSequenceChanged (const IntSymbolListEditionEvent &event) |
virtual void | beforeSequenceInserted (const IntSymbolListInsertionEvent &event) |
virtual void | afterSequenceInserted (const IntSymbolListInsertionEvent &event) |
virtual void | beforeSequenceDeleted (const IntSymbolListDeletionEvent &event) |
virtual void | afterSequenceDeleted (const IntSymbolListDeletionEvent &event) |
virtual void | beforeSequenceSubstituted (const IntSymbolListSubstitutionEvent &event) |
virtual void | afterSequenceSubstituted (const IntSymbolListSubstitutionEvent &event) |
void | propagateEvents (bool yn) |
bool | propagateEvents () const |
Protected Attributes | |
std::vector< CoreSymbolListListener< int > * > | listeners_ |
Contains the listeners. More... | |
std::vector< int > | content_ |
The list content. More... | |
Private Attributes | |
bool | propagateEvents_ |
const Alphabet * | alphabet_ |
The Alphabet attribute must be initialized in constructor and then can never be changed. More... | |
A event-driven IntSymbolList object.
This is a general purpose container, containing an ordered list of states(= letters). 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.
For programming convenience, the states are stored as integers, but the translation toward and from a char description is easily performed with the Alphabet classes.
Definition at line 254 of file IntSymbolList.h.
|
inline |
Build a new void EdIntSymbolList object with the specified alphabet.
alpha | The alphabet to use. |
Definition at line 263 of file IntSymbolList.h.
Referenced by clone().
EdIntSymbolList::EdIntSymbolList | ( | const std::vector< std::string > & | list, |
const Alphabet * | alpha | ||
) |
Build a new EdIntSymbolList object with the specified alphabet. The content of the site is initialized from a vector of characters.
list | The content of the site. |
alpha | The alphabet to use. |
Definition at line 178 of file IntSymbolList.cpp.
References setContent().
EdIntSymbolList::EdIntSymbolList | ( | const std::vector< int > & | list, |
const Alphabet * | alpha | ||
) |
Build a new EdIntSymbolList object with the specified alphabet. The content of the site is initialized from a vector of integers.
list | The content of the site. |
alpha | The alphabet to use. |
Definition at line 184 of file IntSymbolList.cpp.
bpp::EdIntSymbolList::EdIntSymbolList | ( | const IntSymbolList & | list | ) |
The generic copy constructor.
EdIntSymbolList::EdIntSymbolList | ( | const EdIntSymbolList & | list | ) |
The copy constructor.
Definition at line 190 of file IntSymbolList.cpp.
|
inline |
Definition at line 312 of file IntSymbolList.h.
|
inlinevirtualinherited |
Definition at line 439 of file SymbolList.h.
|
pure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlinevirtualinherited |
Add a character to the end of the list.
c | The character to add. |
Definition at line 394 of file SymbolList.h.
|
virtual |
Definition at line 243 of file IntSymbolList.cpp.
References bpp::EdSymbolList< T >::addElement(), and bpp::SymbolList< int >::getAlphabet().
Referenced by bpp::SequenceWithQuality::addElement().
|
pure virtualinherited |
Add a character to the end of the list.
c | The character to add. |
Implemented in bpp::EdSymbolList< T >, bpp::SymbolList< T >, and bpp::BasicProbabilisticSymbolList.
Referenced by bpp::AlignedSequenceContainer::addSite(), bpp::SequenceTools::getPutativeHaplotypes(), bpp::AbstractReverseTransliterator::reverse(), and bpp::AbstractTransliterator::translate().
|
inlinevirtualinherited |
Add a character at a certain position in the list.
pos | The postion where to insert the element. |
c | The character to add. |
Definition at line 402 of file SymbolList.h.
|
virtual |
Definition at line 250 of file IntSymbolList.cpp.
References bpp::EdSymbolList< T >::addElement(), and bpp::SymbolList< int >::getAlphabet().
|
pure virtualinherited |
Add a character at a certain position in the list.
pos | The postion where to insert the element. |
c | The character to add. |
Implemented in bpp::EdSymbolList< T >, bpp::SymbolList< T >, and bpp::BasicProbabilisticSymbolList.
|
inline |
Definition at line 333 of file IntSymbolList.h.
References bpp::EdSymbolList< int >::addCoreSymbolListListener().
Referenced by bpp::SequenceWithAnnotation::addAnnotation().
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedvirtual |
Reimplemented from bpp::EdSymbolList< int >.
Definition at line 340 of file IntSymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedvirtual |
Reimplemented from bpp::EdSymbolList< int >.
Definition at line 344 of file IntSymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedvirtual |
Reimplemented from bpp::EdSymbolList< int >.
Definition at line 342 of file IntSymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedvirtual |
Reimplemented from bpp::EdSymbolList< int >.
Definition at line 346 of file IntSymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedvirtual |
Reimplemented from bpp::EdSymbolList< int >.
Definition at line 339 of file IntSymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedvirtual |
Reimplemented from bpp::EdSymbolList< int >.
Definition at line 343 of file IntSymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedvirtual |
Reimplemented from bpp::EdSymbolList< int >.
Definition at line 341 of file IntSymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedvirtual |
Reimplemented from bpp::EdSymbolList< int >.
Definition at line 345 of file IntSymbolList.h.
|
inlinevirtual |
Implements bpp::EdCoreSymbolList< T >.
Reimplemented in bpp::SequenceWithQuality, and bpp::SequenceWithAnnotation.
Definition at line 309 of file IntSymbolList.h.
References EdIntSymbolList().
|
inlinevirtualinherited |
Remove the element at position 'pos'.
pos | The position of the element to remove. |
Reimplemented from bpp::SymbolList< int >.
Definition at line 377 of file SymbolList.h.
|
inlinevirtualinherited |
Remove the elements at position 'pos'.
pos | The position of the first element to remove. |
len | The length of the region to remove. |
Reimplemented from bpp::SymbolList< int >.
Definition at line 386 of file SymbolList.h.
|
inlineprotectedinherited |
Definition at line 472 of file SymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedinherited |
Definition at line 512 of file SymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedinherited |
Definition at line 492 of file SymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedinherited |
Definition at line 532 of file SymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedinherited |
Definition at line 462 of file SymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedinherited |
Definition at line 502 of file SymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedinherited |
Definition at line 482 of file SymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlineprotectedinherited |
Definition at line 522 of file SymbolList.h.
|
protectedpure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
inlinevirtualinherited |
Get the alphabet associated to the list.
Implements bpp::CruxSymbolList.
Definition at line 169 of file SymbolList.h.
|
virtual |
Reimplemented in bpp::SequenceWithAnnotation.
Definition at line 264 of file IntSymbolList.cpp.
References bpp::SymbolList< int >::content_, bpp::SymbolList< int >::getAlphabet(), bpp::Alphabet::intToChar(), and bpp::SymbolList< int >::size().
Referenced by bpp::SequenceWithAnnotation::getChar().
|
inlinevirtualinherited |
Implements bpp::CoreSymbolList< T >.
Definition at line 178 of file SymbolList.h.
|
inlinevirtualinherited |
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.
|
inlinevirtualinherited |
Implements bpp::EdCoreSymbolList< T >.
Definition at line 432 of file SymbolList.h.
|
inlinevirtualinherited |
Implements bpp::EdCoreSymbolList< T >.
Definition at line 425 of file SymbolList.h.
|
inlinevirtualinherited |
Implements bpp::EdCoreSymbolList< T >.
Definition at line 423 of file SymbolList.h.
|
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().
|
inlinevirtualinherited |
From CruxSymbolList.
Reimplemented from bpp::CruxSymbolList.
Definition at line 416 of file CoreSymbolList.h.
References bpp::CruxSymbolList::getStateValueAt().
|
inlinevirtualinherited |
checked access to a character in list.
pos | The position to retrieve. |
Implements bpp::CoreSymbolList< T >.
Definition at line 227 of file SymbolList.h.
|
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()().
|
inlinevirtualinherited |
Reimplemented from bpp::CruxSymbolList.
Definition at line 421 of file CoreSymbolList.h.
References bpp::CruxSymbolList::operator()().
EdIntSymbolList & EdIntSymbolList::operator= | ( | const EdIntSymbolList & | list | ) |
The assignment operator.
Definition at line 194 of file IntSymbolList.cpp.
References bpp::EdSymbolList< T >::operator=().
EdIntSymbolList& bpp::EdIntSymbolList::operator= | ( | const IntSymbolList & | list | ) |
The generic assignment operator.
Referenced by bpp::SequenceWithAnnotation::operator=().
|
inlinevirtualinherited |
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.
|
inlinevirtualinherited |
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.
|
inlineprotectedvirtualinherited |
Implements bpp::EdCoreSymbolList< T >.
Definition at line 545 of file SymbolList.h.
|
inlineprotectedvirtualinherited |
Implements bpp::EdCoreSymbolList< T >.
Definition at line 544 of file SymbolList.h.
|
inlinevirtualinherited |
Definition at line 444 of file SymbolList.h.
|
pure virtualinherited |
Implemented in bpp::EdSymbolList< T >.
|
virtual |
Reimplemented from bpp::EdSymbolList< int >.
Reimplemented in bpp::SequenceWithAnnotation.
Definition at line 222 of file IntSymbolList.cpp.
References bpp::SymbolList< int >::getAlphabet(), and bpp::EdSymbolList< T >::setContent().
|
virtual |
Reimplemented in bpp::SequenceWithAnnotation.
Definition at line 202 of file IntSymbolList.cpp.
References bpp::SymbolList< int >::getAlphabet().
Referenced by EdIntSymbolList(), and bpp::SequenceWithAnnotation::setContent().
|
pure virtualinherited |
Set the whole content of the list.
list | The new content of the list. |
Implemented in bpp::EdSymbolList< T >, bpp::SymbolList< T >, and bpp::BasicProbabilisticSymbolList.
Referenced by bpp::Pasta::nextSequence().
|
inlinevirtualinherited |
Set the element at position 'pos' to character 'c'.
pos | The position of the character to set. |
c | The value of the element. |
Definition at line 410 of file SymbolList.h.
|
virtual |
Definition at line 257 of file IntSymbolList.cpp.
References bpp::SymbolList< int >::getAlphabet(), and bpp::EdSymbolList< T >::setElement().
|
pure virtualinherited |
Set the element at position 'pos' to character 'c'.
pos | The position of the character to set. |
c | The value of the element. |
Implemented in bpp::EdSymbolList< T >, bpp::SymbolList< T >, and bpp::BasicProbabilisticSymbolList.
Referenced by bpp::SequenceTools::complement(), bpp::SequenceTools::invert(), bpp::SequenceTools::invertComplement(), bpp::SequenceTools::replaceStopsWithGaps(), and bpp::AlignedSequenceContainer::setSite().
|
inlinevirtualinherited |
Randomly shuffle the content of the list, with linear complexity.
Implements bpp::CruxSymbolList.
Definition at line 238 of file SymbolList.h.
|
inlinevirtualinherited |
Get the number of elements in the list.
Implements bpp::CruxSymbolList.
Definition at line 171 of file SymbolList.h.
|
virtual |
Convert the list as a string.
This method is useful for dumping a list to a file or to the screen for display.
Reimplemented from bpp::SymbolList< int >.
Definition at line 236 of file IntSymbolList.cpp.
References bpp::SymbolList< int >::content_, bpp::StringSequenceTools::decodeSequence(), and bpp::SymbolList< int >::getAlphabet().
|
privateinherited |
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.
|
protectedinherited |
The list content.
Definition at line 85 of file SymbolList.h.
|
protectedinherited |
Contains the listeners.
Definition at line 257 of file SymbolList.h.
|
privateinherited |
Definition at line 251 of file SymbolList.h.