bpp-phyl3  3.0.0
bpp::BppOFrequencySetFormat Class Reference

Frequencies set I/O in BppO format. More...

#include <Bpp/Phyl/Io/BppOFrequencySetFormat.h>

+ Inheritance diagram for bpp::BppOFrequencySetFormat:
+ Collaboration diagram for bpp::BppOFrequencySetFormat:

Public Member Functions

 BppOFrequencySetFormat (unsigned char alphabetCode, bool verbose, int warn)
 
 BppOFrequencySetFormat (const BppOFrequencySetFormat &format)
 
BppOFrequencySetFormatoperator= (const BppOFrequencySetFormat &format)
 
virtual ~BppOFrequencySetFormat ()
 
const std::string getFormatName () const override
 
const std::string getFormatDescription () const override
 
void setGeneticCode (std::shared_ptr< const GeneticCode > gCode)
 Set the genetic code to use in case a codon frequencies set should be built. More...
 
std::unique_ptr< FrequencySetInterfacereadFrequencySet (std::shared_ptr< const Alphabet > alphabet, const std::string &freqDescription, const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &mData, size_t nData, bool parseArguments=true) override
 Read a frequencies set from a string. More...
 
const std::map< std::string, std::string > & getUnparsedArguments () const override
 
void writeFrequencySet (const FrequencySetInterface &freqset, OutputStream &out, std::map< std::string, std::string > &globalAliases, std::vector< std::string > &writtenNames) const override
 Write a substitution model to a stream. More...
 
void setVerbose (bool verbose)
 
virtual const std::string getDataType () const
 

Static Public Attributes

static unsigned char DNA = 1
 
static unsigned char RNA = 2
 
static unsigned char NUCLEOTIDE = 1 | 2
 
static unsigned char PROTEIN = 4
 
static unsigned char CODON = 8
 
static unsigned char WORD = 16
 
static unsigned char ALL = 1 | 2 | 4 | 8 | 16
 

Private Member Functions

void initialize_ (FrequencySetInterface &freqSet, std::shared_ptr< const AlignmentDataInterface > data)
 

Private Attributes

unsigned char alphabetCode_
 
bool verbose_
 
std::map< std::string, std::string > unparsedArguments_
 
std::shared_ptr< const GeneticCodegeneticCode_
 
int warningLevel_
 

Detailed Description

Frequencies set I/O in BppO format.

Allow to create a new frequencies set object according to model description syntax (see the Bio++ Program Suite manual for a detailed description of this syntax).

Definition at line 22 of file BppOFrequencySetFormat.h.

Constructor & Destructor Documentation

◆ BppOFrequencySetFormat() [1/2]

bpp::BppOFrequencySetFormat::BppOFrequencySetFormat ( unsigned char  alphabetCode,
bool  verbose,
int  warn 
)
inline

Definition at line 43 of file BppOFrequencySetFormat.h.

◆ BppOFrequencySetFormat() [2/2]

bpp::BppOFrequencySetFormat::BppOFrequencySetFormat ( const BppOFrequencySetFormat format)
inline

Definition at line 51 of file BppOFrequencySetFormat.h.

◆ ~BppOFrequencySetFormat()

virtual bpp::BppOFrequencySetFormat::~BppOFrequencySetFormat ( )
inlinevirtual

Definition at line 69 of file BppOFrequencySetFormat.h.

Member Function Documentation

◆ getDataType()

virtual const std::string bpp::IoFrequencySet::getDataType ( ) const
inlinevirtualinherited

Implements bpp::IOFormat.

Definition at line 32 of file IoFrequencySet.h.

◆ getFormatDescription()

const std::string bpp::BppOFrequencySetFormat::getFormatDescription ( ) const
inlineoverridevirtual

Implements bpp::IOFormat.

Definition at line 74 of file BppOFrequencySetFormat.h.

◆ getFormatName()

const std::string bpp::BppOFrequencySetFormat::getFormatName ( ) const
inlineoverridevirtual

Implements bpp::IOFormat.

Definition at line 72 of file BppOFrequencySetFormat.h.

◆ getUnparsedArguments()

const std::map<std::string, std::string>& bpp::BppOFrequencySetFormat::getUnparsedArguments ( ) const
inlineoverridevirtual

◆ initialize_()

◆ operator=()

BppOFrequencySetFormat& bpp::BppOFrequencySetFormat::operator= ( const BppOFrequencySetFormat format)
inline

◆ readFrequencySet()

std::unique_ptr< FrequencySetInterface > BppOFrequencySetFormat::readFrequencySet ( std::shared_ptr< const Alphabet alphabet,
const std::string &  freqDescription,
const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &  mData,
size_t  nData,
bool  parseArguments = true 
)
overridevirtual

