bpp-phyl3  3.0.0
bpp::PhylogeneticsApplicationTools Class Reference

This class provides some common tools for applications. More...

#include <Bpp/Phyl/App/PhylogeneticsApplicationTools.h>

Public Member Functions

 PhylogeneticsApplicationTools ()
 
virtual ~PhylogeneticsApplicationTools ()
 

Static Public Member Functions

static std::unique_ptr< TreegetTree (const std::map< std::string, std::string > &params, const std::string &prefix="input.", const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 Build a Tree object according to options. More...
 
static std::vector< std::unique_ptr< Tree > > getTrees (const std::map< std::string, std::string > &params, const std::string &prefix="input.", const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 Build a list of Tree objects according to options. More...
 
static std::map< size_t, std::shared_ptr< PhyloTree > > getPhyloTrees (const std::map< std::string, std::string > &params, const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &mSeq, std::map< std::string, std::string > &unparsedParams, const std::string &prefix="input.", const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 Build a map of <number,PhyloTree> according to options. More...
 
static std::unique_ptr< BranchModelInterfacegetBranchModel (std::shared_ptr< const Alphabet > alphabet, std::shared_ptr< const GeneticCode > gCode, std::shared_ptr< const AlignmentDataInterface > data, const std::map< std::string, std::string > &params, std::map< std::string, std::string > &unparsedparams, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 Build a BranchModel (most general class of branch models) object according to options. More...
 
static std::unique_ptr< SubstitutionModelInterfacegetSubstitutionModel (std::shared_ptr< const Alphabet > alphabet, std::shared_ptr< const GeneticCode > gCode, std::shared_ptr< const AlignmentDataInterface > data, const std::map< std::string, std::string > &params, std::map< std::string, std::string > &unparsedparams, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 Build a SubstitutionModel object according to options (ie a BranchModel with a generator). More...
 
static std::map< size_t, std::unique_ptr< BranchModelInterface > > getBranchModels (std::shared_ptr< const Alphabet > alphabet, std::shared_ptr< const GeneticCode > gCode, const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &mData, const std::map< std::string, std::string > &params, std::map< std::string, std::string > &unparsedparams, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 The same as before, but returns a map <number, branch model>. More...
 
static std::unique_ptr< FrequencySetInterfacegetRootFrequencySet (std::shared_ptr< const Alphabet > alphabet, std::shared_ptr< const GeneticCode > gCode, const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &mData, size_t nData, const std::map< std::string, std::string > &params, std::map< std::string, std::string > &sharedparams, const std::vector< double > &rateFreqs, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 Get A FrequencySet object for root frequencies (NH models) according to options. More...
 
static std::unique_ptr< FrequencySetInterfacegetRootFrequencySet (std::shared_ptr< const Alphabet > alphabet, std::shared_ptr< const GeneticCode > gCode, std::shared_ptr< const AlignmentDataInterface > data, const std::map< std::string, std::string > &params, std::map< std::string, std::string > &sharedparams, const std::vector< double > &rateFreqs, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 
static std::map< size_t, std::unique_ptr< FrequencySetInterface > > getRootFrequencySets (std::shared_ptr< const Alphabet > alphabet, std::shared_ptr< const GeneticCode > gCode, const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &mData, const std::map< std::string, std::string > &params, std::map< std::string, std::string > &sharedparams, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 The same, but returns a map <number, shared_ptr<FrequencySetInterface>>. More...
 
static std::unique_ptr< FrequencySetInterfacegetFrequencySet (std::shared_ptr< const Alphabet > alphabet, std::shared_ptr< const GeneticCode > gCode, const std::string &freqDescription, std::shared_ptr< const AlignmentDataInterface > data, std::map< std::string, std::string > &sharedParams, const std::vector< double > &rateFreqs, bool verbose=true, int warn=1)
 Get A FrequencySet object according to options. More...
 
static std::unique_ptr< FrequencySetInterfacegetFrequencySet (std::shared_ptr< const Alphabet > alphabet, std::shared_ptr< const GeneticCode > gCode, const std::string &freqDescription, const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &mData, size_t nData, std::map< std::string, std::string > &sharedParams, const std::vector< double > &rateFreqs, bool verbose=true, int warn=1)
 Get A FrequencySet object according to options. More...
 
static map< size_t, std::unique_ptr< ModelPath > > getModelPaths (const std::map< std::string, std::string > &params, const map< size_t, std::shared_ptr< BranchModelInterface >> &mModel, const string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 Build map of ModelPaths from a map of BranchModel. More...
 
static map< size_t, std::unique_ptr< ModelScenario > > getModelScenarios (const std::map< std::string, std::string > &params, const map< size_t, std::shared_ptr< ModelPath >> &mModelPath, const map< size_t, std::shared_ptr< BranchModelInterface >> &mModel, const string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 Build map of ModelScenarios from a map of ModelPaths. More...
 
static std::unique_ptr< SubstitutionRegisterInterfacegetSubstitutionRegister (const std::string &regTypeDesc, std::shared_ptr< const StateMapInterface > stateMap, std::shared_ptr< const GeneticCode > genCode, std::shared_ptr< AlphabetIndex2 > &weights, std::shared_ptr< AlphabetIndex2 > &distances, bool verbose=true)
 Get a Register instance. More...
 
static std::unique_ptr< AutonomousSubstitutionProcessInterfacegetSubstitutionProcess (std::shared_ptr< const Alphabet > alphabet, std::shared_ptr< const GeneticCode > gCode, std::shared_ptr< const AlignmentDataInterface > data, const vector< std::shared_ptr< PhyloTree >> &vTree, const std::map< std::string, std::string > &params, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 Sets a SubstitutionProcess object according to options. More...
 
static std::unique_ptr< SubstitutionProcessCollectiongetSubstitutionProcessCollection (std::shared_ptr< const Alphabet > alphabet, std::shared_ptr< const GeneticCode > gCode, const map< size_t, std::shared_ptr< PhyloTree >> &mTree, const map< size_t, std::shared_ptr< BranchModelInterface >> &mMod, const map< size_t, std::shared_ptr< FrequencySetInterface >> &mRootFreq, const map< size_t, std::shared_ptr< DiscreteDistributionInterface >> &mDist, const map< size_t, std::shared_ptr< ModelScenario >> &mScen, const std::map< std::string, std::string > &params, map< string, string > &unparsedparams, const string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 Builds a SubstitutionProcessCollection from many maps of relevant objects. More...
 
static bool addSubstitutionProcessCollectionMember (SubstitutionProcessCollection &SubProColl, size_t procNum, const std::map< std::string, std::string > &params, bool verbose=true, int warn=1)
 Adds a SubstitutionProcessCollectionMember to a Collection, under a given number. More...
 
static std::map< size_t, std::unique_ptr< SequenceEvolution > > getSequenceEvolutions (std::shared_ptr< SubstitutionProcessCollection > SPC, const std::map< std::string, std::string > &params, map< string, string > &unparsedParams, const string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 Build a map of Sequence Evolution, ie ways how sequence evolve, which may use several processes. More...
 
static std::shared_ptr< PhyloLikelihoodContainergetPhyloLikelihoodContainer (Context &context, std::shared_ptr< SubstitutionProcessCollection > SPC, std::map< size_t, std::shared_ptr< SequenceEvolution >> &mSeqEvol, const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &mData, const std::map< std::string, std::string > &params, const string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 Build a Phylogeny container from parameters map. More...
 
static MultipleDiscreteDistributiongetMultipleDistributionDefaultInstance (const std::string &distDescription, std::map< std::string, std::string > &unparsedParameterValues, bool verbose=true)
 Build a multi-dimension distribution as a MultipleDiscreteDistribution object with default parameter values according to a keyval description. More...
 
static std::unique_ptr< DiscreteDistributionInterfacegetRateDistribution (const std::map< std::string, std::string > &params, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true)
 Build a DiscreteDistribution object according to options. More...
 
static std::map< size_t, std::shared_ptr< DiscreteDistributionInterface > > getRateDistributions (const std::map< std::string, std::string > &params, const string &suffix="", bool suffixIsOptional=true, bool verbose=true)
 
static std::shared_ptr< PhyloLikelihoodInterfaceoptimizeParameters (std::shared_ptr< PhyloLikelihoodInterface > lik, const std::map< std::string, std::string > &params, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
 Optimize parameters according to options. More...
 
static void checkEstimatedParameters (const ParameterList &pl)
 Check if parameter values are close to their definition boundary. More...
 
static std::unique_ptr< SubstitutionCountInterfacegetSubstitutionCount (std::shared_ptr< const Alphabet > alphabet, std::shared_ptr< const SubstitutionModelInterface > model, const std::map< std::string, std::string > &params, string suffix="", bool verbose=true, int warn=1)
 Get a SubstitutionCount instance. More...
 
template<class T >
static std::map< size_t, std::shared_ptr< T > > uniqueToSharedMap (std::map< size_t, std::unique_ptr< T >> &mu)
 
static void writeTree (const TreeTemplate< Node > &tree, const std::map< std::string, std::string > &params, const std::string &prefix="output.", const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, bool checkOnly=false, int warn=1)
 Output methods: More...
 
static void writePhyloTrees (const std::vector< const PhyloTree * > &trees, const std::map< std::string, std::string > &params, const std::string &prefix="output.", const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, bool checkOnly=false, int warn=1)
 Write a tree according to options. More...
 
static void writePhyloTrees (const SubstitutionProcessCollection &spc, const std::map< std::string, std::string > &params, const std::string &prefix="output.", const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, bool checkOnly=false, bool withIds=false, int warn=1)
 Write a tree according to options. More...
 
static void printParameters (const BranchModelInterface &model, OutputStream &out, int warn=1)
 Output a SubstitutionModel description to a file. More...
 
static void printParameters (const SubstitutionProcessInterface &process, OutputStream &out, int warn=1)
 Output a SubstitutionProcess description to a file. More...
 
static void printParameters (const SubstitutionProcessCollection &collection, OutputStream &out, int warn=1, bool withAlias=true)
 Output a SubstitutionProcessCollection description to a file. More...
 
static void printParameters (const PhyloLikelihoodContainer &phylocont, OutputStream &out, int warn=1)
 Output the description of the PhyloLikelihoods IN USE a a PhyloLikelihoodContainer to a file. More...
 
static void printParameters (const SingleDataPhyloLikelihoodInterface &phylolike, OutputStream &out, size_t nPhylo=1, int warn=1)
 
static void printParameters (const SequenceEvolution &evol, OutputStream &out, size_t nEvol=1, int warn=1)
 Output a Sequence Evolution description to a file. More...
 
static void printParameters (const DiscreteDistributionInterface &rDist, OutputStream &out, bool withAlias=true)
 Output a DiscreteDistribution description to a file. More...
 
static void printAnalysisInformation (const PhyloLikelihoodContainer &phylocont, const std::string &infosFile, int warn=1)
 Output information on the computation to a file. More...
 
static void printAnalysisInformation (const SingleDataPhyloLikelihoodInterface &phylolike, const std::string &infosFile, int warn=1)
 
static void printAnalysisInformation (const AlignedPhyloLikelihoodSetInterface &sOAP, const std::string &infosFile, int warn=1)
 

Detailed Description

This class provides some common tools for applications.

The functions parse some option file, create corresponding objects and send a pointer toward it.

The option files are supposed to follow this simple format:

parameterName = parameterContent

with one parameter per line.

See also
ApplicationTools

Definition at line 57 of file PhylogeneticsApplicationTools.h.

Constructor & Destructor Documentation

◆ PhylogeneticsApplicationTools()

bpp::PhylogeneticsApplicationTools::PhylogeneticsApplicationTools ( )

◆ ~PhylogeneticsApplicationTools()

virtual bpp::PhylogeneticsApplicationTools::~PhylogeneticsApplicationTools ( )
virtual

Member Function Documentation

◆ addSubstitutionProcessCollectionMember()

bool PhylogeneticsApplicationTools::addSubstitutionProcessCollectionMember ( SubstitutionProcessCollection SubProColl,
size_t  procNum,
const std::map< std::string, std::string > &  params,
bool  verbose = true,
int  warn = 1 
)
static

Adds a SubstitutionProcessCollectionMember to a Collection, under a given number.

Parameters
SubProCollSubstitutionProcessCollection where the SubstitutionProcessCollectionMember will be added.
procNumthe number of the process
paramsThe attribute map where options may be found.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
if the addition has been successful.

Definition at line 1190 of file PhylogeneticsApplicationTools.cpp.

References bpp::SubstitutionProcessCollection::addDistribution(), bpp::SubstitutionProcessCollection::addOnePerBranchSubstitutionProcess(), bpp::SubstitutionProcessCollection::addSubstitutionProcess(), bpp::VectorTools::diff(), bpp::ApplicationTools::displayMessage(), bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::displayWarning(), bpp::AssociationTreeGraphImplObserver< class, class, class >::getAllEdgesIndexes(), bpp::DiscreteDistributionInterface::getCategory(), bpp::ApplicationTools::getIntParameter(), bpp::DiscreteDistributionInterface::getName(), bpp::SubstitutionProcessCollection::getRateDistributionNumbers(), bpp::ApplicationTools::getStringParameter(), bpp::SubstitutionProcessCollection::getTree(), bpp::SubstitutionProcessCollection::hasDistributionNumber(), bpp::SubstitutionProcessCollection::hasFrequenciesNumber(), bpp::SubstitutionProcessCollection::hasModelNumber(), bpp::SubstitutionProcessCollection::hasModelScenario(), bpp::SubstitutionProcessCollection::hasTreeNumber(), bpp::KeyvalTools::parseProcedure(), bpp::SubstitutionProcessCollection::rateDistribution(), bpp::SubstitutionProcessCollectionMember::setModelScenario(), bpp::SubstitutionProcessCollection::substitutionProcess(), bpp::TextTools::toString(), and bpp::SubstitutionProcessCollection::tree().

◆ checkEstimatedParameters()

void PhylogeneticsApplicationTools::checkEstimatedParameters ( const ParameterList pl)
static

Check if parameter values are close to their definition boundary.

This allows the detection of potential optimization issues. A warning message will be output for each problematic parameter.

Parameters
plA list of parameters. Parameters without constraint will be ignored.

Definition at line 2408 of file PhylogeneticsApplicationTools.cpp.

References bpp::ApplicationTools::displayWarning(), bpp::ParameterList::size(), and bpp::TextTools::toString().

◆ getBranchModel()

std::unique_ptr< BranchModelInterface > PhylogeneticsApplicationTools::getBranchModel ( std::shared_ptr< const Alphabet alphabet,
std::shared_ptr< const GeneticCode gCode,
std::shared_ptr< const AlignmentDataInterface data,
const std::map< std::string, std::string > &  params,
std::map< std::string, std::string > &  unparsedparams,
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

Build a BranchModel (most general class of branch models) object according to options.

Creates a new branch model object according to model description syntax (see the Bio++ Program Suite manual for a detailed description of this syntax). The function also parses the parameter values and set them accordingly.

Parameters
alphabetThe alphabet to use in the model.
gCodeThe genetic code to use (only for codon models, otherwise can be set to 0). If set to NULL and a codon model is requested, an Exception will be thrown.
dataA pointer toward an AlignmentDataInterface<std::string> used for the initialization of substitution model when this data is needed (typically use_observed_freq option). 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 will be unavailable.
paramsThe attribute map where options may be found.
unparsedparamsthe map of the aliases between parameters names.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
A new BranchModel object.

Definition at line 502 of file PhylogeneticsApplicationTools.cpp.

References bpp::BppOSubstitutionModelFormat::ALL, bpp::ApplicationTools::getStringParameter(), bpp::BppOSubstitutionModelFormat::getUnparsedArguments(), bpp::AlphabetTools::isWordAlphabet(), bpp::BppOBranchModelFormat::readBranchModel(), and bpp::BppOSubstitutionModelFormat::setGeneticCode().

◆ getBranchModels()

map< size_t, std::unique_ptr< BranchModelInterface > > PhylogeneticsApplicationTools::getBranchModels ( std::shared_ptr< const Alphabet alphabet,
std::shared_ptr< const GeneticCode gCode,
const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &  mData,
const std::map< std::string, std::string > &  params,
std::map< std::string, std::string > &  unparsedparams,
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

◆ getFrequencySet() [1/2]

std::unique_ptr< FrequencySetInterface > PhylogeneticsApplicationTools::getFrequencySet ( std::shared_ptr< const Alphabet alphabet,
std::shared_ptr< const GeneticCode gCode,
const std::string &  freqDescription,
const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &  mData,
size_t  nData,
std::map< std::string, std::string > &  sharedParams,
const std::vector< double > &  rateFreqs,
bool  verbose = true,
int  warn = 1 
)
static

Get A FrequencySet object according to options.

Parameters
alphabetThe alphabet to use.
gCodeThe genetic code to use (only for codon alphabets, otherwise can be set to 0). If set to NULL and a codon frequencies set is requested, an Exception will be thrown.
freqDescriptionA string in the keyval syntax describing the frequency set to use.
mDataA map <size_t, AlignmentDataInterface> used for the initialization of the frequency set when this data is needed (typically use_observed_freq option). The alphabet associated to the data must be of the same type as the one specified for the frequency set. May be equal to NULL, but in this case will be unavailable.
nDatathe number of the AlignmentDataInterface used in the mData map. 0 if this number has not been defined.
sharedParams(out) remote parameters will be recorded here.
rateFreqsA vector of rate categories frequencies in case of a Markov Modulated Markov Model. Ignored if a vector with size 0 is passed.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
A new FrequencySet object according to options specified.

Definition at line 686 of file PhylogeneticsApplicationTools.cpp.

References bpp::BppOFrequencySetFormat::ALL, bpp::BppOFrequencySetFormat::getUnparsedArguments(), bpp::AlphabetTools::isCodonAlphabet(), bpp::BppOFrequencySetFormat::readFrequencySet(), and bpp::BppOFrequencySetFormat::setGeneticCode().

◆ getFrequencySet() [2/2]

static std::unique_ptr<FrequencySetInterface> bpp::PhylogeneticsApplicationTools::getFrequencySet ( std::shared_ptr< const Alphabet alphabet,
std::shared_ptr< const GeneticCode gCode,
const std::string &  freqDescription,
std::shared_ptr< const AlignmentDataInterface data,
std::map< std::string, std::string > &  sharedParams,
const std::vector< double > &  rateFreqs,
bool  verbose = true,
int  warn = 1 
)
inlinestatic

Get A FrequencySet object according to options.

Parameters
alphabetThe alphabet to use.
gCodeThe genetic code to use (only for codon alphabets, otherwise can be set to 0). If set to NULL and a codon frequencies set is requested, an Exception will be thrown.
freqDescriptionA string in the keyval syntax describing the frequency set to use.
dataA pointer toward an AlignmentDataInterface used for the initialization of the frequency set when this data is needed (typically use_observed_freq option). The alphabet associated to the data must be of the same type as the one specified for the frequency set. May be equal to NULL, but in this case will be unavailable.
sharedParams(out) remote parameters will be recorded here.
rateFreqsA vector of rate categories frequencies in case of a Markov Modulated Markov Model. Ignored if a vector with size 0 is passed.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
A new FrequencySet object according to options specified.

Definition at line 325 of file PhylogeneticsApplicationTools.h.

◆ getModelPaths()

map< size_t, std::unique_ptr< ModelPath > > PhylogeneticsApplicationTools::getModelPaths ( const std::map< std::string, std::string > &  params,
const map< size_t, std::shared_ptr< BranchModelInterface >> &  mModel,
const string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

Build map of ModelPaths from a map of BranchModel.

See the Bio++ Program Suite manual for a description of available options.

Parameters
paramsThe attribute map where options may be found.
mModelA map of shared pointers of BranchModels.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).

Warning: the model FIRST described in a ModelPath will be the leading model (ie on which the submodel probabilities are chosen).

Returns
A map of ModelPath shared_pointers objects according to the specified options.

Definition at line 847 of file PhylogeneticsApplicationTools.cpp.

References bpp::ApplicationTools::displayMessage(), bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getAFilePath(), bpp::AttributesTools::getAttributesMapFromFile(), bpp::ApplicationTools::getStringParameter(), bpp::StringTokenizer::hasMoreToken(), bpp::ApplicationTools::matchingParameters(), bpp::StringTokenizer::nextToken(), bpp::TextTools::toString(), and bpp::VectorTools::vectorIntersection().

◆ getModelScenarios()

map< size_t, std::unique_ptr< ModelScenario > > PhylogeneticsApplicationTools::getModelScenarios ( const std::map< std::string, std::string > &  params,
const map< size_t, std::shared_ptr< ModelPath >> &  mModelPath,
const map< size_t, std::shared_ptr< BranchModelInterface >> &  mModel,
const string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

Build map of ModelScenarios from a map of ModelPaths.

See the Bio++ Program Suite manual for a description of available options.

Parameters
paramsThe attribute map where options may be found.
mModelPathA map of shared pointers of ModelPaths.
mModelA map of shared pointers of BranchModels.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
A map of ModelScenarios shared_pointers objects according to the specified options.

Definition at line 964 of file PhylogeneticsApplicationTools.cpp.

References bpp::ApplicationTools::displayMessage(), bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getAFilePath(), bpp::AttributesTools::getAttributesMapFromFile(), bpp::ApplicationTools::getStringParameter(), bpp::StringTokenizer::hasMoreToken(), bpp::ApplicationTools::matchingParameters(), bpp::StringTokenizer::nextToken(), and bpp::TextTools::toString().

◆ getMultipleDistributionDefaultInstance()

MultipleDiscreteDistribution * PhylogeneticsApplicationTools::getMultipleDistributionDefaultInstance ( const std::string &  distDescription,
std::map< std::string, std::string > &  unparsedParameterValues,
bool  verbose = true 
)
static

Build a multi-dimension distribution as a MultipleDiscreteDistribution object with default parameter values according to a keyval description.

Check the Bio++ Program Suite documentation for a description of the syntax. It is mainly for internal usage, you're probably looking for the getRateDistribution function.

Parameters
distDescriptionA string describing the model in the keyval syntax.
unparsedParameterValues[out] a map that will contain all the distribution parameters names and their corresponding unparsed value, if they were found.
verbosePrint some info to the 'message' output stream.
Returns
A new MultipleDiscreteDistribution object according to options specified.

Definition at line 2252 of file PhylogeneticsApplicationTools.cpp.

References bpp::ParameterList::getParameterNames(), bpp::MultipleDiscreteDistribution::getParameterNameWithoutNamespace(), bpp::MultipleDiscreteDistribution::getParameters(), bpp::MultipleDiscreteDistribution::getParameterValue(), bpp::StringTokenizer::hasMoreToken(), bpp::StringTokenizer::nextToken(), bpp::KeyvalTools::parseProcedure(), bpp::TextTools::toDouble(), and bpp::TextTools::toString().

◆ getPhyloLikelihoodContainer()

std::shared_ptr< PhyloLikelihoodContainer > PhylogeneticsApplicationTools::getPhyloLikelihoodContainer ( Context context,
std::shared_ptr< SubstitutionProcessCollection SPC,
std::map< size_t, std::shared_ptr< SequenceEvolution >> &  mSeqEvol,
const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &  mData,
const std::map< std::string, std::string > &  params,
const string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

◆ getPhyloTrees()

map< size_t, std::shared_ptr< PhyloTree > > PhylogeneticsApplicationTools::getPhyloTrees ( const std::map< std::string, std::string > &  params,
const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &  mSeq,
std::map< std::string, std::string > &  unparsedParams,
const std::string &  prefix = "input.",
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

Build a map of <number,PhyloTree> according to options.

See the Bio++ Program Suite manual for a description of available options.

Parameters
paramsThe attribute map where options may be found.
mSeqA map of pointers of AlignmentDataInterface<std::string>s, necessary in case of random trees.
unparsedParamsA map of parameters (BrLen) that will be aliased after.
prefixA prefix to be applied to each attribute name.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
A new vector of Tree objects according to the specified options.

Definition at line 150 of file PhylogeneticsApplicationTools.cpp.

References bpp::PhyloTreeTools::buildFromTreeTemplate(), bpp::PhyloTreeTools::computeBranchLengthsGrafen(), bpp::PhyloTreeTools::constrainedMidPointRooting(), bpp::PhyloTreeTools::convertToClockTree(), bpp::ApplicationTools::displayMessage(), bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::displayWarning(), bpp::ApplicationTools::getAFilePath(), bpp::ApplicationTools::getDoubleParameter(), bpp::PhyloTreeTools::getHeight(), bpp::TreeTemplateTools::getRandomTree(), bpp::ApplicationTools::getStringParameter(), bpp::TextTools::isDecimalInteger(), bpp::ApplicationTools::matchingParameters(), bpp::KeyvalTools::parseProcedure(), bpp::IMultiPhyloTree::readPhyloTrees(), bpp::TextTools::toDouble(), bpp::TextTools::toInt(), and bpp::TextTools::toString().

◆ getRateDistribution()

unique_ptr< DiscreteDistributionInterface > PhylogeneticsApplicationTools::getRateDistribution ( const std::map< std::string, std::string > &  params,
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true 
)
static

Build a DiscreteDistribution object according to options.

Creates a new rate distribution object according to distribution description syntax (see the Bio++ Program Suite manual for a detailed description of this syntax). The function also parses the parameter values and set them accordingly.

Parameters
paramsThe attribute map where options may be found.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
Returns
A new DiscreteDistribution object according to options specified.

Definition at line 2298 of file PhylogeneticsApplicationTools.cpp.

References bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getStringParameter(), bpp::KeyvalTools::parseProcedure(), bpp::BppORateDistributionFormat::readDiscreteDistribution(), and bpp::TextTools::toString().

◆ getRateDistributions()

map< size_t, std::shared_ptr< DiscreteDistributionInterface > > PhylogeneticsApplicationTools::getRateDistributions ( const std::map< std::string, std::string > &  params,
const string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true 
)
static

◆ getRootFrequencySet() [1/2]

std::unique_ptr< FrequencySetInterface > PhylogeneticsApplicationTools::getRootFrequencySet ( std::shared_ptr< const Alphabet alphabet,
std::shared_ptr< const GeneticCode gCode,
const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &  mData,
size_t  nData,
const std::map< std::string, std::string > &  params,
std::map< std::string, std::string > &  sharedparams,
const std::vector< double > &  rateFreqs,
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

Get A FrequencySet object for root frequencies (NH models) according to options.

Parameters
alphabetThe alphabet to use.
gCodeThe genetic code to use (only for codon alphabets, otherwise can be set to 0). If set to NULL and a codon frequencies set is requested, an Exception will be thrown.
mDataA map <size_t, AlignmentDataInterface> used for the initialization of the frequency set when this data is needed (typically use_observed_freq option). The alphabet associated to the data must be of the same type as the one specified for the frequency set. May be equal to NULL, but in this case will be unavailable.
nDatathe number of the AlignmentDataInterface used in the mData map. 0 if this number has not been defined.
paramsThe attribute map where options may be found.
sharedparamsThe attribute map of aliases (out).
rateFreqsA vector of rate categories frequencies in case of a Markov Modulated Markov Model. Ignored if a vector with size 0 is passed.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
A new FrequencySet object according to options specified.

Definition at line 722 of file PhylogeneticsApplicationTools.cpp.

References bpp::ApplicationTools::displayResult(), and bpp::ApplicationTools::getStringParameter().

Referenced by getRootFrequencySet(), and bpp::LegacyPhylogeneticsApplicationTools::setSubstitutionModelSet().

◆ getRootFrequencySet() [2/2]

static std::unique_ptr<FrequencySetInterface> bpp::PhylogeneticsApplicationTools::getRootFrequencySet ( std::shared_ptr< const Alphabet alphabet,
std::shared_ptr< const GeneticCode gCode,
std::shared_ptr< const AlignmentDataInterface data,
const std::map< std::string, std::string > &  params,
std::map< std::string, std::string > &  sharedparams,
const std::vector< double > &  rateFreqs,
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
inlinestatic

Definition at line 271 of file PhylogeneticsApplicationTools.h.

References getRootFrequencySet().

◆ getRootFrequencySets()

map< size_t, std::unique_ptr< FrequencySetInterface > > PhylogeneticsApplicationTools::getRootFrequencySets ( std::shared_ptr< const Alphabet alphabet,
std::shared_ptr< const GeneticCode gCode,
const std::map< size_t, std::shared_ptr< const AlignmentDataInterface >> &  mData,
const std::map< std::string, std::string > &  params,
std::map< std::string, std::string > &  sharedparams,
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

◆ getSequenceEvolutions()

map< size_t, unique_ptr< SequenceEvolution > > PhylogeneticsApplicationTools::getSequenceEvolutions ( std::shared_ptr< SubstitutionProcessCollection SPC,
const std::map< std::string, std::string > &  params,
map< string, string > &  unparsedParams,
const string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

◆ getSubstitutionCount()

unique_ptr< SubstitutionCountInterface > PhylogeneticsApplicationTools::getSubstitutionCount ( std::shared_ptr< const Alphabet alphabet,
std::shared_ptr< const SubstitutionModelInterface model,
const std::map< std::string, std::string > &  params,
string  suffix = "",
bool  verbose = true,
int  warn = 1 
)
static

Get a SubstitutionCount instance.

Parameters
alphabetThe alphabet to use.
modelThe model to use.
paramsThe attribute map where options may be found.
suffixOptional suffix for command name.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
A SubstitutionCount object.

Definition at line 3631 of file PhylogeneticsApplicationTools.cpp.

References bpp::ApplicationTools::displayError(), bpp::ApplicationTools::displayMessage(), bpp::ApplicationTools::displayResult(), bpp::SequenceApplicationTools::getAlphabetIndex2(), bpp::ApplicationTools::getStringParameter(), and bpp::KeyvalTools::parseProcedure().

◆ getSubstitutionModel()

std::unique_ptr< SubstitutionModelInterface > PhylogeneticsApplicationTools::getSubstitutionModel ( std::shared_ptr< const Alphabet alphabet,
std::shared_ptr< const GeneticCode gCode,
std::shared_ptr< const AlignmentDataInterface data,
const std::map< std::string, std::string > &  params,
std::map< std::string, std::string > &  unparsedparams,
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

Build a SubstitutionModel object according to options (ie a BranchModel with a generator).

Creates a new substitution model object according to model description syntax (see the Bio++ Program Suite manual for a detailed description of this syntax). The function also parses the parameter values and set them accordingly.

Parameters
alphabetThe alphabet to use in the model.
gCodeThe genetic code to use (only for codon models, otherwise can be set to 0). If set to NULL and a codon model is requested, an Exception will be thrown.
dataA pointer toward an AlignmentDataInterface<std::string> used for the initialization of substitution model when this data is needed (typically use_observed_freq option). 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 will be unavailable.
paramsThe attribute map where options may be found.
unparsedparamsthe map of the aliases between parameters names.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
A new SubstitutionModel object.

Definition at line 466 of file PhylogeneticsApplicationTools.cpp.

References bpp::BppOSubstitutionModelFormat::ALL, bpp::ApplicationTools::getStringParameter(), bpp::BppOSubstitutionModelFormat::getUnparsedArguments(), bpp::AlphabetTools::isWordAlphabet(), bpp::BppOSubstitutionModelFormat::readSubstitutionModel(), and bpp::BppOSubstitutionModelFormat::setGeneticCode().

◆ getSubstitutionProcess()

unique_ptr< AutonomousSubstitutionProcessInterface > PhylogeneticsApplicationTools::getSubstitutionProcess ( std::shared_ptr< const Alphabet alphabet,
std::shared_ptr< const GeneticCode gCode,
std::shared_ptr< const AlignmentDataInterface data,
const vector< std::shared_ptr< PhyloTree >> &  vTree,
const std::map< std::string, std::string > &  params,
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

Sets a SubstitutionProcess object according to options.

See the Bio++ Program Suite manual for a description of available options.

Parameters
alphabetThe alphabet to use in all models.
gCodeThe genetic code to use (only for codon alphabets, otherwise can be set to 0). If set to NULL and a codon frequencies set is requested, an Exception will be thrown.
dataan AlignmentDataInterface<std::string> used for the initialization of process set when this data is needed (typically use_observed_freq option). The alphabet associated to the data must be of the same type as the one specified for the process set. May be equal to NULL, but in this case will be unavailable.
vTreeA vector of pointers of Trees, used to set processes.
paramsThe attribute map where options may be found.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
A pointer to a AutonomousSubstitutionProcess.

Definition at line 1097 of file PhylogeneticsApplicationTools.cpp.

References bpp::SubstitutionProcessCollectionMember::getModel(), bpp::SubstitutionProcessCollectionMember::getModelNumbers(), bpp::SubstitutionProcessCollectionMember::getModelScenario(), bpp::SubstitutionProcessCollectionMember::getNodesWithModel(), bpp::SubstitutionProcessCollectionMember::getParametrizablePhyloTree(), bpp::SubstitutionProcessCollectionMember::getRateDistribution(), and bpp::SubstitutionProcessCollectionMember::getRootFrequencySet().

◆ getSubstitutionProcessCollection()

unique_ptr< SubstitutionProcessCollection > PhylogeneticsApplicationTools::getSubstitutionProcessCollection ( std::shared_ptr< const Alphabet alphabet,
std::shared_ptr< const GeneticCode gCode,
const map< size_t, std::shared_ptr< PhyloTree >> &  mTree,
const map< size_t, std::shared_ptr< BranchModelInterface >> &  mMod,
const map< size_t, std::shared_ptr< FrequencySetInterface >> &  mRootFreq,
const map< size_t, std::shared_ptr< DiscreteDistributionInterface >> &  mDist,
const map< size_t, std::shared_ptr< ModelScenario >> &  mScen,
const std::map< std::string, std::string > &  params,
map< string, string > &  unparsedparams,
const string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

Builds a SubstitutionProcessCollection from many maps of relevant objects.

Parameters
alphabetThe alphabet to use in all models.
gCodeThe genetic code to use (only for codon alphabets, otherwise can be set to 0). If set to NULL and a codon frequencies set is requested, an Exception will be thrown.
mTreeMap of the PhyloTrees
mModMap of Branch Models
mRootFreqMap of FrequencySet
mDistMap of Rate Distributions
mScenMap of Scenarios
paramsThe attribute map where options may be found.
unparsedparamsmap of the attributes that will not be parsed there
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
A shared pointer to a SubstitutionProcessCollection.

Definition at line 1475 of file PhylogeneticsApplicationTools.cpp.

References bpp::ApplicationTools::displayMessage(), bpp::ApplicationTools::displayResult(), bpp::TextTools::isDecimalInteger(), bpp::ApplicationTools::matchingParameters(), bpp::TextTools::toDouble(), and bpp::TextTools::toString().

◆ getSubstitutionRegister()

unique_ptr< SubstitutionRegisterInterface > PhylogeneticsApplicationTools::getSubstitutionRegister ( const std::string &  regTypeDesc,
std::shared_ptr< const StateMapInterface stateMap,
std::shared_ptr< const GeneticCode genCode,
std::shared_ptr< AlphabetIndex2 > &  weights,
std::shared_ptr< AlphabetIndex2 > &  distances,
bool  verbose = true 
)
static

Get a Register instance.

Parameters
regTypeDescThe description of the register.
stateMapThe stateMap to use.
genCodewhen codon Alphabet, the genetic Code (otherwise, default : 0)
weights[out] AlphabetIndex2 pointer if "weights" argument is provided, null otherwise
distances[out] AlphabetIndex2 pointer if "distances" argument is provided, null otherwise
verboseif outputs reading
Returns
A SubstitutionRegister object.

Definition at line 3704 of file PhylogeneticsApplicationTools.cpp.

References bpp::ApplicationTools::displayResult(), bpp::SequenceApplicationTools::getAlphabetIndex2(), bpp::ApplicationTools::getBooleanParameter(), bpp::ApplicationTools::getStringParameter(), bpp::AlphabetTools::isCodonAlphabet(), bpp::AlphabetTools::isNucleicAlphabet(), bpp::AlphabetTools::isProteicAlphabet(), bpp::KeyvalTools::parseProcedure(), bpp::CategorySubstitutionRegister::setStationarity(), and bpp::TextTools::toString().

Referenced by bpp::BppOSubstitutionModelFormat::readSubstitutionModel(), and bpp::BppOTransitionModelFormat::readTransitionModel().

◆ getTree()

unique_ptr< Tree > PhylogeneticsApplicationTools::getTree ( const std::map< std::string, std::string > &  params,
const std::string &  prefix = "input.",
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

Build a Tree object according to options.

See the Bio++ Program Suite manual for a description of available options.

Parameters
paramsThe attribute map where options may be found.
prefixA prefix to be applied to each attribute name.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
A new Tree object according to the specified options.

Definition at line 97 of file PhylogeneticsApplicationTools.cpp.

References bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getAFilePath(), bpp::ApplicationTools::getStringParameter(), and bpp::BppOTreeReaderFormat::readITree().

◆ getTrees()

vector< unique_ptr< Tree > > PhylogeneticsApplicationTools::getTrees ( const std::map< std::string, std::string > &  params,
const std::string &  prefix = "input.",
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

Build a list of Tree objects according to options.

See the Bio++ Program Suite manual for a description of available options.

Parameters
paramsThe attribute map where options may be found.
prefixA prefix to be applied to each attribute name.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
A new vector of Tree objects according to the specified options.

Definition at line 120 of file PhylogeneticsApplicationTools.cpp.

References bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getAFilePath(), bpp::ApplicationTools::getStringParameter(), and bpp::BppOMultiTreeReaderFormat::readIMultiTree().

◆ optimizeParameters()

std::shared_ptr< PhyloLikelihoodInterface > PhylogeneticsApplicationTools::optimizeParameters ( std::shared_ptr< PhyloLikelihoodInterface lik,
const std::map< std::string, std::string > &  params,
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
int  warn = 1 
)
static

Optimize parameters according to options.

Parameters
likThe PhyloLikelihood function to optimize.
paramsThe attribute map where options may be found.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
Returns
A pointer toward the final likelihood object.

This pointer may be the same as passed in argument (tl), but in some cases the algorithm clone this object. We may change this behavior in the future... You hence should write something like

static std::shared_ptr< PhyloLikelihoodInterface > optimizeParameters(std::shared_ptr< PhyloLikelihoodInterface > lik, const std::map< std::string, std::string > &params, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1)
Optimize parameters according to options.

Definition at line 2327 of file PhylogeneticsApplicationTools.cpp.

References bpp::OptimizationTools::OptimizationOptions::backupFile, bpp::AutoParameter::CONSTRAINTS_AUTO, bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getStringParameter(), bpp::ParameterList::matchParametersValues(), bpp::OptimizationTools::OptimizationOptions::messenger, bpp::OptimizationTools::OptimizationOptions::nbEvalMax, bpp::OptimizationTools::OptimizationOptions::nstep, bpp::OptimizationTools::OPTIMIZATION_BFGS, bpp::OptimizationTools::OPTIMIZATION_BRENT, bpp::OptimizationTools::OPTIMIZATION_NEWTON, bpp::OptimizationTools::optimizeNumericalParameters(), bpp::OptimizationTools::optimizeNumericalParameters2(), bpp::OptimizationTools::OptimizationOptions::optMethodModel, bpp::OptimizationTools::OptimizationOptions::parameters, bpp::OptimizationTools::OptimizationOptions::profiler, bpp::OptimizationTools::OptimizationOptions::tolerance, and bpp::TextTools::toString().

◆ printAnalysisInformation() [1/3]

◆ printAnalysisInformation() [2/3]

void PhylogeneticsApplicationTools::printAnalysisInformation ( const PhyloLikelihoodContainer phylocont,
const std::string &  infosFile,
int  warn = 1 
)
static

Output information on the computation to a file.

Parameters
phylocontThe phylolikelihood to serialize.
infosFileThe name of the file where to print.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).

Definition at line 3187 of file PhylogeneticsApplicationTools.cpp.

References bpp::PhyloLikelihoodContainer::getNumbersOfPhyloLikelihoods(), bpp::TextTools::toString(), and bpp::VectorTools::unique().

◆ printAnalysisInformation() [3/3]

◆ printParameters() [1/7]

void PhylogeneticsApplicationTools::printParameters ( const BranchModelInterface model,
OutputStream out,
int  warn = 1 
)
static

Output a SubstitutionModel description to a file.

Parameters
modelThe model to serialize.
outThe stream where to print.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).

Definition at line 2549 of file PhylogeneticsApplicationTools.cpp.

References bpp::BppOSubstitutionModelFormat::ALL, bpp::OutputStream::endLine(), and bpp::BppOSubstitutionModelFormat::write().

◆ printParameters() [2/7]

void PhylogeneticsApplicationTools::printParameters ( const DiscreteDistributionInterface rDist,
OutputStream out,
bool  withAlias = true 
)
static

Output a DiscreteDistribution description to a file.

Parameters
rDistThe rate distribution to serialize.
outThe stream where to print.
withAliasoutputs the alias names of the aliased Parameters instead of the values (default : true).

Definition at line 3617 of file PhylogeneticsApplicationTools.cpp.

References bpp::OutputStream::endLine(), and bpp::BppORateDistributionFormat::writeDiscreteDistribution().

◆ printParameters() [3/7]

void PhylogeneticsApplicationTools::printParameters ( const PhyloLikelihoodContainer phylocont,
OutputStream out,
int  warn = 1 
)
static

Output the description of the PhyloLikelihoods IN USE a a PhyloLikelihoodContainer to a file.

Starting from PhyloLikelihood with number 0 (with name "result"), PhyloLikelihoods involved in the computation are successively serialized.

Parameters
phylocontThe PhyloLikelihoodContainer to serialize.
outThe stream where to print.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).

Definition at line 2914 of file PhylogeneticsApplicationTools.cpp.

References bpp::copyEigenToBpp(), bpp::OutputStream::endLine(), bpp::StringTokenizer::hasMoreToken(), bpp::StringTokenizer::nextToken(), bpp::VectorTools::paste(), bpp::MatrixTools::print(), bpp::OutputStream::setPrecision(), and bpp::TextTools::toString().

◆ printParameters() [4/7]

◆ printParameters() [5/7]

void PhylogeneticsApplicationTools::printParameters ( const SingleDataPhyloLikelihoodInterface phylolike,
OutputStream out,
size_t  nPhylo = 1,
int  warn = 1 
)
static

◆ printParameters() [6/7]

void PhylogeneticsApplicationTools::printParameters ( const SubstitutionProcessCollection collection,
OutputStream out,
int  warn = 1,
bool  withAlias = true 
)
static

Output a SubstitutionProcessCollection description to a file.

Parameters
collectionThe process collection to serialize.
outThe stream where to print.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).
withAliasoutputs the alias names of the aliased Parameters instead of the values (default : true).

Definition at line 2695 of file PhylogeneticsApplicationTools.cpp.

References bpp::BppOFrequencySetFormat::ALL, bpp::BppOSubstitutionModelFormat::ALL, bpp::OutputStream::endLine(), bpp::SubstitutionProcessCollection::getFrequenciesNumbers(), bpp::SubstitutionProcessCollection::getFrequencySet(), bpp::AbstractParameterAliasable::getFrom(), bpp::SubstitutionProcessCollection::getModel(), bpp::SubstitutionProcessCollection::getModelIndex(), bpp::SubstitutionProcessCollection::getModelNumbers(), bpp::ModelPath::getModels(), bpp::SubstitutionProcessCollection::getModelScenario(), bpp::ModelPath::getPathNode(), bpp::SubstitutionProcessCollection::getRateDistribution(), bpp::SubstitutionProcessCollection::getRateDistributionNumbers(), bpp::SubstitutionProcessCollection::getScenarioNumbers(), bpp::SubstitutionProcessCollection::getSubstitutionProcessNumbers(), bpp::ParameterList::size(), bpp::SubstitutionProcessCollection::substitutionProcess(), bpp::ModelPath::PathNode::to_string(), bpp::TextTools::toString(), bpp::BppOSubstitutionModelFormat::write(), bpp::BppORateDistributionFormat::writeDiscreteDistribution(), and bpp::BppOFrequencySetFormat::writeFrequencySet().

◆ printParameters() [7/7]

◆ uniqueToSharedMap()

template<class T >
static std::map<size_t, std::shared_ptr<T> > bpp::PhylogeneticsApplicationTools::uniqueToSharedMap ( std::map< size_t, std::unique_ptr< T >> &  mu)
inlinestatic

Definition at line 862 of file PhylogeneticsApplicationTools.h.

◆ writePhyloTrees() [1/2]

void PhylogeneticsApplicationTools::writePhyloTrees ( const std::vector< const PhyloTree * > &  trees,
const std::map< std::string, std::string > &  params,
const std::string &  prefix = "output.",
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
bool  checkOnly = false,
int  warn = 1 
)
static

Write a tree according to options.

See the Bio++ Program Suite manual for a description of all available options.

Parameters
treesThe trees to write.
paramsThe attribute map where options may be found.
prefixA prefix to be applied to each attribute name.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
checkOnlyIf this parameter is set to true, then all options are checked and error messages sent, but no file is written.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).

Definition at line 2459 of file PhylogeneticsApplicationTools.cpp.

References bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getAFilePath(), bpp::ApplicationTools::getStringParameter(), and bpp::OMultiPhyloTree::writePhyloTrees().

◆ writePhyloTrees() [2/2]

void PhylogeneticsApplicationTools::writePhyloTrees ( const SubstitutionProcessCollection spc,
const std::map< std::string, std::string > &  params,
const std::string &  prefix = "output.",
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
bool  checkOnly = false,
bool  withIds = false,
int  warn = 1 
)
static

Write a tree according to options.

See the Bio++ Program Suite manual for a description of all available options.

Parameters
spcThe SubstitutionProcessCollection of all objects
paramsThe attribute map where options may be found.
prefixA prefix to be applied to each attribute name.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
checkOnlyIf this parameter is set to true, then all options are checked and error messages sent, but no file is written.
withIdsIf this parameter is set to true, ids are added to the names of the nodes in output.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).

Definition at line 2494 of file PhylogeneticsApplicationTools.cpp.

References bpp::ApplicationTools::displayResult(), bpp::Newick::enableExtendedBootstrapProperty(), bpp::ApplicationTools::getAFilePath(), bpp::ApplicationTools::getStringParameter(), bpp::SubstitutionProcessCollection::getTree(), bpp::SubstitutionProcessCollection::getTreeNumbers(), bpp::TextTools::toString(), and bpp::OPhyloTree::writePhyloTree().

◆ writeTree()

void PhylogeneticsApplicationTools::writeTree ( const TreeTemplate< Node > &  tree,
const std::map< std::string, std::string > &  params,
const std::string &  prefix = "output.",
const std::string &  suffix = "",
bool  suffixIsOptional = true,
bool  verbose = true,
bool  checkOnly = false,
int  warn = 1 
)
static

Output methods:

Write a tree according to options.

See the Bio++ Program Suite manual for a description of all available options.

Parameters
treeThe tree to write.
paramsThe attribute map where options may be found.
prefixA prefix to be applied to each attribute name.
suffixA suffix to be applied to each attribute name.
suffixIsOptionalTell if the suffix is absolutely required.
verbosePrint some info to the 'message' output stream.
checkOnlyIf this parameter is set to true, then all options are checked and error messages sent, but no file is written.
warnSet the warning level (0: always display warnings, >0 display warnings on demand).

Definition at line 2429 of file PhylogeneticsApplicationTools.cpp.

References bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getAFilePath(), bpp::ApplicationTools::getStringParameter(), and bpp::OTree::writeTree().


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