bpp-seq3  3.0.0
bpp::TemplateEventDrivenCoreSymbolListInterface< T > Class Template Referenceabstract

Interface for event-driven CoreSymbolList objects. More...

#include <Bpp/Seq/CoreSymbolList.h>

+ Inheritance diagram for bpp::TemplateEventDrivenCoreSymbolListInterface< T >:
+ Collaboration diagram for bpp::TemplateEventDrivenCoreSymbolListInterface< T >:

Public Member Functions

virtual ~TemplateEventDrivenCoreSymbolListInterface ()
 
virtual std::shared_ptr< const AlphabetgetAlphabet () const =0
 Get the alphabet associated to the list. More...
 
virtual const Alphabetalphabet () const =0
 Get the alphabet associated to the list. More...
 
virtual size_t size () const =0
 Get the number of elements in the list. More...
 
virtual std::string toString () const =0
 Convert the list as a string. More...
 
virtual double getStateValueAt (size_t position, int state) const =0
 get value of a state at a position More...
 
virtual double operator() (size_t position, int state) const =0
 get value of a state at a position More...
 
The Clonable interface
virtual TemplateEventDrivenCoreSymbolListInterfaceclone () const override=0
 
Acting on the content of the list.
virtual void setContent (const std::vector< T > &list)=0
 Set the whole content of the list. More...
 
virtual const std::vector< T > & getContent () const =0
 
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...
 
virtual const T & getElement (size_t pos) const =0
 Get the element at position 'pos' as a character. More...
 
Provide direct access to the list content.
Warning
These operators allow you to modify the list content. No alphabet checking is performed for your modifications, so use with care, or consider using the setContent() method.
virtual const T & getValue (size_t pos) const =0
 checked access to a character in list. More...
 
virtual const T & operator[] (size_t pos) const =0
 Operator [] overloaded for quick access to a character in list. More...
 
virtual T & operator[] (size_t pos)=0
 Operator [] overloaded for quick access to a character in list. More...
 
Edition methods.
virtual void deleteElement (size_t pos)=0
 Remove the element at position 'pos'. More...
 
virtual void deleteElements (size_t pos, size_t len)=0
 Remove the elements at position 'pos'. More...
 
Provide direct access to the list content.
Warning
These operators allow you to modify the list content. No alphabet checking is performed for your modifications, so use with care, or consider using the setContent() method.
virtual void shuffle ()=0
 Randomly shuffle the content of the list, with linear complexity. More...
 

Protected Member Functions

virtual void propagateEvents (bool yn)=0
 
virtual bool propagateEvents () const =0
 

Events handling

virtual size_t getNumberOfListeners () const =0
 
virtual const CoreSymbolListListener< T > & listener (size_t i) const =0
 
virtual std::shared_ptr< const CoreSymbolListListener< T > > getListener (size_t i) const =0
 
virtual CoreSymbolListListener< T > & listener (size_t i)=0
 
virtual std::shared_ptr< CoreSymbolListListener< T > > getListener (size_t i)=0
 
virtual void addCoreSymbolListListener (std::shared_ptr< CoreSymbolListListener< T >> listener)=0
 
virtual void removeCoreSymbolListListener (std::shared_ptr< CoreSymbolListListener< T >> listener)=0
 
virtual void beforeSequenceChanged (const CoreSymbolListEditionEvent< T > &event)=0
 
virtual void afterSequenceChanged (const CoreSymbolListEditionEvent< T > &event)=0
 
virtual void beforeSequenceInserted (const CoreSymbolListInsertionEvent< T > &event)=0
 
virtual void afterSequenceInserted (const CoreSymbolListInsertionEvent< T > &event)=0
 
virtual void beforeSequenceDeleted (const CoreSymbolListDeletionEvent< T > &event)=0
 
virtual void afterSequenceDeleted (const CoreSymbolListDeletionEvent< T > &event)=0
 
virtual void beforeSequenceSubstituted (const CoreSymbolListSubstitutionEvent< T > &event)=0
 
virtual void afterSequenceSubstituted (const CoreSymbolListSubstitutionEvent< T > &event)=0
 
virtual void fireBeforeSequenceChanged (const CoreSymbolListEditionEvent< T > &event)=0
 
virtual void fireAfterSequenceChanged (const CoreSymbolListEditionEvent< T > &event)=0
 
virtual void fireBeforeSequenceInserted (const CoreSymbolListInsertionEvent< T > &event)=0
 
