bpp-popgen3  3.0.0
bpp::PolymorphismSequenceContainer Class Referenceabstract

The PolymorphismSequenceContainer class. More...

#include <Bpp/PopGen/PolymorphismSequenceContainer.h>

+ Inheritance diagram for bpp::PolymorphismSequenceContainer:
+ Collaboration diagram for bpp::PolymorphismSequenceContainer:

Public Member Functions

 PolymorphismSequenceContainer (std::shared_ptr< const Alphabet > alpha)
 Build a new empty PolymorphismSequenceContainer. More...
 
 PolymorphismSequenceContainer (size_t size, std::shared_ptr< const Alphabet > alpha)
 Build a new empty PolymorphismSequenceContainer of given size. More...
 
 PolymorphismSequenceContainer (const std::vector< std::string > &names, std::shared_ptr< const Alphabet > alpha)
 Build a new empty PolymorphismSequenceContainer with given sequence names. More...
 
 PolymorphismSequenceContainer (const SequenceContainerInterface &sc)
 Build a PolymorphismSequenceContainer by copying data from a SequenceContainer. More...
 
 PolymorphismSequenceContainer (const SequenceContainerInterface &sc, bool count)
 Build a PolymorphismSequenceContainer by copying data from a SequenceContainer. More...
 
 PolymorphismSequenceContainer (const PolymorphismSequenceContainer &psc)
 Copy constructor. More...
 
PolymorphismSequenceContaineroperator= (const PolymorphismSequenceContainer &psc)
 Operator= : copy operator. More...
 
virtual ~PolymorphismSequenceContainer ()
 Destroy a PolymorphismSequenceContainer. More...
 
PolymorphismSequenceContainerclone () const override
 Clone a PolymorphismSequenceContainer. More...
 
std::unique_ptr< SequenceremoveSequence (size_t sequencePosition) override
 
std::unique_ptr< SequenceremoveSequence (const std::string &sequenceKey) override
 
void deleteSequence (size_t sequencePosition) override
 
void deleteSequence (const std::string &sequenceKey) override
 
void addSequenceWithFrequency (const std::string &sequenceKey, std::unique_ptr< Sequence > &sequence, unsigned int frequency)
 Add a sequence to the container. More...
 
void insertSequenceWithFrequency (size_t sequencePosition, std::unique_ptr< Sequence > &sequence, const std::string &sequenceKey, unsigned int frequency)
 
void addSequence (const std::string &sequenceKey, std::unique_ptr< Sequence > &sequence) override
 
void insertSequence (size_t sequencePosition, std::unique_ptr< Sequence > &sequence, const std::string &sequenceKey) override
 
void clear () override
 Clear the container of all its sequences. More...
 
size_t getGroupId (size_t index) const
 Get the group identifier of the sequence. More...
 
size_t getGroupId (const std::string &name) const
 Get the group identifier of a sequence. More...
 
std::set< size_t > getAllGroupsIds () const
 Get all the groups identifiers. More...
 
void setGroupId (size_t index, size_t group_id)
 Set the group identifier of a sequence. More...
 
void setGroupId (const std::string &name, size_t group_id)
 Set the group identifier of a sequence. More...
 
size_t getNumberOfGroups () const
 Get the number of groups. More...
 
bool hasOutgroup () const
 
bool isIngroupMember (size_t index) const
 Tell if the sequence is ingroup by index. More...
 
bool isIngroupMember (const std::string &name) const
 Tell if a sequence is ingroup by name. More...
 
void setAsIngroupMember (size_t index)
 Set a sequence as ingroup member by index. More...
 
void setAsIngroupMember (const std::string &name)
 Set a sequence as ingroup member by name. More...
 
void setAsOutgroupMember (size_t index)
 Set a sequence as outgroup member by index. More...
 
void setAsOutgroupMember (const std::string &name)
 Set a sequence as outgroup member by name. More...
 
void setSequenceCount (size_t index, unsigned int count)
 Set the count of a sequence by index. More...
 
void setSequenceCount (const std::string &name, unsigned int count)
 Set the count of a sequence by name. More...
 
void incrementSequenceCount (size_t index)
 Add 1 to the sequence count. More...
 
void incrementSequenceCount (const std::string &name)
 Add 1 to the sequence count. More...
 
void decrementSequenceCount (size_t index)
 Removz 1 to the sequence count. More...
 
void decrementSequenceCount (const std::string &name)
 Remove 1 to the sequence count. More...
 
