bpp-seq3
3.0.0
|
Partial implementation of the OrderedSequenceContainer interface. More...
#include <Bpp/Seq/Container/AbstractProbabilisticSequenceContainer.h>
Public Member Functions | |
AbstractProbabilisticSequenceContainer (const Alphabet *alpha) | |
This constructor initialize the alphabet pointer. More... | |
AbstractProbabilisticSequenceContainer (const AbstractProbabilisticSequenceContainer &sc) | |
AbstractProbabilisticSequenceContainer & | operator= (const AbstractProbabilisticSequenceContainer &sc) |
virtual | ~AbstractProbabilisticSequenceContainer () |
virtual const ProbabilisticSequence & | getSequence (std::size_t i) const =0 |
virtual const ProbabilisticSequence & | getSequence (const std::string &name) const =0 |
Retrieve a probabilistic sequence object from the container. More... | |
virtual void | addSequence (const ProbabilisticSequence &sequence, bool checkName=true)=0 |
Add a probabilistic sequence to the container. More... | |
virtual void | addSequence (const Sequence &sequence, bool checkName=true)=0 |
Add a basic sequence to the container, through conversion to a probabilistic sequence. More... | |
std::string | toString (const std::string &name) const |
Output to string. More... | |
const Comments & | getComments (const std::string &name) const |
Get comments of a particular sequence. More... | |
void | setComments (const std::string &name, const Comments &comments) |
Set the comments of a particular sequence. More... | |
virtual void | setComments (const std::string &name, const Comments &comments)=0 |
Set the comments of a particular sequence. More... | |
void | setComments (const Comments &comments) |
Set the comments. More... | |
virtual const Comments & | getComments (const std::string &name) const=0 |
Get comments of a particular sequence. More... | |
const Comments & | getComments () const |
Get the comments. More... | |
OrderedValuesContainer * | clone () const =0 |
virtual std::string | toString (const std::string &name) const=0 |
Convert a particular sequence to a string. More... | |
virtual size_t | getSequencePosition (const std::string &name) const =0 |
Get the position of a sequence in sequence container from its name. More... | |
virtual double | getStateValueAt (size_t siteIndex, size_t sequenceIndex, int state) const =0 |
virtual double | getStateValueAt (size_t siteIndex, const std::string &sequenceName, int state) const=0 |
get value of a state in a position More... | |
virtual double | getStateValueAt (size_t siteIndex, const std::string &sequenceName, int state) const =0 |
get value of a state in a position More... | |
virtual double | operator() (size_t siteIndex, size_t sequenceIndex, int state) const =0 |
virtual double | operator() (size_t siteIndex, const std::string &sequenceName, int state) const =0 |
virtual bool | hasSequence (const std::string &name) const =0 |
Check if a sequence with a given name is present in the container. More... | |
virtual size_t | getNumberOfSequences () const =0 |
Get the number of sequences in the container. More... | |
virtual std::vector< std::string > | getSequenceNames () const =0 |
Get all the names of the sequences in the container. More... | |
virtual void | setSequenceNames (const std::vector< std::string > &names, bool checkNames)=0 |
Set all sequence names. More... | |
virtual void | clear ()=0 |
Delete all data in the container. More... | |
virtual SequencedValuesContainer * | createEmptyContainer () const =0 |
Return a copy of this container, but with no data inside. More... | |
void | clearComments () |
virtual void | setSequence (const std::string &name, const ProbabilisticSequence &sequence, bool checkName)=0 |
Replace a probabilistic sequence in the container. More... | |
From the OrderedSequenceContainer interface | |
virtual const std::string & | getName (size_t sequenceIndex) const |
Get the name of a particular row of the alignement (aka sequence). More... | |
virtual std::string | toString (size_t sequenceIndex) const |
const Comments & | getGeneralComments () const |
Get the comments of this container. More... | |
void | setGeneralComments (const Comments &comments) |
Set the comments of this container. More... | |
void | deleteGeneralComments () |
Delete the comments associated to this container. More... | |
virtual const Comments & | getComments (size_t sequenceIndex) const |
virtual void | setComments (size_t sequenceIndex, const Comments &comments)=0 |
From the SequencedValuesContainer interface | |
const Alphabet * | getAlphabet () const |
Get container's alphabet. More... | |
Protected Attributes | |
const Alphabet * | alphabet_ |
The container's alphabet. More... | |
Comments | comments_ |
Partial implementation of the OrderedSequenceContainer interface.
This abstract class provides an alphabet and comments, with associated methods.
Definition at line 56 of file AbstractProbabilisticSequenceContainer.h.
|
inline |
This constructor initialize the alphabet pointer.
This constructor is to be called by constructors of derived classes.
alpha | The alphabet to be associated to this container. |
Definition at line 68 of file AbstractProbabilisticSequenceContainer.h.
|
inline |
Definition at line 71 of file AbstractProbabilisticSequenceContainer.h.
|
inlinevirtual |
Definition at line 80 of file AbstractProbabilisticSequenceContainer.h.
|
pure virtual |
Add a probabilistic sequence to the container.
sequence | The sequence to add. |
checkName | Tell if the container must check if the name of the sequence is already used in the container before adding it. |
Exception | Any other kind of exception, if the name of the sequence is already used, are whatever else depending on the implementation. |
Implemented in bpp::VectorProbabilisticSiteContainer.
|
pure virtual |
Add a basic sequence to the container, through conversion to a probabilistic sequence.
sequence | The sequence to add. |
checkName | Tell if the container must check if the name of the sequence is already used in the container before adding it. |
Exception | Any other kind of exception, if the name of the sequence is already used, are whatever else depending on the implementation. |
Implemented in bpp::VectorProbabilisticSiteContainer.
|
pure virtualinherited |
Delete all data in the container.
Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, bpp::CompressedVectorSiteContainer, and bpp::AlignedSequenceContainer.
|
inlineinherited |
Definition at line 102 of file Commentable.h.
References bpp::Commentable::comments_.
Referenced by bpp::BasicProbabilisticSequence::clearComments(), bpp::BasicSequence::clearComments(), bpp::SequenceWithAnnotation::clearComments(), bpp::SequenceWithQuality::clearComments(), deleteGeneralComments(), and bpp::AbstractValuesContainer::deleteGeneralComments().
|
pure virtualinherited |
Implements bpp::Clonable.
Implemented in bpp::SiteContainer, bpp::ProbabilisticSiteContainer, bpp::AlignedValuesContainer, bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, bpp::CompressedVectorSiteContainer, and bpp::AlignedSequenceContainer.
|
pure virtualinherited |
Return a copy of this container, but with no data inside.
This method creates a new SequencedValuesContainer objet. The class of this container depends on the derivative class.
Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, bpp::CompressedVectorSiteContainer, and bpp::AlignedSequenceContainer.
|
inlinevirtual |
Delete the comments associated to this container.
Implements bpp::SequencedValuesContainer.
Definition at line 157 of file AbstractProbabilisticSequenceContainer.h.
References bpp::Commentable::clearComments().
|
inlinevirtualinherited |
Get container's alphabet.
Implements bpp::SequencedValuesContainer.
Definition at line 99 of file AbstractValuesContainer.h.
References bpp::AbstractValuesContainer::alphabet_.
Referenced by bpp::VectorProbabilisticSequenceContainer::addSequence(), bpp::VectorProbabilisticSiteContainer::addSequence(), bpp::VectorSequenceContainer::addSequence(), bpp::VectorSiteContainer::addSequence(), bpp::CompressedVectorSiteContainer::addSite(), bpp::AlignedSequenceContainer::addSite(), bpp::VectorSiteContainer::addSite(), bpp::VectorProbabilisticSiteContainer::addSite(), bpp::Pasta::appendSequencesFromStream(), bpp::AlignedSequenceContainer::createEmptyContainer(), bpp::CompressedVectorSiteContainer::createEmptyContainer(), bpp::VectorProbabilisticSequenceContainer::createEmptyContainer(), bpp::VectorProbabilisticSiteContainer::createEmptyContainer(), bpp::VectorSequenceContainer::createEmptyContainer(), bpp::VectorSiteContainer::createEmptyContainer(), bpp::CompressedVectorSiteContainer::getSequence(), bpp::VectorSiteContainer::getSequence(), bpp::VectorProbabilisticSiteContainer::getSequence(), bpp::AlignedSequenceContainer::getSite(), bpp::CompressedVectorSiteContainer::getStateValueAt(), bpp::VectorProbabilisticSiteContainer::getStateValueAt(), bpp::VectorSiteContainer::getStateValueAt(), bpp::VectorProbabilisticSequenceContainer::getStateValueAt(), bpp::VectorSequenceContainer::getStateValueAt(), bpp::CompressedVectorSiteContainer::operator()(), bpp::VectorProbabilisticSiteContainer::operator()(), bpp::VectorSiteContainer::operator()(), bpp::VectorProbabilisticSequenceContainer::operator()(), bpp::VectorSequenceContainer::operator()(), bpp::VectorProbabilisticSiteContainer::realloc(), bpp::VectorSiteContainer::realloc(), bpp::CompressedVectorSiteContainer::removeSite(), bpp::CompressedVectorSiteContainer::setComments(), bpp::VectorProbabilisticSiteContainer::setSequence(), bpp::VectorProbabilisticSequenceContainer::setSequence(), bpp::VectorSiteContainer::setSequence(), bpp::VectorSequenceContainer::setSequence(), bpp::AlignedSequenceContainer::setSite(), bpp::CompressedVectorSiteContainer::setSite(), and bpp::VectorSiteContainer::setSite().
|
inlineinherited |
Get the comments.
Definition at line 93 of file Commentable.h.
References bpp::Commentable::comments_.
Referenced by bpp::AbstractCoreSequence::getComments(), bpp::SequenceWithAnnotation::getComments(), bpp::SequenceWithQuality::getComments(), getGeneralComments(), bpp::AbstractValuesContainer::getGeneralComments(), and bpp::VectorProbabilisticSiteContainer::getSequence().
|
inlinevirtual |
Get comments of a particular sequence.
name | The name of the sequence. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Implements bpp::SequencedValuesContainer.
Definition at line 121 of file AbstractProbabilisticSequenceContainer.h.
References bpp::CoreSequence::getComments(), and getSequence().
|
inherited |
Get comments of a particular sequence.
sequenceIndex | The position of the sequence. |
IndexOutOfBoundsException | If the position does not match any sequence in the container. |
|
inlinevirtual |
Implements bpp::AbstractValuesContainer.
Definition at line 162 of file AbstractProbabilisticSequenceContainer.h.
References bpp::CoreSequence::getComments(), and getSequence().
|
inlinevirtual |
Get the comments of this container.
Implements bpp::SequencedValuesContainer.
Definition at line 147 of file AbstractProbabilisticSequenceContainer.h.
References bpp::Commentable::getComments().
Referenced by bpp::VectorProbabilisticSiteContainer::createEmptyContainer(), and bpp::SiteContainerTools::getSelectedSites().
|
inlinevirtual |
Get the name of a particular row of the alignement (aka sequence).
sequenceIndex | The position of the sequence. |
IndexOutOfBoundsException | If the position does not match any sequence in the container. |
Implements bpp::OrderedValuesContainer.
Definition at line 137 of file AbstractProbabilisticSequenceContainer.h.
References bpp::CoreSequence::getName(), and getSequence().
|
pure virtualinherited |
Get the number of sequences in the container.
Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, and bpp::CompressedVectorSiteContainer.
Referenced by bpp::AlignedSequenceContainer::AlignedSequenceContainer(), bpp::SequenceContainerTools::append(), bpp::NexusIOSequence::appendAlignmentFromStream(), bpp::SiteContainerTools::changeGapsToUnknownCharacters(), bpp::SiteContainerTools::changeUnresolvedCharactersToGaps(), bpp::SiteContainerTools::computeSimilarityMatrix(), bpp::SequenceContainerTools::convertAlphabet(), bpp::SequenceContainerTools::getSelectedSequences(), bpp::SiteContainerTools::getSequencePositions(), bpp::SequenceApplicationTools::getSitesToAnalyse(), bpp::SimpleSequenceContainerIterator::hasMoreSequences(), bpp::VectorSequenceContainer::operator=(), bpp::VectorSiteContainer::operator=(), bpp::SiteContainerTools::removeGapOnlySites(), bpp::SiteContainerTools::removeGapOrUnresolvedOnlySites(), bpp::SiteContainerTools::removeGapSites(), bpp::SiteContainerTools::removeStopCodonSites(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::VectorProbabilisticSiteContainer::VectorProbabilisticSiteContainer(), bpp::VectorSequenceContainer::VectorSequenceContainer(), bpp::VectorSiteContainer::VectorSiteContainer(), bpp::Clustal::writeAlignment(), bpp::Phylip::writeAlignment(), bpp::Stockholm::writeAlignment(), bpp::Phylip::writeInterleaved(), and bpp::Phylip::writeSequential().
|
pure virtual |
Retrieve a probabilistic sequence object from the container.
name | The name of the sequence in the map. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Implements bpp::ProbabilisticSequenceContainer.
Implemented in bpp::VectorProbabilisticSiteContainer.
|
pure virtual |
Implemented in bpp::VectorProbabilisticSiteContainer.
Referenced by getComments(), getName(), toString(), and bpp::Pasta::writeAlignedValues().
|
pure virtualinherited |
Get all the names of the sequences in the container.
Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, and bpp::CompressedVectorSiteContainer.
Referenced by bpp::SequenceContainerTools::append(), bpp::CompressedVectorSiteContainer::CompressedVectorSiteContainer(), bpp::SiteContainerTools::computeSimilarityMatrix(), bpp::SequenceContainerTools::convertAlphabet(), bpp::SequenceContainerTools::getCodonPosition(), bpp::SiteContainerTools::getCompleteSites(), bpp::SequenceContainerTools::getCounts(), bpp::SequenceContainerTools::getFrequencies(), bpp::SiteContainerTools::getSelectedSites(), bpp::SiteContainerTools::getSitesWithoutGaps(), bpp::SequenceContainerTools::keepOnlySelectedSequences(), bpp::SequenceContainerTools::merge(), bpp::SiteContainerTools::merge(), bpp::VectorSequenceContainer::operator=(), bpp::CompressedVectorSiteContainer::operator=(), bpp::VectorSiteContainer::operator=(), bpp::SiteContainerTools::removeGapOnlySites(), bpp::SiteContainerTools::removeGapOrUnresolvedOnlySites(), bpp::SiteContainerTools::removeGapSites(), bpp::SiteContainerTools::removeStopCodonSites(), bpp::SiteContainerTools::resolveDottedAlignment(), bpp::SequenceApplicationTools::restrictSelectedSequencesByName(), bpp::SiteContainerTools::sampleSites(), bpp::SequenceContainerTools::sequencesHaveTheSameLength(), bpp::VectorProbabilisticSiteContainer::VectorProbabilisticSiteContainer(), bpp::VectorSequenceContainer::VectorSequenceContainer(), bpp::VectorSiteContainer::VectorSiteContainer(), bpp::Pasta::writeAlignedValues(), bpp::Stockholm::writeAlignment(), bpp::Phylip::writeInterleaved(), bpp::Fasta::writeSequences(), bpp::Mase::writeSequences(), and bpp::Phylip::writeSequential().
|
pure virtualinherited |
Get the position of a sequence in sequence container from its name.
name | The name of the sequence. |
SequenceNotFoundException | If no sequence with name 'name' could be found. |
Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, and bpp::CompressedVectorSiteContainer.
Referenced by setComments(), bpp::AbstractSequenceContainer::setComments(), and bpp::AbstractValuesContainer::setComments().
|
pure virtualinherited |
get value of a state in a position
siteIndex | index of the site |
sequenceName | name of the sequence in the container |
state | state in the alphabet |
Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, and bpp::CompressedVectorSiteContainer.
|
inherited |
get value of a state in a position
siteIndex | index of the site |
sequenceName | name of the sequence in the container |
state | state in the alphabet |
|
pure virtualinherited |
|
pure virtualinherited |
Check if a sequence with a given name is present in the container.
name | The name of the sequence. |
Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, and bpp::CompressedVectorSiteContainer.
Referenced by bpp::SequenceContainerTools::getSelectedSequences().
|
pure virtualinherited |
|
pure virtualinherited |
|
inline |
Definition at line 74 of file AbstractProbabilisticSequenceContainer.h.
References bpp::AbstractValuesContainer::operator=().
Referenced by bpp::VectorProbabilisticSiteContainer::operator=().
|
inlineinherited |
Set the comments.
comments | The new comments. |
Definition at line 100 of file Commentable.h.
References bpp::Commentable::comments_.
Referenced by bpp::AbstractCoreSequence::operator=(), bpp::AbstractCoreSequence::setComments(), bpp::SequenceWithAnnotation::setComments(), bpp::SequenceWithQuality::setComments(), setGeneralComments(), and bpp::AbstractValuesContainer::setGeneralComments().
|
inlinevirtual |
Set the comments of a particular sequence.
name | The name of the sequence. |
comments | The comments to set to sequence with name 'name'. |
SequenceNotFoundException | If the name does not match any sequence in the container. |
Implements bpp::SequencedValuesContainer.
Definition at line 126 of file AbstractProbabilisticSequenceContainer.h.
References bpp::OrderedValuesContainer::getSequencePosition(), and bpp::OrderedValuesContainer::setComments().
|
inherited |
Set the comments of a particular sequence.
sequenceIndex | The position of the sequence. |
comments | The comments to set to sequence with position 'i'. |
IndexOutOfBoundsException | If the position does not match any sequence in the container. |
Referenced by setComments(), bpp::AbstractValuesContainer::setComments(), and bpp::VectorProbabilisticSequenceContainer::setComments().
|
pure virtual |
Implements bpp::AbstractValuesContainer.
Implemented in bpp::VectorProbabilisticSiteContainer.
|
inlinevirtual |
Set the comments of this container.
comments | The comments to be associated to this container. |
Implements bpp::SequencedValuesContainer.
Definition at line 152 of file AbstractProbabilisticSequenceContainer.h.
References bpp::Commentable::setComments().
Referenced by bpp::VectorProbabilisticSiteContainer::addSequence(), bpp::Pasta::appendSequencesFromStream(), and bpp::VectorProbabilisticSiteContainer::createEmptyContainer().
|
pure virtualinherited |
Replace a probabilistic sequence in the container.
name | The name of the sequence in the map. |
sequence | The sequence to add. |
checkName | Tell if the container must check if the name of the sequence is already used in the container before adding it. |
Implemented in bpp::VectorProbabilisticSiteContainer.
|
pure virtualinherited |
Set all sequence names.
names | A vector of strings with all sequence names. Its size must be strictly equal to the the size of the container (the number of sequences). |
checkNames | Tell if the container must check if the name of the sequence is already used in the container before adding it. |
Exception | If there are redundant names in the input vector. |
Implemented in bpp::VectorSiteContainer, bpp::VectorSequenceContainer, bpp::VectorProbabilisticSiteContainer, bpp::VectorProbabilisticSequenceContainer, and bpp::CompressedVectorSiteContainer.
Referenced by bpp::SequenceContainerTools::createContainerWithSequenceNames(), bpp::SiteContainerTools::getCompleteSites(), and bpp::SiteContainerTools::getSitesWithoutGaps().
|
inlinevirtual |
Output to string.
Implements bpp::SequencedValuesContainer.
Definition at line 116 of file AbstractProbabilisticSequenceContainer.h.
References getSequence(), and bpp::CruxSymbolList::toString().
|
inherited |
Convert a particular sequence to a string.
sequenceIndex | The position of the sequence. |
IndexOutOfBoundsException | If the position does not match any sequence in the container. |
|
inlinevirtual |
Implements bpp::OrderedValuesContainer.
Definition at line 142 of file AbstractProbabilisticSequenceContainer.h.
References getSequence(), and bpp::CruxSymbolList::toString().
|
protectedinherited |
The container's alphabet.
Definition at line 64 of file AbstractValuesContainer.h.
Referenced by bpp::AbstractValuesContainer::getAlphabet(), bpp::AbstractValuesContainer::operator=(), and bpp::AbstractSequenceContainer::operator=().
|
protectedinherited |
Definition at line 63 of file Commentable.h.
Referenced by bpp::Commentable::clearComments(), bpp::Commentable::getComments(), bpp::Commentable::operator=(), and bpp::Commentable::setComments().