virtual void fireAfterSequenceInserted (const CoreSymbolListInsertionEvent< T > &event)=0
 
virtual void fireBeforeSequenceDeleted (const CoreSymbolListDeletionEvent< T > &event)=0
 
virtual void fireAfterSequenceDeleted (const CoreSymbolListDeletionEvent< T > &event)=0
 
virtual void fireBeforeSequenceSubstituted (const CoreSymbolListSubstitutionEvent< T > &event)=0
 
virtual void fireAfterSequenceSubstituted (const CoreSymbolListSubstitutionEvent< T > &event)=0
 

Detailed Description

template<class T>
class bpp::TemplateEventDrivenCoreSymbolListInterface< T >

Interface for event-driven CoreSymbolList objects.

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 Ts, but the translation toward and from a char description is easily performed with the Alphabet classes.

See also
Alphabet

Definition at line 370 of file CoreSymbolList.h.

Constructor & Destructor Documentation

◆ ~TemplateEventDrivenCoreSymbolListInterface()

Definition at line 383 of file CoreSymbolList.h.

Member Function Documentation

◆ addCoreSymbolListListener()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::addCoreSymbolListListener ( std::shared_ptr< CoreSymbolListListener< T >>  listener)
pure virtual

◆ addElement() [1/2]

template<class T >
virtual void bpp::TemplateCoreSymbolListInterface< T >::addElement ( const T &  c)
pure virtualinherited

Add a character to the end of the list.

Parameters
cThe character to add.

Implemented in bpp::AbstractTemplateEventDrivenSymbolList< T >, and bpp::AbstractTemplateSymbolList< T >.

◆ addElement() [2/2]

template<class T >
virtual void bpp::TemplateCoreSymbolListInterface< T >::addElement ( size_t  pos,
const T &  c 
)
pure virtualinherited

Add a character at a certain position in the list.

Parameters
posThe position where to insert the element.
cThe character to add.

Implemented in bpp::AbstractTemplateEventDrivenSymbolList< T >, and bpp::AbstractTemplateSymbolList< T >.

◆ afterSequenceChanged()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::afterSequenceChanged ( const CoreSymbolListEditionEvent< T > &  event)
protectedpure virtual

◆ afterSequenceDeleted()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::afterSequenceDeleted ( const CoreSymbolListDeletionEvent< T > &  event)
protectedpure virtual

◆ afterSequenceInserted()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::afterSequenceInserted ( const CoreSymbolListInsertionEvent< T > &  event)
protectedpure virtual

◆ afterSequenceSubstituted()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::afterSequenceSubstituted ( const CoreSymbolListSubstitutionEvent< T > &  event)
protectedpure virtual

◆ alphabet()

◆ beforeSequenceChanged()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::beforeSequenceChanged ( const CoreSymbolListEditionEvent< T > &  event)
protectedpure virtual

◆ beforeSequenceDeleted()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::beforeSequenceDeleted ( const CoreSymbolListDeletionEvent< T > &  event)
protectedpure virtual

◆ beforeSequenceInserted()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::beforeSequenceInserted ( const CoreSymbolListInsertionEvent< T > &  event)
protectedpure virtual

◆ beforeSequenceSubstituted()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::beforeSequenceSubstituted ( const CoreSymbolListSubstitutionEvent< T > &  event)
protectedpure virtual

◆ clone()

◆ deleteElement()

virtual void bpp::CruxSymbolListInterface::deleteElement ( size_t  pos)
pure virtualinherited

◆ deleteElements()

virtual void bpp::CruxSymbolListInterface::deleteElements ( size_t  pos,
size_t  len 
)
pure virtualinherited

Remove the elements at position 'pos'.

Parameters
posThe position of the first element to remove.
lenThe length of the region to remove.

Implemented in bpp::AbstractTemplateEventDrivenSymbolList< T >, bpp::AbstractTemplateEventDrivenSymbolList< int >, bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

◆ fireAfterSequenceChanged()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::fireAfterSequenceChanged ( const CoreSymbolListEditionEvent< T > &  event)
protectedpure virtual

◆ fireAfterSequenceDeleted()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::fireAfterSequenceDeleted ( const CoreSymbolListDeletionEvent< T > &  event)
protectedpure virtual

◆ fireAfterSequenceInserted()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::fireAfterSequenceInserted ( const CoreSymbolListInsertionEvent< T > &  event)
protectedpure virtual