unsigned int getSequenceCount (size_t index) const
 Get the count of a sequence by index. More...
 
unsigned int getSequenceCount (const std::string &name) const
 Get the count of a sequence by name. More...
 
std::unique_ptr< SiteContainerInterfacetoSiteContainer () const
 convert the container to a site container, with sequences dulicated according to their respective frequencies. More...
 
const Alphabetalphabet () const override
 
std::shared_ptr< const AlphabetgetAlphabet () const override
 
virtual const CommentsgetComments () const=0
 
const CommentsgetComments () const override
 
virtual void setComments (const Comments &comments)=0
 
void setComments (const Comments &comments) override
 
virtual void clearComments ()=0
 
void clearComments () override
 
const SiteType & site (size_t sitePosition) const override
 
const SiteType & site (size_t sitePosition) const override
 
void setSite (size_t sitePosition, std::unique_ptr< SiteType > &site, bool checkCoordinate=true) override
 
void setSite (size_t sitePosition, std::unique_ptr< SiteType > &site, bool checkCoordinate=true) override
 
std::unique_ptr< SiteType > removeSite (size_t sitePosition) override
 
std::unique_ptr< SiteType > removeSite (size_t sitePosition) override
 
void deleteSite (size_t sitePosition) override
 
void deleteSite (size_t sitePosition) override
 
void addSite (std::unique_ptr< SiteType > &site, bool checkCoordinate=true) override
 
void addSite (std::unique_ptr< SiteType > &site, size_t sitePosition, bool checkCoordinate=true) override
 
void addSite (std::unique_ptr< SiteType > &site, bool checkCoordinate=true) override
 
void addSite (std::unique_ptr< SiteType > &site, size_t sitePosition, bool checkCoordinate=true) override
 
void deleteSites (size_t sitePosition, size_t length) override
 
void deleteSites (size_t sitePosition, size_t length) override
 
size_t getNumberOfSites () const override
 
size_t getNumberOfSites () const override
 
void reindexSites () override
 
void reindexSites () override
 
Vint getSiteCoordinates () const override
 
Vint getSiteCoordinates () const override
 
void setSiteCoordinates (const Vint &vCoordinates) override
 
void setSiteCoordinates (const Vint &vCoordinates) override
 
bool hasSequence (const std::string &sequenceKey) const override
 
bool hasSequence (const std::string &sequenceKey) const override
 
size_t getSequencePosition (const std::string &sequenceKey) const override
 
size_t getSequencePosition (const std::string &sequenceKey) const override
 
const SequenceType & sequence (const std::string &sequenceKey) const override
 
const SequenceType & sequence (size_t sequencePosition) const override
 
const SequenceType & sequence (const std::string &sequenceKey) const override
 
const SequenceType & sequence (size_t sequencePosition) const override
 
size_t getNumberOfSequences () const override
 
size_t getNumberOfSequences () const override
 
std::vector< std::string > getSequenceKeys () const override
 
std::vector< std::string > getSequenceKeys () const override
 
void setSequenceKeys (const std::vector< std::string > &sequenceKeys) override
 
void setSequenceKeys (const std::vector< std::string > &sequenceKeys) override
 
const std::string & sequenceKey (size_t sequencePosition) const override
 
const std::string & sequenceKey (size_t sequencePosition) const override
 
std::vector< std::string > getSequenceNames () const override
 
std::vector< std::string > getSequenceNames () const override
 
void setSequenceNames (const std::vector< std::string > &names, bool updateKeys) override
 
void setSequenceNames (const std::vector< std::string > &names, bool updateKeys) override
 
std::vector< CommentsgetSequenceComments () const override
 
std::vector< CommentsgetSequenceComments () const override
 
TemplateVectorSiteContainer< SiteType, SequenceType > * createEmptyContainer () const override
 
TemplateVectorSiteContainer< SiteType, SequenceType > * createEmptyContainer () const override
 
const SequenceType::ElementType & valueAt (const std::string &sequenceKey, size_t sitePosition) const override
 
SequenceType::ElementType & valueAt (const std::string &sequenceKey, size_t sitePosition) override
 
const SequenceType::ElementType & valueAt (size_t sequencePosition, size_t sitePosition) const override
 
SequenceType::ElementType & valueAt (size_t sequencePosition, size_t sitePosition) override
 
const SequenceType::ElementType & valueAt (const std::string &sequenceKey, size_t sitePosition) const override
 
