bpp-seq3  3.0.0
bpp::AbstractCoreSequence Class Referenceabstract

A partial implementation of the CoreSequence interface. More...

#include <Bpp/Seq/CoreSequence.h>

+ Inheritance diagram for bpp::AbstractCoreSequence:
+ Collaboration diagram for bpp::AbstractCoreSequence:

Public Member Functions

 AbstractCoreSequence (const std::string &name)
 Constructor of the AbstractCoreSequence object. More...
 
 AbstractCoreSequence (const std::string &name, const Comments &comments)
 Constructor of the AbstractCoreSequence object. More...
 
 AbstractCoreSequence ()
 
 AbstractCoreSequence (const AbstractCoreSequence &s)
 
AbstractCoreSequenceoperator= (const AbstractCoreSequence &s)
 
 AbstractCoreSequence (const CoreSequenceInterface &s)
 
AbstractCoreSequenceoperator= (const CoreSequenceInterface &s)
 
virtual ~AbstractCoreSequence ()
 
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...
 
virtual const CommentsgetComments () const =0
 Get the comments. More...
 
virtual void setComments (const Comments &comments)=0
 Set the comments. More...
 
virtual void clearComments ()=0
 
const CommentsgetComments () const override
 Get the comments. More...
 
void setComments (const Comments &comments) override
 Set the comments. More...
 
void clearComments () override
 
The Clonable interface
virtual AbstractCoreSequenceclone () const override=0
 
Setting/getting the name of the sequence.
const std::string & getName () const override
 Get the name of this sequence. More...
 
void setName (const std::string &name) override
 Set the name of this sequence. More...
 
Adjusting the size of the sequence.
virtual void setToSizeR (size_t newSize)=0
 Set up the size of a sequence from the right side. More...
 
virtual void setToSizeL (size_t newSize)=0
 Set up the size of a sequence from the left side. 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 Attributes

Comments comments_
 

Private Attributes

std::string name_
 The sequence name. More...
 

Detailed Description

A partial implementation of the CoreSequence interface.

Definition at line 95 of file CoreSequence.h.

Constructor & Destructor Documentation

◆ AbstractCoreSequence() [1/5]

bpp::AbstractCoreSequence::AbstractCoreSequence ( const std::string &  name)
inline

Constructor of the AbstractCoreSequence object.

Parameters
nameThe sequence name.

Definition at line 111 of file CoreSequence.h.

◆ AbstractCoreSequence() [2/5]

bpp::AbstractCoreSequence::AbstractCoreSequence ( const std::string &  name,
const Comments comments 
)
inline

Constructor of the AbstractCoreSequence object.

Parameters
nameThe sequence name.
commentsComments to add to the sequence.

Definition at line 121 of file CoreSequence.h.

◆ AbstractCoreSequence() [3/5]

bpp::AbstractCoreSequence::AbstractCoreSequence ( )
inline

Definition at line 125 of file CoreSequence.h.

◆ AbstractCoreSequence() [4/5]

bpp::AbstractCoreSequence::AbstractCoreSequence ( const AbstractCoreSequence s)
inline

Definition at line 129 of file CoreSequence.h.

◆ AbstractCoreSequence() [5/5]

bpp::AbstractCoreSequence::AbstractCoreSequence ( const CoreSequenceInterface s)
inline

Definition at line 141 of file CoreSequence.h.

◆ ~AbstractCoreSequence()

virtual bpp::AbstractCoreSequence::~AbstractCoreSequence ( )
inlinevirtual

Definition at line 153 of file CoreSequence.h.

Member Function Documentation

◆ alphabet()

◆ clearComments() [1/2]

void bpp::SimpleCommentable::clearComments ( )
inlineoverridevirtualinherited

Implements bpp::Commentable.

Definition at line 88 of file Commentable.h.

References bpp::SimpleCommentable::comments_.

◆ clearComments() [2/2]

virtual void bpp::Commentable::clearComments ( )
pure virtualinherited

Implemented in bpp::SimpleCommentable.

◆ clone()

virtual AbstractCoreSequence* bpp::AbstractCoreSequence::clone ( ) const
overridepure virtual

◆ 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.

◆ 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().

◆ getComments() [1/2]

◆ getComments() [2/2]

◆ getName()

const std::string& bpp::AbstractCoreSequence::getName ( ) const
inlineoverridevirtual

◆ 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().

◆ 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]

AbstractCoreSequence& bpp::AbstractCoreSequence::operator= ( const AbstractCoreSequence s)
inline

◆ operator=() [2/2]

AbstractCoreSequence& bpp::AbstractCoreSequence::operator= ( const CoreSequenceInterface s)
inline

◆ setComments() [1/2]

◆ setComments() [2/2]

virtual void bpp::Commentable::setComments ( const Comments comments)
pure virtualinherited

◆ setName()

void bpp::AbstractCoreSequence::setName ( const std::string &  name)
inlineoverridevirtual

Set the name of this sequence.

Parameters
nameThe new name of the sequence.

Implements bpp::CoreSequenceInterface.

Definition at line 172 of file CoreSequence.h.

References name_.

Referenced by bpp::Pasta::nextSequence(), bpp::PhredPoly::nextSequence(), bpp::Fasta::nextSequence(), bpp::PhredPhd::nextSequence(), and bpp::SequenceWithAnnotation::operator=().

◆ setToSizeL()

virtual void bpp::CoreSequenceInterface::setToSizeL ( size_t  newSize)
pure virtualinherited

Set up the size of a sequence from the left side.

All new characters are filled with gaps. If the specified size is < to the sequence size, the sequence will be truncated.

Parameters
newSizeThe new size of the sequence.

Implemented in bpp::SequenceWithAnnotation, bpp::Sequence, and bpp::ProbabilisticSequence.

◆ setToSizeR()

virtual void bpp::CoreSequenceInterface::setToSizeR ( size_t  newSize)
pure virtualinherited

Set up the size of a sequence from the right side.

All new characters are filled with gaps. If the specified size is < to the sequence size, the sequence will be truncated.

Parameters
newSizeThe new size of the sequence.

Implemented in bpp::SequenceWithAnnotation, bpp::Sequence, and bpp::ProbabilisticSequence.

◆ 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.

Member Data Documentation

◆ comments_

◆ name_

std::string bpp::AbstractCoreSequence::name_
private

The sequence name.

Definition at line 103 of file CoreSequence.h.

Referenced by getName(), operator=(), and setName().


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