bpp-phyl3
3.0.0
|
Branch model I/O in BppO format. More...
#include <Bpp/Phyl/Io/BppOBranchModelFormat.h>
Public Member Functions | |
BppOBranchModelFormat (unsigned char alphabetCode, bool allowCovarions, bool allowMixed, bool allowGaps, bool verbose, int warn) | |
Create a new BppOBranchModelFormat object. More... | |
BppOBranchModelFormat (const BppOTransitionModelFormat &format) | |
BppOBranchModelFormat & | operator= (const BppOBranchModelFormat &format) |
std::unique_ptr< BranchModelInterface > | readBranchModel (std::shared_ptr< const Alphabet > alphabet, const std::string &modelDescription, const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &mData, size_t nData, bool parseArguments=true) |
std::unique_ptr< TransitionModelInterface > | readTransitionModel (std::shared_ptr< const Alphabet > alphabet, const std::string &modelDescription, const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &mData, size_t nData, bool parseArguments=true) |
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< SubstitutionModelInterface > | readSubstitutionModel (std::shared_ptr< const Alphabet > alphabet, const std::string &modelDescription, const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &mData, size_t nData, bool parseArguments=true) override |
Read a substitution model from a string. More... | |
const std::map< std::string, std::string > & | getUnparsedArguments () const override |
void | write (const BranchModelInterface &model, 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 | BINARY = 32 |
static unsigned char | INTEGER = 64 |
static unsigned char | ALL = 1 | 2 | 4 | 8 | 16 | 32 | 64 |
Protected Member Functions | |
void | updateParameters_ (BranchModelInterface &model, std::map< std::string, std::string > &args) |
Finish parsing of parameters, taking care of aliases. More... | |
void | initialize_ (BranchModelInterface &model, std::shared_ptr< const AlignmentDataInterface > data) |
Set parameter initial values of a given model according to options. More... | |
Protected Attributes | |
unsigned char | alphabetCode_ |
bool | allowCovarions_ |
bool | allowMixed_ |
bool | allowGaps_ |
bool | verbose_ |
std::map< std::string, std::string > | unparsedArguments_ |
std::shared_ptr< const GeneticCode > | geneticCode_ |
int | warningLevel_ |
Private Member Functions | |
std::unique_ptr< MixedTransitionModelInterface > | readMixed_ (std::shared_ptr< const Alphabet > alphabet, const std::string &modelDescription, const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &mData, size_t nData) |
std::unique_ptr< SubstitutionModelInterface > | readWord_ (std::shared_ptr< const Alphabet > alphabet, const std::string &modelDescription, const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &mData, size_t nData) |
void | writeMixed_ (const MixedTransitionModelInterface &model, OutputStream &out, std::map< std::string, std::string > &globalAliases, std::vector< std::string > &writtenNames) const |
Branch model I/O in BppO format.
Creates a new branch model object according to model description syntax (see the Bio++ Program Suite manual for a detailed description of this syntax).
Definition at line 21 of file BppOBranchModelFormat.h.
|
inline |
Create a new BppOBranchModelFormat object.
alphabetCode | Bit saying which alphabets are allowed in the model specification. |
allowCovarions | Tell is a covarion model can be returned. |
allowMixed | Tell is a mixture model can be returned. |
allowGaps | Tell is a gap model can be returned. |
verbose | Tell if the construction is verbose. |
warn | Set the warning level (0: always display warnings, >0 display warnings on demand). |
Definition at line 35 of file BppOBranchModelFormat.h.
|
inline |
Definition at line 39 of file BppOBranchModelFormat.h.
|
inlinevirtualinherited |
Implements bpp::IOFormat.
Definition at line 35 of file IoSubstitutionModel.h.
|
inlineoverridevirtualinherited |
Implements bpp::IOFormat.
Definition at line 100 of file BppOSubstitutionModelFormat.h.
|
inlineoverridevirtualinherited |
Implements bpp::IOFormat.
Definition at line 98 of file BppOSubstitutionModelFormat.h.
|
inlineoverridevirtualinherited |
Implements bpp::ISubstitutionModel.
Definition at line 119 of file BppOSubstitutionModelFormat.h.
References bpp::BppOSubstitutionModelFormat::unparsedArguments_.
Referenced by bpp::PhylogeneticsApplicationTools::getBranchModel(), bpp::PhylogeneticsApplicationTools::getBranchModels(), bpp::PhylogeneticsApplicationTools::getSubstitutionModel(), readBranchModel(), bpp::BppOFrequencySetFormat::readFrequencySet(), bpp::BppOTransitionModelFormat::readMixed_(), bpp::BppOSubstitutionModelFormat::readSubstitutionModel(), bpp::BppOTransitionModelFormat::readTransitionModel(), bpp::BppOSubstitutionModelFormat::readWord_(), and bpp::LegacyPhylogeneticsApplicationTools::setSubstitutionModelSet().
|
protectedinherited |
Set parameter initial values of a given model according to options.
Parameters actually depends on the model passed as argument. See getSubstitutionModel for more information.
This function is mainly for internal usage, you're probably looking for the getSubstitutionModel or getSubstitutionModelSet function.
model | The model to set. |
data | A pointer toward the AlignmentDataInterface for which the substitution model is designed. The alphabet associated to the data must be of the same type as the one specified for the model. May be equal to NULL, but in this case use_observed_freq option will be unavailable. |
Exception | if an error occurred. |
Definition at line 2000 of file BppOSubstitutionModelFormat.cpp.
References bpp::ApplicationTools::displayMessage(), bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::displayWarning(), bpp::ApplicationTools::getDoubleParameter(), bpp::ParameterAliasable::getIndependentParameters(), bpp::BranchModelInterface::getName(), bpp::ParameterAliasable::getNamespace(), bpp::ApplicationTools::getStringParameter(), bpp::StringTokenizer::hasMoreToken(), bpp::ParameterAliasable::matchParametersValues(), bpp::StringTokenizer::nextToken(), bpp::AutoParameter::setMessageHandler(), bpp::ParameterList::setParameter(), bpp::ParameterList::size(), bpp::TextTools::toDouble(), bpp::TextTools::toString(), and bpp::ApplicationTools::warning.
|
inline |
Definition at line 43 of file BppOBranchModelFormat.h.
References bpp::BppOTransitionModelFormat::operator=().
std::unique_ptr< BranchModelInterface > BppOBranchModelFormat::readBranchModel | ( | std::shared_ptr< const Alphabet > | alphabet, |
const std::string & | modelDescription, | ||
const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> & | mData, | ||
size_t | nData, | ||
bool | parseArguments = true |
||
) |
Definition at line 37 of file BppOBranchModelFormat.cpp.
References bpp::ApplicationTools::displayResult(), bpp::BppOSubstitutionModelFormat::getUnparsedArguments(), bpp::KeyvalTools::parseProcedure(), bpp::BppOTransitionModelFormat::readTransitionModel(), bpp::BppOSubstitutionModelFormat::setGeneticCode(), and bpp::TextTools::toString().
Referenced by bpp::PhylogeneticsApplicationTools::getBranchModel(), and bpp::PhylogeneticsApplicationTools::getBranchModels().
|
privateinherited |
Definition at line 284 of file BppOTransitionModelFormat.cpp.
References bpp::ApplicationTools::displayResult(), bpp::BppODiscreteDistributionFormat::getUnparsedArguments(), bpp::BppOSubstitutionModelFormat::getUnparsedArguments(), bpp::KeyvalTools::parseProcedure(), bpp::BppODiscreteDistributionFormat::readDiscreteDistribution(), bpp::BppOTransitionModelFormat::readTransitionModel(), bpp::BppOSubstitutionModelFormat::setGeneticCode(), and bpp::TextTools::toString().
|
overridevirtualinherited |
Read a substitution model from a string.
alphabet | The alphabet to use in the model. |
modelDescription | A string describing the model in the format. |
mData | A map towards pointers of SiteContainer with the data to use to initialize frequency parameters |
nData | Number of the SiteContainer in the mData. Can be set to 0, if none assigned. |
parseArguments | Attempt to parse function arguments. If not, only store them and use default values instead. |
Exception | if an error occurred. |
SIMPLE MODELS
Implements bpp::ISubstitutionModel.
Definition at line 118 of file BppOSubstitutionModelFormat.cpp.
References bpp::BppOFrequencySetFormat::ALL, bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::displayWarning(), bpp::ApplicationTools::getStringParameter(), bpp::PhylogeneticsApplicationTools::getSubstitutionRegister(), bpp::BppODiscreteDistributionFormat::getUnparsedArguments(), bpp::BppOFrequencySetFormat::getUnparsedArguments(), bpp::BppOSubstitutionModelFormat::getUnparsedArguments(), bpp::AlphabetTools::isBinaryAlphabet(), bpp::AlphabetTools::isCodonAlphabet(), bpp::TextTools::isEmpty(), bpp::AlphabetTools::isIntegerAlphabet(), bpp::AlphabetTools::isNucleicAlphabet(), bpp::AlphabetTools::isProteicAlphabet(), bpp::AlphabetTools::isRNYAlphabet(), bpp::KeyvalTools::parseProcedure(), bpp::BppORateDistributionFormat::readDiscreteDistribution(), bpp::BppOFrequencySetFormat::readFrequencySet(), bpp::BppOSubstitutionModelFormat::readSubstitutionModel(), bpp::BppOTransitionModelFormat::readTransitionModel(), bpp::BppOFrequencySetFormat::setGeneticCode(), bpp::BppOSubstitutionModelFormat::setGeneticCode(), bpp::TextTools::toInt(), and bpp::TextTools::toString().
Referenced by bpp::PhylogeneticsApplicationTools::getSubstitutionModel(), bpp::BppOSubstitutionModelFormat::readSubstitutionModel(), bpp::BppOTransitionModelFormat::readTransitionModel(), and bpp::BppOSubstitutionModelFormat::readWord_().
|
inherited |
Definition at line 57 of file BppOTransitionModelFormat.cpp.
References bpp::BppOFrequencySetFormat::ALL, bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::displayWarning(), bpp::ApplicationTools::getStringParameter(), bpp::PhylogeneticsApplicationTools::getSubstitutionRegister(), bpp::BppOFrequencySetFormat::getUnparsedArguments(), bpp::BppOSubstitutionModelFormat::getUnparsedArguments(), bpp::StringTokenizer::hasMoreToken(), bpp::AlphabetTools::isCodonAlphabet(), bpp::AlphabetTools::isProteicAlphabet(), bpp::StringTokenizer::nextToken(), bpp::KeyvalTools::parseProcedure(), bpp::BppOFrequencySetFormat::readFrequencySet(), bpp::BppOSubstitutionModelFormat::readSubstitutionModel(), bpp::BppOFrequencySetFormat::setGeneticCode(), and bpp::BppOSubstitutionModelFormat::setGeneticCode().
Referenced by readBranchModel(), bpp::BppOFrequencySetFormat::readFrequencySet(), bpp::BppOTransitionModelFormat::readMixed_(), bpp::BppOSubstitutionModelFormat::readSubstitutionModel(), and bpp::LegacyPhylogeneticsApplicationTools::setSubstitutionModelSet().
|
privateinherited |
Reading the submodels
Dist
Freq
Default name in none used before
Definition at line 985 of file BppOSubstitutionModelFormat.cpp.
References bpp::ApplicationTools::displayWarning(), bpp::SequenceApplicationTools::getAlphabetIndex2(), bpp::BppOFrequencySetFormat::getUnparsedArguments(), bpp::BppOSubstitutionModelFormat::getUnparsedArguments(), bpp::StringTokenizer::hasMoreToken(), bpp::AlphabetTools::isCodonAlphabet(), bpp::AlphabetTools::isWordAlphabet(), bpp::StringTokenizer::nextToken(), bpp::KeyvalTools::parseProcedure(), bpp::AlphabetTools::PROTEIN_ALPHABET, bpp::BppOFrequencySetFormat::readFrequencySet(), bpp::BppOSubstitutionModelFormat::readSubstitutionModel(), bpp::BppOFrequencySetFormat::setGeneticCode(), bpp::TextTools::toInt(), and bpp::TextTools::toString().
|
inlineinherited |
Set the genetic code to use in case a codon frequencies set should be built.
gCode | The genetic code to use. |
Definition at line 107 of file BppOSubstitutionModelFormat.h.
References bpp::BppOSubstitutionModelFormat::geneticCode_.
Referenced by bpp::PhylogeneticsApplicationTools::getBranchModel(), bpp::PhylogeneticsApplicationTools::getBranchModels(), bpp::PhylogeneticsApplicationTools::getSubstitutionModel(), readBranchModel(), bpp::BppOFrequencySetFormat::readFrequencySet(), bpp::BppOTransitionModelFormat::readMixed_(), bpp::BppOSubstitutionModelFormat::readSubstitutionModel(), bpp::BppOTransitionModelFormat::readTransitionModel(), and bpp::LegacyPhylogeneticsApplicationTools::setSubstitutionModelSet().
|
inlineinherited |
Definition at line 140 of file BppOSubstitutionModelFormat.h.
References bpp::BppOSubstitutionModelFormat::verbose_.
Referenced by bpp::PhylogeneticsApplicationTools::getBranchModels(), and bpp::LegacyPhylogeneticsApplicationTools::setSubstitutionModelSet().
|
protectedinherited |
Finish parsing of parameters, taking care of aliases.
Definition at line 911 of file BppOSubstitutionModelFormat.cpp.
References bpp::BranchModelInterface::addRateParameter(), bpp::ParameterAliasable::aliasParameters(), bpp::ApplicationTools::displayResult(), bpp::ParameterAliasable::getIndependentParameters(), bpp::ParameterAliasable::getNamespace(), bpp::ParameterList::getParameterNames(), bpp::ParameterAliasable::getParameterNameWithoutNamespace(), bpp::ParameterAliasable::getParameters(), bpp::TextTools::isDecimalInteger(), and bpp::ParameterList::size().
|
overridevirtualinherited |
Write a substitution model to a stream.
model | A substitution model object; |
out | The output stream; |
globalAliases | parameters linked to global alias. The output will be "name=alias_name"; |
writtenNames | is the vector of the written parameters so far [in, out]; |
Exception | If an error occurred. |
Implements bpp::OSubstitutionModel.
Definition at line 1515 of file BppOSubstitutionModelFormat.cpp.
References bpp::POMO::fitness(), bpp::BranchModelInterface::frequencySet(), bpp::Coala::getExch(), bpp::ParameterAliasable::getIndependentParameters(), bpp::BranchModelInterface::getName(), bpp::AbstractParameterAliasable::getNamespace(), bpp::CoalaCore::getNbrOfAxes(), bpp::AbstractWordSubstitutionModel::getNumberOfModels(), bpp::ParameterList::getParameterNames(), bpp::UserProteinSubstitutionModel::getPath(), bpp::OneChangeRegisterTransitionModel::getRegisterName(), bpp::RegisterRatesSubstitutionModel::getRegisterName(), bpp::OneChangeRegisterTransitionModel::getRegisterNumbers(), bpp::InMixedSubstitutionModel::getSubModelNumber(), bpp::POMO::hasFitness(), bpp::TextTools::hasSubstring(), bpp::InMixedSubstitutionModel::mixedModel(), bpp::AbstractFromSubstitutionModelTransitionModel::model(), bpp::AbstractWrappedTransitionModel::model(), bpp::POMO::mutationModel(), bpp::MarkovModulatedSubstitutionModel::nestedModel(), bpp::gBGC::nestedModel(), bpp::YpR::nestedModel(), bpp::RE08::nestedModel(), bpp::AbstractWordSubstitutionModel::nModel(), bpp::VectorTools::paste(), bpp::G2001::rateDistribution(), bpp::StdStr::str(), bpp::TextTools::toString(), bpp::BppOParametrizableFormat::write(), bpp::BppODiscreteDistributionFormat::writeDiscreteDistribution(), and bpp::BppOFrequencySetFormat::writeFrequencySet().
Referenced by bpp::PhylogeneticsApplicationTools::printParameters(), bpp::LegacyPhylogeneticsApplicationTools::printParameters(), and bpp::BppOFrequencySetFormat::writeFrequencySet().
|
privateinherited |
Definition at line 1939 of file BppOSubstitutionModelFormat.cpp.
References bpp::BranchModelInterface::getAlphabet(), bpp::ParameterAliasable::getIndependentParameters(), bpp::ParameterList::getParameterNames(), bpp::StdStr::str(), bpp::TextTools::toString(), bpp::BppOParametrizableFormat::write(), and bpp::BppODiscreteDistributionFormat::writeDiscreteDistribution().
|
staticinherited |
Definition at line 37 of file BppOSubstitutionModelFormat.h.
Referenced by bpp::IOSubstitutionModelFactory::createReader(), bpp::IOSubstitutionModelFactory::createWriter(), bpp::PhylogeneticsApplicationTools::getBranchModel(), bpp::PhylogeneticsApplicationTools::getBranchModels(), bpp::PhylogeneticsApplicationTools::getSubstitutionModel(), bpp::PhylogeneticsApplicationTools::printParameters(), bpp::LegacyPhylogeneticsApplicationTools::printParameters(), bpp::LegacyPhylogeneticsApplicationTools::setSubstitutionModelSet(), and bpp::BppOFrequencySetFormat::writeFrequencySet().
|
protectedinherited |
Definition at line 41 of file BppOSubstitutionModelFormat.h.
Referenced by bpp::BppOSubstitutionModelFormat::operator=().
|
protectedinherited |
Definition at line 43 of file BppOSubstitutionModelFormat.h.
Referenced by bpp::BppOSubstitutionModelFormat::operator=().
|
protectedinherited |
Definition at line 42 of file BppOSubstitutionModelFormat.h.
Referenced by bpp::BppOSubstitutionModelFormat::operator=().
|
protectedinherited |
Definition at line 40 of file BppOSubstitutionModelFormat.h.
Referenced by bpp::BppOSubstitutionModelFormat::operator=().
|
staticinherited |
Definition at line 35 of file BppOSubstitutionModelFormat.h.
|
staticinherited |
Definition at line 33 of file BppOSubstitutionModelFormat.h.
|
staticinherited |
Definition at line 29 of file BppOSubstitutionModelFormat.h.
|
protectedinherited |
Definition at line 46 of file BppOSubstitutionModelFormat.h.
Referenced by bpp::BppOSubstitutionModelFormat::operator=(), and bpp::BppOSubstitutionModelFormat::setGeneticCode().
|
staticinherited |
Definition at line 36 of file BppOSubstitutionModelFormat.h.
|
staticinherited |
Definition at line 31 of file BppOSubstitutionModelFormat.h.
|
staticinherited |
Definition at line 32 of file BppOSubstitutionModelFormat.h.
|
staticinherited |
Definition at line 30 of file BppOSubstitutionModelFormat.h.
|
protectedinherited |
Definition at line 45 of file BppOSubstitutionModelFormat.h.
Referenced by bpp::BppOSubstitutionModelFormat::getUnparsedArguments(), and bpp::BppOSubstitutionModelFormat::operator=().
|
protectedinherited |
Definition at line 44 of file BppOSubstitutionModelFormat.h.
Referenced by bpp::BppOSubstitutionModelFormat::operator=(), and bpp::BppOSubstitutionModelFormat::setVerbose().
|
protectedinherited |
Definition at line 47 of file BppOSubstitutionModelFormat.h.
Referenced by bpp::BppOSubstitutionModelFormat::operator=().
|
staticinherited |
Definition at line 34 of file BppOSubstitutionModelFormat.h.