SequenceType::ElementType & valueAt (const std::string &sequenceKey, size_t sitePosition) override
 
const SequenceType::ElementType & valueAt (size_t sequencePosition, size_t sitePosition) const override
 
SequenceType::ElementType & valueAt (size_t sequencePosition, size_t sitePosition) override
 
double getStateValueAt (size_t sitePosition, const std::string &sequenceKey, int state) const override
 
double getStateValueAt (size_t sitePosition, size_t sequencePosition, int state) const override
 
double getStateValueAt (size_t sitePosition, const std::string &sequenceKey, int state) const override
 
double getStateValueAt (size_t sitePosition, size_t sequencePosition, int state) const override
 
double operator() (size_t sitePosition, const std::string &sequenceKey, int state) const override
 
double operator() (size_t sitePosition, size_t sequencePosition, int state) const override
 
double operator() (size_t sitePosition, const std::string &sequenceKey, int state) const override
 
double operator() (size_t sitePosition, size_t sequencePosition, int state) const override
 
void setSequence (const std::string &sequenceKey, std::unique_ptr< SequenceType > &sequence) override
 
void setSequence (size_t sequencePosition, std::unique_ptr< SequenceType > &sequence) override
 
void setSequence (size_t sequencePosition, std::unique_ptr< SequenceType > &sequence, const std::string &sequenceKey) override
 
void setSequence (const std::string &sequenceKey, std::unique_ptr< SequenceType > &sequence) override
 
void setSequence (size_t sequencePosition, std::unique_ptr< SequenceType > &sequence) override
 
void setSequence (size_t sequencePosition, std::unique_ptr< SequenceType > &sequence, const std::string &sequenceKey) override
 
void addSequence (const std::string &sequenceKey, std::unique_ptr< SequenceType > &sequence) override
 
void insertSequence (size_t sequencePosition, std::unique_ptr< SequenceType > &sequence, const std::string &sequenceKey) override
 

Protected Member Functions

SiteType & site_ (size_t sitePosition)
 
void realloc_ (size_t n)
 

Protected Attributes

VectorPositionedContainer< SiteType > siteContainer_
 
VectorMappedContainer< SequenceType > sequenceContainer_
 
std::vector< std::string > sequenceNames_
 
std::vector< CommentssequenceComments_
 
std::shared_ptr< const Alphabetalphabet_
 
Comments comments_
 

Private Attributes

std::vector< bool > ingroup_
 
std::vector< unsigned int > count_
 
std::vector< size_t > group_
 

Detailed Description

The PolymorphismSequenceContainer class.

This is a VectorSiteContainer with effectif for each sequence. It also has flag for ingroup and outgroup.

Author
Sylvain Gaillard

Definition at line 66 of file PolymorphismSequenceContainer.h.

Constructor & Destructor Documentation

◆ PolymorphismSequenceContainer() [1/6]

bpp::PolymorphismSequenceContainer::PolymorphismSequenceContainer ( std::shared_ptr< const Alphabet alpha)
inline

Build a new empty PolymorphismSequenceContainer.

Definition at line 79 of file PolymorphismSequenceContainer.h.

Referenced by clone().

◆ PolymorphismSequenceContainer() [2/6]

bpp::PolymorphismSequenceContainer::PolymorphismSequenceContainer ( size_t  size,
std::shared_ptr< const Alphabet alpha 
)
inline

Build a new empty PolymorphismSequenceContainer of given size.

Definition at line 89 of file PolymorphismSequenceContainer.h.

◆ PolymorphismSequenceContainer() [3/6]

bpp::PolymorphismSequenceContainer::PolymorphismSequenceContainer ( const std::vector< std::string > &  names,
std::shared_ptr< const Alphabet alpha 
)
inline

Build a new empty PolymorphismSequenceContainer with given sequence names.

Definition at line 99 of file PolymorphismSequenceContainer.h.

◆ PolymorphismSequenceContainer() [4/6]

bpp::PolymorphismSequenceContainer::PolymorphismSequenceContainer ( const SequenceContainerInterface sc)
inline

Build a PolymorphismSequenceContainer by copying data from a SequenceContainer.

Parameters
scSequence container to convert.

Definition at line 111 of file PolymorphismSequenceContainer.h.

◆ PolymorphismSequenceContainer() [5/6]

PolymorphismSequenceContainer::PolymorphismSequenceContainer ( const SequenceContainerInterface sc,
bool  count 
)

Build a PolymorphismSequenceContainer by copying data from a SequenceContainer.