◆ fireAfterSequenceSubstituted()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::fireAfterSequenceSubstituted ( const CoreSymbolListSubstitutionEvent< T > &  event)
protectedpure virtual

◆ fireBeforeSequenceChanged()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::fireBeforeSequenceChanged ( const CoreSymbolListEditionEvent< T > &  event)
protectedpure virtual

◆ fireBeforeSequenceDeleted()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::fireBeforeSequenceDeleted ( const CoreSymbolListDeletionEvent< T > &  event)
protectedpure virtual

◆ fireBeforeSequenceInserted()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::fireBeforeSequenceInserted ( const CoreSymbolListInsertionEvent< T > &  event)
protectedpure virtual

◆ fireBeforeSequenceSubstituted()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::fireBeforeSequenceSubstituted ( const CoreSymbolListSubstitutionEvent< T > &  event)
protectedpure virtual

◆ getAlphabet()

virtual std::shared_ptr<const Alphabet> bpp::CruxSymbolListInterface::getAlphabet ( ) const
pure virtualinherited

Get the alphabet associated to the list.

Returns
A const pointer to the alphabet.
See also
Alphabet class.

Implemented in bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

Referenced by bpp::Sequence::append(), bpp::SequenceWithAnnotation::append(), bpp::SequenceTools::areSequencesIdentical(), bpp::SymbolListTools::areSymbolListsIdentical(), bpp::SequenceTools::bowkerTest(), bpp::SymbolListTools::changeGapsToUnknownCharacters(), bpp::SymbolListTools::changeUnresolvedCharactersToGaps(), bpp::SequenceTools::combineSequences(), bpp::SequenceWithQualityTools::complement(), bpp::SequenceTools::complement(), bpp::SiteContainerTools::computeSimilarity(), bpp::SequenceTools::concatenate(), bpp::SequenceWithQualityTools::concatenate(), bpp::SequenceTools::findFirstOf(), bpp::SequenceTools::getCDS(), bpp::SequenceTools::getComplement(), bpp::SymbolListTools::getCountsResolveUnknowns(), bpp::SymbolListTools::getGCContent(), bpp::SymbolListTools::getNumberOfDistinctPositions(), bpp::SymbolListTools::getNumberOfPositionsWithoutGap(), bpp::SequenceTools::getNumberOfUnresolvedSites(), bpp::SequenceTools::getPercentIdentity(), bpp::SequenceTools::getPutativeHaplotypes(), bpp::SequenceTools::getSequenceWithoutGaps(), bpp::SequenceTools::getSequenceWithoutStops(), bpp::SymbolListTools::hasGap(), bpp::SymbolListTools::hasUnknown(), bpp::SymbolListTools::hasUnresolved(), bpp::SequenceTools::invertComplement(), bpp::SymbolListTools::isComplete(), bpp::SymbolListTools::isConstant(), bpp::SymbolListTools::isGapOnly(), bpp::SymbolListTools::isGapOrUnresolvedOnly(), bpp::SymbolListTools::jointEntropy(), bpp::SequenceWithAnnotation::merge(), bpp::SymbolListTools::mutualInformation(), bpp::SymbolListTools::numberOfGaps(), bpp::SymbolListTools::numberOfUnresolved(), bpp::ProbabilisticSymbolList::operator=(), bpp::AbstractTemplateSymbolList< T >::operator=(), bpp::SequenceWithQualityTools::removeGaps(), bpp::SequenceTools::removeGaps(), bpp::SequenceTools::removeStops(), bpp::SequenceTools::replaceStopsWithGaps(), bpp::WordAlphabet::reverse(), bpp::NucleicAcidsReplication::reverse(), bpp::SequenceWithQualityTools::reverseTranscript(), bpp::SequenceTools::RNYslice(), bpp::SequenceTools::subseq(), bpp::SequenceWithQualityTools::subseq(), bpp::SequenceTools::subtractHaplotype(), bpp::SequenceWithQualityTools::transcript(), bpp::NucleicAcidsReplication::translate(), bpp::AbstractTransliterator::translate(), bpp::WordAlphabet::translate(), and bpp::SymbolListTools::variabilityShannon().

◆ getContent()

◆ getElement()

template<class T >
virtual const T& bpp::TemplateCoreSymbolListInterface< T >::getElement ( size_t  pos) const
pure virtualinherited

Get the element at position 'pos' as a character.

Parameters
posThe position of the character to retrieve.

Implemented in bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

◆ getListener() [1/2]

