bpp-phyl
2.2.0
|
Substitution model I/O in BppO format. More...
#include <Bpp/Phyl/Io/BppOSubstitutionModelFormat.h>
Public Member Functions | |
BppOSubstitutionModelFormat (unsigned char alphabetCode, bool allowCovarions, bool allowMixed, bool allowGaps, bool verbose, int warn) | |
Create a new BppOSubstitutionModelFormat object. More... | |
BppOSubstitutionModelFormat (const BppOSubstitutionModelFormat &format) | |
BppOSubstitutionModelFormat & | operator= (const BppOSubstitutionModelFormat &format) |
virtual | ~BppOSubstitutionModelFormat () |
const std::string | getFormatName () const |
const std::string | getFormatDescription () const |
void | setGeneticCode (const GeneticCode *gCode) |
Set the genetic code to use in case a codon frequencies set should be built. More... | |
SubstitutionModel * | read (const Alphabet *alphabet, const std::string &modelDescription, const SiteContainer *data=0, bool parseArguments=true) |
Read a substitution model from a string. More... | |
const std::map< std::string, std::string > & | getUnparsedArguments () const |
void | write (const SubstitutionModel &model, OutputStream &out, std::map< std::string, std::string > &globalAliases, std::vector< std::string > &writtenNames) const |
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 | ALL = 1 | 2 | 4 | 8 | 16 | 32 |
Private Member Functions | |
MixedSubstitutionModel * | readMixed_ (const Alphabet *alphabet, const std::string &modelDescription, const SiteContainer *data) |
SubstitutionModel * | readWord_ (const Alphabet *alphabet, const std::string &modelDescription, const SiteContainer *data) |
void | initialize_ (SubstitutionModel &model, const SiteContainer *data) throw (Exception) |
Set parameter initial values of a given model according to options. More... | |
void | writeMixed_ (const MixedSubstitutionModel &model, OutputStream &out, std::map< std::string, std::string > &globalAliases, std::vector< std::string > &writtenNames) const |
Private Attributes | |
unsigned char | alphabetCode_ |
bool | allowCovarions_ |
bool | allowMixed_ |
bool | allowGaps_ |
bool | verbose_ |
std::map< std::string, std::string > | unparsedArguments_ |
const GeneticCode * | geneticCode_ |
int | warningLevel_ |
Substitution model I/O in BppO format.
Creates a new substitution model object according to model description syntax (see the Bio++ Progam Suite manual for a detailed description of this syntax).
Definition at line 59 of file BppOSubstitutionModelFormat.h.
|
inline |
Create a new BppOSubstitutionModelFormat 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 94 of file BppOSubstitutionModelFormat.h.
|
inline |
Definition at line 105 of file BppOSubstitutionModelFormat.h.
|
inlinevirtual |
Definition at line 129 of file BppOSubstitutionModelFormat.h.
|
inlinevirtualinherited |
Definition at line 69 of file IoSubstitutionModel.h.
|
inline |
Definition at line 134 of file BppOSubstitutionModelFormat.h.
|
inline |
Definition at line 132 of file BppOSubstitutionModelFormat.h.
|
inlinevirtual |
Implements bpp::ISubstitutionModel.
Definition at line 147 of file BppOSubstitutionModelFormat.h.
References unparsedArguments_.
Referenced by read(), readMixed_(), readWord_(), and bpp::PhylogeneticsApplicationTools::setSubstitutionModelSet().
|
private |
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 SiteContainer 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 occured. |
Definition at line 1298 of file BppOSubstitutionModelFormat.cpp.
|
inline |
Definition at line 116 of file BppOSubstitutionModelFormat.h.
References allowCovarions_, allowGaps_, allowMixed_, alphabetCode_, geneticCode_, unparsedArguments_, verbose_, and warningLevel_.
|
virtual |
Read a substitution model from a string.
alphabet | The alpabet to use in the model. |
modelDescription | A string describing the model in the format. |
data | A pointer toward a SiteContainer, which can be used to initial some parmaeters like frequencies. |
parseArguments | Attempt to parse function arguments. If not, only store them and use default values instead. |
Exception | if an error occured. |
Implements bpp::ISubstitutionModel.
Definition at line 131 of file BppOSubstitutionModelFormat.cpp.
References bpp::BppOFrequenciesSetFormat::ALL, bpp::BppOFrequenciesSetFormat::getUnparsedArguments(), getUnparsedArguments(), bpp::BppOFrequenciesSetFormat::read(), read(), bpp::SubstitutionModel::setFreqFromData(), and bpp::BppOFrequenciesSetFormat::setGeneticCode().
Referenced by bpp::PhylogeneticsApplicationTools::getSubstitutionModel(), read(), readMixed_(), readWord_(), and bpp::PhylogeneticsApplicationTools::setSubstitutionModelSet().
|
private |
Definition at line 953 of file BppOSubstitutionModelFormat.cpp.
References bpp::SubstitutionModel::getName(), bpp::MixedSubstitutionModel::getNumberOfModels(), getUnparsedArguments(), and read().
|
private |
Definition at line 689 of file BppOSubstitutionModelFormat.cpp.
References bpp::BppOFrequenciesSetFormat::getUnparsedArguments(), getUnparsedArguments(), bpp::BppOFrequenciesSetFormat::read(), read(), and bpp::BppOFrequenciesSetFormat::setGeneticCode().
|
inline |
Set the genetic code to use in case a codon frequencies set should be built.
gCode | The genetic code to use. |
Definition at line 141 of file BppOSubstitutionModelFormat.h.
References geneticCode_.
Referenced by bpp::PhylogeneticsApplicationTools::getSubstitutionModel(), and bpp::PhylogeneticsApplicationTools::setSubstitutionModelSet().
|
inline |
Definition at line 165 of file BppOSubstitutionModelFormat.h.
References verbose_.
Referenced by bpp::PhylogeneticsApplicationTools::setSubstitutionModelSet().
|
virtual |
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 occured. |
Implements bpp::OSubstitutionModel.
Definition at line 1070 of file BppOSubstitutionModelFormat.cpp.
References bpp::Coala::getExch(), bpp::AbstractCodonFitnessSubstitutionModel::getFitness(), bpp::SubstitutionModel::getFrequenciesSet(), bpp::SubstitutionModel::getName(), bpp::CoalaCore::getNbrOfAxes(), bpp::gBGC::getNestedModel(), bpp::YpR::getNestedModel(), bpp::RE08::getNestedModel(), bpp::MarkovModulatedSubstitutionModel::getNestedModel(), bpp::AbstractWordSubstitutionModel::getNModel(), bpp::AbstractWordSubstitutionModel::getNumberOfModels(), bpp::UserProteinSubstitutionModel::getPath(), bpp::G2001::getRateDistribution(), and bpp::BppOFrequenciesSetFormat::write().
Referenced by bpp::PhylogeneticsApplicationTools::printParameters().
|
private |
Definition at line 1225 of file BppOSubstitutionModelFormat.cpp.
References bpp::MixtureOfASubstitutionModel::from(), bpp::SubstitutionModel::getAlphabet(), bpp::MixtureOfASubstitutionModel::getDistribution(), bpp::AbstractMixedSubstitutionModel::getNModel(), bpp::AbstractMixedSubstitutionModel::getNumberOfModels(), and bpp::MixtureOfASubstitutionModel::to().
|
static |
Definition at line 71 of file BppOSubstitutionModelFormat.h.
Referenced by bpp::IOSubstitutionModelFactory::createReader(), bpp::IOSubstitutionModelFactory::createWriter(), bpp::PhylogeneticsApplicationTools::getSubstitutionModel(), bpp::PhylogeneticsApplicationTools::printParameters(), and bpp::PhylogeneticsApplicationTools::setSubstitutionModelSet().
|
private |
Definition at line 75 of file BppOSubstitutionModelFormat.h.
Referenced by operator=().
|
private |
Definition at line 77 of file BppOSubstitutionModelFormat.h.
Referenced by operator=().
|
private |
Definition at line 76 of file BppOSubstitutionModelFormat.h.
Referenced by operator=().
|
private |
Definition at line 74 of file BppOSubstitutionModelFormat.h.
Referenced by operator=().
|
static |
Definition at line 70 of file BppOSubstitutionModelFormat.h.
|
static |
Definition at line 68 of file BppOSubstitutionModelFormat.h.
|
static |
Definition at line 64 of file BppOSubstitutionModelFormat.h.
|
private |
Definition at line 80 of file BppOSubstitutionModelFormat.h.
Referenced by operator=(), and setGeneticCode().
|
static |
Definition at line 66 of file BppOSubstitutionModelFormat.h.
|
static |
Definition at line 67 of file BppOSubstitutionModelFormat.h.
|
static |
Definition at line 65 of file BppOSubstitutionModelFormat.h.
|
private |
Definition at line 79 of file BppOSubstitutionModelFormat.h.
Referenced by getUnparsedArguments(), and operator=().
|
private |
Definition at line 78 of file BppOSubstitutionModelFormat.h.
Referenced by operator=(), and setVerbose().
|
private |
Definition at line 81 of file BppOSubstitutionModelFormat.h.
Referenced by operator=().
|
static |
Definition at line 69 of file BppOSubstitutionModelFormat.h.