Note
In case of count = false, the constructor without additional argument will be more efficient.
Parameters
scSequence container to convert.
countTell if identical sequences should be collapsed and counted. If not (the historical behavior), sequences are duplicated and stored with a frequency of 1.

Definition at line 14 of file PolymorphismSequenceContainer.cpp.

References addSequenceWithFrequency(), bpp::SequenceTools::areSequencesIdentical(), bpp::Sequence::clone(), bpp::TemplateSequenceContainerInterface< class, class >::getNumberOfSequences(), bpp::TemplateVectorSiteContainer< class, class >::getNumberOfSequences(), group_, incrementSequenceCount(), ingroup_, bpp::TemplateSequenceContainerInterface< class, class >::sequence(), and bpp::TemplateVectorSiteContainer< class, class >::sequence().

◆ PolymorphismSequenceContainer() [6/6]

PolymorphismSequenceContainer::PolymorphismSequenceContainer ( const PolymorphismSequenceContainer psc)

◆ ~PolymorphismSequenceContainer()

PolymorphismSequenceContainer::~PolymorphismSequenceContainer ( )
virtual

Destroy a PolymorphismSequenceContainer.

Class destructor:

Definition at line 88 of file PolymorphismSequenceContainer.cpp.

References clear().

Member Function Documentation

◆ addSequence()

void bpp::PolymorphismSequenceContainer::addSequence ( const std::string &  sequenceKey,
std::unique_ptr< Sequence > &  sequence 
)
inlineoverride

◆ addSequenceWithFrequency()

void bpp::PolymorphismSequenceContainer::addSequenceWithFrequency ( const std::string &  sequenceKey,
std::unique_ptr< Sequence > &  sequence,
unsigned int  frequency 
)
inline

Add a sequence to the container.

Exceptions
AlphabetMismatchExceptionif the sequence's alphabet doesn't match the container's alphabet.
SequenceExceptionif the sequence's size doesn't match the sequence's size of the container.
SequenceExceptionif the sequence's name already exists in the container.

Definition at line 169 of file PolymorphismSequenceContainer.h.

References bpp::TemplateVectorSiteContainer< class, class >::addSequence(), count_, group_, ingroup_, bpp::TemplateVectorSiteContainer< class, class >::sequence(), and bpp::TemplateVectorSiteContainer< class, class >::sequenceKey().

Referenced by addSequence(), and PolymorphismSequenceContainer().

◆ clear()

void bpp::PolymorphismSequenceContainer::clear ( )
inlineoverridevirtual

Clear the container of all its sequences.

Reimplemented from bpp::TemplateVectorSiteContainer< class, class >.

Definition at line 208 of file PolymorphismSequenceContainer.h.

References bpp::TemplateVectorSiteContainer< class, class >::clear(), count_, group_, and ingroup_.

Referenced by ~PolymorphismSequenceContainer().

◆ clone()

PolymorphismSequenceContainer* bpp::PolymorphismSequenceContainer::clone ( ) const
inlineoverridevirtual

◆ decrementSequenceCount() [1/2]

void PolymorphismSequenceContainer::decrementSequenceCount ( const std::string &  name)

Remove 1 to the sequence count.

Exceptions
SequenceNotFoundExceptionif name is not found among the sequences' names.
BadIntegerExceptionif count < 1 ... use deleteSequence instead of setting the count to 0.

Definition at line 286 of file PolymorphismSequenceContainer.cpp.

References decrementSequenceCount(), and bpp::TemplateVectorSiteContainer< class, class >::getSequencePosition().

◆ decrementSequenceCount() [2/2]

void PolymorphismSequenceContainer::decrementSequenceCount ( size_t  index)

Removz 1 to the sequence count.

Exceptions
IndexOutOfBoundsExceptionif index exceeds the number of sequences in the container.
BadIntegerExceptionif count < 1 ... use deleteSequence instead of setting the count to 0.

Definition at line 275 of file PolymorphismSequenceContainer.cpp.

References count_, and bpp::TemplateVectorSiteContainer< class, class >::getNumberOfSequences().

Referenced by decrementSequenceCount().

◆ deleteSequence() [1/2]

void PolymorphismSequenceContainer::deleteSequence ( const std::string &  sequenceKey)
overridevirtual

◆ deleteSequence() [2/2]

void PolymorphismSequenceContainer::deleteSequence ( size_t  sequencePosition)
overridevirtual

◆ getAllGroupsIds()