template<class T >
virtual std::shared_ptr<const CoreSymbolListListener<T> > bpp::TemplateEventDrivenCoreSymbolListInterface< T >::getListener ( size_t  i) const
pure virtual

◆ getListener() [2/2]

template<class T >
virtual std::shared_ptr<CoreSymbolListListener<T> > bpp::TemplateEventDrivenCoreSymbolListInterface< T >::getListener ( size_t  i)
pure virtual

◆ getNumberOfListeners()

template<class T >
virtual size_t bpp::TemplateEventDrivenCoreSymbolListInterface< T >::getNumberOfListeners ( ) const
pure virtual

◆ getStateValueAt()

virtual double bpp::CruxSymbolListInterface::getStateValueAt ( size_t  position,
int  state 
) const
pure virtualinherited

get value of a state at a position

Parameters
positionposition in the list
statestate in the alphabet
Returns
The state value at the given position.

Implemented in bpp::Sequence, bpp::ProbabilisticSequence, bpp::ProbabilisticSymbolList, bpp::IntSymbolList, bpp::CoreSiteInterface, bpp::Site, and bpp::ProbabilisticSite.

Referenced by bpp::ProbabilisticSymbolList::ProbabilisticSymbolList().

◆ getValue()

◆ listener() [1/2]

template<class T >
virtual const CoreSymbolListListener<T>& bpp::TemplateEventDrivenCoreSymbolListInterface< T >::listener ( size_t  i) const
pure virtual

◆ listener() [2/2]

◆ operator()()

virtual double bpp::CruxSymbolListInterface::operator() ( size_t  position,
int  state 
) const
pure virtualinherited

get value of a state at a position

Short-cut for getStateValueAt.

Parameters
positionposition in the list
statestate in the alphabet
Returns
The state value at the given position.

Implemented in bpp::ProbabilisticSymbolList, and bpp::IntSymbolList.

◆ operator[]() [1/2]

template<class T >
virtual const T& bpp::TemplateCoreSymbolListInterface< T >::operator[] ( size_t  pos) const
pure virtualinherited

Operator [] overloaded for quick access to a character in list.

Parameters
posThe position to retrieve.
Returns
The T value of character at position pos.

Implemented in bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

◆ operator[]() [2/2]

template<class T >
virtual T& bpp::TemplateCoreSymbolListInterface< T >::operator[] ( size_t  pos)
pure virtualinherited

Operator [] overloaded for quick access to a character in list.

Parameters
posThe position to retrieve.
Returns
The T value of character at position pos.

Implemented in bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

◆ propagateEvents() [1/2]

template<class T >
virtual bool bpp::TemplateEventDrivenCoreSymbolListInterface< T >::propagateEvents ( ) const
protectedpure virtual

◆ propagateEvents() [2/2]

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::propagateEvents ( bool  yn)
protectedpure virtual

◆ removeCoreSymbolListListener()

template<class T >
virtual void bpp::TemplateEventDrivenCoreSymbolListInterface< T >::removeCoreSymbolListListener ( std::shared_ptr< CoreSymbolListListener< T >>  listener)
pure virtual

◆ setContent()

template<class T >
virtual void bpp::TemplateCoreSymbolListInterface< T >::setContent ( const std::vector< T > &  list)
pure virtualinherited

Set the whole content of the list.

Parameters
listThe new content of the list.
See also
The list constructor for information about the way lists are internally stored.

Implemented in bpp::AbstractTemplateEventDrivenSymbolList< T >, and bpp::AbstractTemplateSymbolList< T >.

◆ setElement()

template<class T >
virtual void bpp::TemplateCoreSymbolListInterface< T >::setElement ( size_t  pos,
const T &  c 
)
pure virtualinherited

Set the element at position 'pos' to character 'c'.

Parameters
posThe position of the character to set.
cThe value of the element.

Implemented in bpp::AbstractTemplateEventDrivenSymbolList< T >, and bpp::AbstractTemplateSymbolList< T >.

◆ shuffle()

virtual void bpp::CruxSymbolListInterface::shuffle ( )
pure virtualinherited

Randomly shuffle the content of the list, with linear complexity.

Implemented in bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

◆ size()

virtual size_t bpp::CruxSymbolListInterface::size ( ) const
pure virtualinherited

Get the number of elements in the list.

Returns
The number of sites in the list.

Implemented in bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, and bpp::ProbabilisticSymbolList.