Read a frequencies set from a string.

Parameters
alphabetThe alphabet to use in the model.
freqDescriptionA string describing the frequencies set.
mDataA map towards pointers of SiteContainer with the data to use to initialize frequency parameters
nDataNumber of the SiteContainer in the mData. Can be set to 0, if none assigned.
parseArgumentsAttempt to parse function arguments. If not, only store them and use default values instead.
Returns
A new FrequencySet object according to options specified.
Exceptions
Exceptionif an error occurred.

Implements bpp::IFrequencySet.

Definition at line 44 of file BppOFrequencySetFormat.cpp.

References bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::displayWarning(), bpp::CodonFrequencySetInterface::F0, bpp::CodonFrequencySetInterface::F1X4, bpp::CodonFrequencySetInterface::F3X4, bpp::CodonFrequencySetInterface::F61, bpp::CodonFrequencySetInterface::getFrequencySetForCodons(), getUnparsedArguments(), bpp::BppOSubstitutionModelFormat::getUnparsedArguments(), bpp::AlphabetTools::isCodonAlphabet(), bpp::TextTools::isDecimalInteger(), bpp::TextTools::isEmpty(), bpp::AlphabetTools::isNucleicAlphabet(), bpp::AlphabetTools::isProteicAlphabet(), bpp::AlphabetTools::isWordAlphabet(), bpp::KeyvalTools::parseProcedure(), readFrequencySet(), bpp::BppOTransitionModelFormat::readTransitionModel(), bpp::BppOSubstitutionModelFormat::setGeneticCode(), bpp::ParameterList::size(), bpp::TextTools::toInt(), and bpp::TextTools::toString().

Referenced by bpp::PhylogeneticsApplicationTools::getFrequencySet(), bpp::PhylogeneticsApplicationTools::getRootFrequencySets(), readFrequencySet(), bpp::BppOSubstitutionModelFormat::readSubstitutionModel(), bpp::BppOTransitionModelFormat::readTransitionModel(), and bpp::BppOSubstitutionModelFormat::readWord_().

◆ setGeneticCode()

void bpp::BppOFrequencySetFormat::setGeneticCode ( std::shared_ptr< const GeneticCode gCode)
inline

◆ setVerbose()

void bpp::BppOFrequencySetFormat::setVerbose ( bool  verbose)
inline

Definition at line 104 of file BppOFrequencySetFormat.h.

References verbose_.

◆ writeFrequencySet()

void BppOFrequencySetFormat::writeFrequencySet ( const FrequencySetInterface pfreqset,
OutputStream out,
std::map< std::string, std::string > &  globalAliases,
std::vector< std::string > &  writtenNames 
) const
overridevirtual

Member Data Documentation

◆ ALL

◆ alphabetCode_

unsigned char bpp::BppOFrequencySetFormat::alphabetCode_
private

Definition at line 36 of file BppOFrequencySetFormat.h.

Referenced by operator=().

◆ CODON

unsigned char BppOFrequencySetFormat::CODON = 8
static

Definition at line 31 of file BppOFrequencySetFormat.h.

◆ DNA

unsigned char BppOFrequencySetFormat::DNA = 1
static

Definition at line 27 of file BppOFrequencySetFormat.h.

◆ geneticCode_

std::shared_ptr<const GeneticCode> bpp::BppOFrequencySetFormat::geneticCode_
private

Definition at line 39 of file BppOFrequencySetFormat.h.

Referenced by operator=(), and setGeneticCode().

◆ NUCLEOTIDE

unsigned char BppOFrequencySetFormat::NUCLEOTIDE = 1 | 2
static

Definition at line 29 of file BppOFrequencySetFormat.h.

◆ PROTEIN

unsigned char BppOFrequencySetFormat::PROTEIN = 4
static

Definition at line 30 of file BppOFrequencySetFormat.h.

◆ RNA

unsigned char BppOFrequencySetFormat::RNA = 2
static

Definition at line 28 of file BppOFrequencySetFormat.h.

◆ unparsedArguments_

std::map<std::string, std::string> bpp::BppOFrequencySetFormat::unparsedArguments_
private

Definition at line 38 of file BppOFrequencySetFormat.h.

Referenced by getUnparsedArguments(), and operator=().

◆ verbose_

bool bpp::BppOFrequencySetFormat::verbose_
private

Definition at line 37 of file BppOFrequencySetFormat.h.

Referenced by operator=(), and setVerbose().

◆ warningLevel_

int bpp::BppOFrequencySetFormat::warningLevel_
private

Definition at line 40 of file BppOFrequencySetFormat.h.

Referenced by operator=().

◆ WORD

unsigned char BppOFrequencySetFormat::WORD = 16
static

Definition at line 32 of file BppOFrequencySetFormat.h.


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