std::set< size_t > PolymorphismSequenceContainer::getAllGroupsIds ( ) const

Get all the groups identifiers.

Definition at line 151 of file PolymorphismSequenceContainer.cpp.

References group_.

Referenced by bpp::DataSetTools::buildDataSet(), and getNumberOfGroups().

◆ getGroupId() [1/2]

size_t bpp::PolymorphismSequenceContainer::getGroupId ( const std::string &  name) const
inline

Get the group identifier of a sequence.

Exceptions
SequenceNotFoundExceptionif name is not found among the sequences' names.

Definition at line 233 of file PolymorphismSequenceContainer.h.

References bpp::TemplateVectorSiteContainer< class, class >::getSequencePosition(), and group_.

◆ getGroupId() [2/2]

◆ getNumberOfGroups()

size_t bpp::PolymorphismSequenceContainer::getNumberOfGroups ( ) const
inline

Get the number of groups.

Definition at line 283 of file PolymorphismSequenceContainer.h.

References getAllGroupsIds().

◆ getSequenceCount() [1/2]

unsigned int PolymorphismSequenceContainer::getSequenceCount ( const std::string &  name) const

Get the count of a sequence by name.

Exceptions
SequenceNotFoundExceptionif name is not found among the sequences' names.

Definition at line 313 of file PolymorphismSequenceContainer.cpp.

References getSequenceCount(), and bpp::TemplateVectorSiteContainer< class, class >::getSequencePosition().

◆ getSequenceCount() [2/2]

◆ hasOutgroup()

bool PolymorphismSequenceContainer::hasOutgroup ( ) const
Returns
True is the container contains at least one outgroup sequence.

Definition at line 163 of file PolymorphismSequenceContainer.cpp.

References ingroup_.

◆ incrementSequenceCount() [1/2]

void PolymorphismSequenceContainer::incrementSequenceCount ( const std::string &  name)

Add 1 to the sequence count.

Exceptions
SequenceNotFoundExceptionif name is not found among the sequences' names.

Definition at line 261 of file PolymorphismSequenceContainer.cpp.

References bpp::TemplateVectorSiteContainer< class, class >::getSequencePosition(), and incrementSequenceCount().

◆ incrementSequenceCount() [2/2]

void PolymorphismSequenceContainer::incrementSequenceCount ( size_t  index)

Add 1 to the sequence count.

Exceptions
IndexOutOfBoundsExceptionif index exceeds the number of sequences in the container.

Definition at line 252 of file PolymorphismSequenceContainer.cpp.

References count_, and bpp::TemplateVectorSiteContainer< class, class >::getNumberOfSequences().

Referenced by incrementSequenceCount(), and PolymorphismSequenceContainer().

◆ insertSequence()

void bpp::PolymorphismSequenceContainer::insertSequence ( size_t  sequencePosition,
std::unique_ptr< Sequence > &  sequence,
const std::string &  sequenceKey 
)
inlineoverride

◆ insertSequenceWithFrequency()

void bpp::PolymorphismSequenceContainer::insertSequenceWithFrequency ( size_t  sequencePosition,
std::unique_ptr< Sequence > &  sequence,
const std::string &  sequenceKey,
unsigned int  frequency 
)
inline

◆ isIngroupMember() [1/2]

bool bpp::PolymorphismSequenceContainer::isIngroupMember ( const std::string &  name) const
inline

Tell if a sequence is ingroup by name.

Exceptions
SequenceNotFoundExceptionif name is not found among the sequences' names.

Definition at line 310 of file PolymorphismSequenceContainer.h.

References bpp::TemplateVectorSiteContainer< class, class >::getSequencePosition(), and ingroup_.

◆ isIngroupMember() [2/2]

◆ operator=()

◆ removeSequence() [1/2]

std::unique_ptr< Sequence > PolymorphismSequenceContainer::removeSequence ( const std::string &  sequenceKey)
overridevirtual

◆ removeSequence() [2/2]

std::unique_ptr< Sequence > PolymorphismSequenceContainer::removeSequence ( size_t  sequencePosition)
overridevirtual

◆ setAsIngroupMember() [1/2]

void PolymorphismSequenceContainer::setAsIngroupMember ( const std::string &  name)

Set a sequence as ingroup member by name.

Exceptions
SequenceNotFoundExceptionif name is not found among the sequences' names.

Definition at line 184 of file PolymorphismSequenceContainer.cpp.