Referenced by bpp::AbstractTemplateSymbolList< T >::AbstractTemplateSymbolList(), bpp::SequenceWithQuality::addElement(), bpp::SequenceWithAnnotation::append(), bpp::SequenceTools::areSequencesIdentical(), bpp::SymbolListTools::areSymbolListsIdentical(), bpp::SequenceTools::bowkerTest(), bpp::SymbolListTools::changeGapsToUnknownCharacters(), bpp::SymbolListTools::changeUnresolvedCharactersToGaps(), bpp::SequenceTools::combineSequences(), bpp::SequenceTools::complement(), bpp::SiteContainerTools::computeSimilarity(), bpp::SequenceTools::concatenate(), bpp::SequenceTools::findFirstOf(), bpp::SequenceTools::getCDS(), bpp::GeneticCode::getCodingSequence(), bpp::SymbolListTools::getCounts(), bpp::SymbolListTools::getCountsResolveUnknowns(), bpp::SymbolListTools::getFrequencies(), bpp::SymbolListTools::getGCContent(), bpp::SymbolListTools::getMajorAllele(), bpp::SymbolListTools::getMajorAlleleFrequency(), bpp::SymbolListTools::getMinorAllele(), bpp::SymbolListTools::getMinorAlleleFrequency(), bpp::SequenceTools::getNumberOfCompleteSites(), bpp::SymbolListTools::getNumberOfDistinctCharacters(), bpp::SymbolListTools::getNumberOfDistinctPositions(), bpp::SymbolListTools::getNumberOfPositionsWithoutGap(), bpp::SequenceTools::getNumberOfSites(), bpp::SequenceTools::getNumberOfUnresolvedSites(), bpp::SequenceTools::getPercentIdentity(), bpp::SequenceTools::getPutativeHaplotypes(), bpp::SequenceTools::getSequenceWithCompleteSites(), bpp::SequenceTools::getSequenceWithoutGaps(), bpp::SequenceTools::getSequenceWithoutStops(), bpp::SymbolListTools::hasGap(), bpp::SymbolListTools::hasSingleton(), bpp::SymbolListTools::hasUnknown(), bpp::SymbolListTools::hasUnresolved(), bpp::SymbolListTools::heterozygosity(), bpp::SequenceTools::invert(), bpp::SequenceTools::invertComplement(), bpp::SymbolListTools::isComplete(), bpp::SymbolListTools::isConstant(), bpp::SymbolListTools::isDoubleton(), bpp::SymbolListTools::isGapOnly(), bpp::SymbolListTools::isGapOrUnresolvedOnly(), bpp::SymbolListTools::isParsimonyInformativeSite(), bpp::SymbolListTools::isTriplet(), bpp::SequenceMask::isValidWith(), bpp::SequenceQuality::isValidWith(), bpp::SymbolListTools::jointEntropy(), bpp::SymbolListTools::mutualInformation(), bpp::SymbolListTools::numberOfGaps(), bpp::SymbolListTools::numberOfUnresolved(), bpp::AbstractTemplateSymbolList< T >::operator=(), bpp::SiteInterface::operator==(), bpp::SequenceWithQualityTools::removeGaps(), bpp::SequenceTools::removeGaps(), bpp::SequenceTools::removeStops(), bpp::SequenceTools::replaceStopsWithGaps(), bpp::CodonAlphabet::reverse(), bpp::WordAlphabet::reverse(), bpp::NucleicAcidsReplication::reverse(), bpp::AbstractReverseTransliterator::reverse(), bpp::SequenceTools::RNYslice(), bpp::SequenceWalker::SequenceWalker(), bpp::SequenceTools::subseq(), bpp::SequenceWithQualityTools::subseq(), bpp::SequenceTools::subtractHaplotype(), bpp::NucleicAcidsReplication::translate(), bpp::AbstractTransliterator::translate(), bpp::CodonAlphabet::translate(), bpp::WordAlphabet::translate(), bpp::SymbolListTools::variabilityFactorial(), and bpp::SymbolListTools::variabilityShannon().

◆ toString()

virtual std::string bpp::CruxSymbolListInterface::toString ( ) const
pure virtualinherited

Convert the list as a string.

This method is useful for dumping a list to a file or to the screen for display.

Returns
The whole list as a string.

Implemented in bpp::AbstractTemplateSymbolList< T >, bpp::AbstractTemplateSymbolList< int >, bpp::Sequence, bpp::ProbabilisticSymbolList, bpp::EventDrivenIntSymbolList, and bpp::IntSymbolList.


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