References bpp::TemplateVectorSiteContainer< class, class >::getSequencePosition(), and ingroup_.

◆ setAsIngroupMember() [2/2]

void PolymorphismSequenceContainer::setAsIngroupMember ( size_t  index)

Set a sequence as ingroup member by index.

Exceptions
IndexOutOfBoundsExceptionif index exceeds the number of sequences in the container.

Definition at line 175 of file PolymorphismSequenceContainer.cpp.

References bpp::TemplateVectorSiteContainer< class, class >::getNumberOfSequences(), and ingroup_.

◆ setAsOutgroupMember() [1/2]

void PolymorphismSequenceContainer::setAsOutgroupMember ( const std::string &  name)

Set a sequence as outgroup member by name.

Exceptions
SequenceNotFoundExceptionif name is not found among the sequences' names.

Definition at line 208 of file PolymorphismSequenceContainer.cpp.

References bpp::TemplateVectorSiteContainer< class, class >::getSequencePosition(), and ingroup_.

◆ setAsOutgroupMember() [2/2]

void PolymorphismSequenceContainer::setAsOutgroupMember ( size_t  index)

Set a sequence as outgroup member by index.

Exceptions
IndexOutOfBoundsExceptionif index exceeds the number of sequences in the container.

Definition at line 199 of file PolymorphismSequenceContainer.cpp.

References bpp::TemplateVectorSiteContainer< class, class >::getNumberOfSequences(), and ingroup_.

Referenced by bpp::SequenceStatistics::mkTable().

◆ setGroupId() [1/2]

void bpp::PolymorphismSequenceContainer::setGroupId ( const std::string &  name,
size_t  group_id 
)
inline

Set the group identifier of a sequence.

Exceptions
SequenceNotFoundExceptionif name is not found among the sequences' names.

Definition at line 268 of file PolymorphismSequenceContainer.h.

References bpp::TemplateVectorSiteContainer< class, class >::getSequencePosition(), and group_.

◆ setGroupId() [2/2]

void bpp::PolymorphismSequenceContainer::setGroupId ( size_t  index,
size_t  group_id 
)
inline

Set the group identifier of a sequence.

Exceptions
IndexOutOfBoundsExceptionif index exceeds the number of sequences in the container.

Definition at line 256 of file PolymorphismSequenceContainer.h.

References bpp::TemplateVectorSiteContainer< class, class >::getNumberOfSequences(), and group_.

◆ setSequenceCount() [1/2]

void PolymorphismSequenceContainer::setSequenceCount ( const std::string &  name,
unsigned int  count 
)

Set the count of a sequence by name.

Exceptions
throwSequenceNotFoundException if name is not found among the sequences' names.
BadIntegerExceptionif count < 1 ... use deleteSequence instead of setting the count to 0.

Definition at line 234 of file PolymorphismSequenceContainer.cpp.

References count(), bpp::TemplateVectorSiteContainer< class, class >::getSequencePosition(), and setSequenceCount().

◆ setSequenceCount() [2/2]

void PolymorphismSequenceContainer::setSequenceCount ( size_t  index,
unsigned int  count 
)

Set the count of a sequence by index.

Exceptions
IndexOutOfBoundsExceptionif index exceeds the number of sequences in the container.
BadIntegerExceptionif count < 1 ... use deleteSequence instead of setting the count to 0.

Definition at line 223 of file PolymorphismSequenceContainer.cpp.

References count(), count_, and bpp::TemplateVectorSiteContainer< class, class >::getNumberOfSequences().

Referenced by setSequenceCount().

◆ toSiteContainer()

unique_ptr< SiteContainerInterface > PolymorphismSequenceContainer::toSiteContainer ( ) const

convert the container to a site container, with sequences dulicated according to their respective frequencies.

Returns
A SiteContainer object, eventually with duplicated sequences. Names of duplicated sequences are happened with _1, _2, etc.

Definition at line 327 of file PolymorphismSequenceContainer.cpp.

References bpp::TemplateVectorSiteContainer< class, class >::getAlphabet(), bpp::TemplateVectorSiteContainer< class, class >::getNumberOfSequences(), getSequenceCount(), bpp::TemplateVectorSiteContainer< class, class >::getSiteCoordinates(), bpp::TemplateVectorSiteContainer< class, class >::sequence(), and bpp::TextTools::toString().

Member Data Documentation

◆ count_

◆ group_

std::vector<size_t> bpp::PolymorphismSequenceContainer::group_
private

◆ ingroup_


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