bpp-seq3
3.0.0
|
This class provides some common tools for applications. More...
#include <Bpp/Seq/App/SequenceApplicationTools.h>
Public Member Functions | |
SequenceApplicationTools () | |
virtual | ~SequenceApplicationTools () |
Static Public Member Functions | |
static std::unique_ptr< Alphabet > | getAlphabet (const std::map< std::string, std::string > ¶ms, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, bool allowGeneric=false, int warn=1) |
Build an Alphabet object according to options. More... | |
static std::unique_ptr< GeneticCode > | getGeneticCode (std::shared_ptr< const NucleicAlphabet > alphabet, const std::string &description) |
Build a GeneticCode object according to options. More... | |
static std::unique_ptr< AlphabetIndex1 > | getAlphabetIndex1 (std::shared_ptr< const Alphabet > alphabet, const std::string &description, const std::string &message="Alphabet measure:", bool verbose=true) |
Build a AlphabetIndex1 object for a given alphabet. More... | |
static std::unique_ptr< AlphabetIndex1 > | getAlphabetIndex1 (std::shared_ptr< const CodonAlphabet > alphabet, std::shared_ptr< const GeneticCode > gencode, const std::string &description, const std::string &message="Alphabet measure:", bool verbose=true) |
static std::unique_ptr< AlphabetIndex2 > | getAlphabetIndex2 (std::shared_ptr< const Alphabet > alphabet, const std::string &description, const std::string &message="Alphabet distance:", bool verbose=true) |
Build a AlphabetIndex2 object for a given alphabet. More... | |
static std::unique_ptr< AlphabetIndex2 > | getAlphabetIndex2 (std::shared_ptr< const CodonAlphabet > alphabet, std::shared_ptr< const GeneticCode > gencode, const std::string &description, const std::string &message="Alphabet distance:", bool verbose=true) |
static std::unique_ptr< SequenceContainerInterface > | getSequenceContainer (std::shared_ptr< const Alphabet > alpha, const std::map< std::string, std::string > ¶ms, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1) |
Build a SequenceContainer object according to options. More... | |
static std::unique_ptr< VectorSiteContainer > | getSiteContainer (std::shared_ptr< const Alphabet > alpha, const std::map< std::string, std::string > ¶ms, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1) |
Build a SiteContainer object according to the BppO syntax. More... | |
static std::unique_ptr< ProbabilisticVectorSiteContainer > | getProbabilisticSiteContainer (std::shared_ptr< const Alphabet > alpha, const std::map< std::string, std::string > ¶ms, const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1) |
Build a ProbabilisticSiteContainer object according to the BppO syntax. More... | |
static std::map< size_t, std::unique_ptr< VectorSiteContainer > > | getSiteContainers (std::shared_ptr< const Alphabet > alpha, const std::map< std::string, std::string > ¶ms, const std::string &prefix="input.", const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1) |
Build multiple SiteContainer objects according to the BppO syntax. More... | |
static std::map< size_t, std::unique_ptr< ProbabilisticVectorSiteContainer > > | getProbabilisticSiteContainers (std::shared_ptr< const Alphabet > alpha, const std::map< std::string, std::string > ¶ms, const std::string &prefix="input.", const std::string &suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1) |
Build multiple ProbabilisticSiteContainer objects according to the BppO syntax. More... | |
static void | restrictSelectedSequencesByName (SequenceContainerInterface &allSequences, const std::map< std::string, std::string > ¶ms, std::string suffix="", bool suffixIsOptional=true, bool verbose=true, int warn=1) |
Retrieves selected sequences (by name). More... | |
template<class SiteType , class SequenceType > | |
static std::unique_ptr< TemplateVectorSiteContainer< SiteType, SequenceType > > | getSitesToAnalyse (const TemplateSiteContainerInterface< SiteType, SequenceType, std::string > &allSites, const std::map< std::string, std::string > ¶ms, std::string suffix="", bool suffixIsOptional=true, bool gapAsUnknown=true, bool verbose=true, int warn=1) |
Retrieves sites suitable for the analysis. More... | |
static void | writeSequenceFile (const SequenceContainerInterface &sequences, const std::map< std::string, std::string > ¶ms, const std::string &suffix="", bool verbose=true, int warn=1) |
Write a sequence file according to options. More... | |
static void | writeAlignmentFile (const SiteContainerInterface &sequences, const std::map< std::string, std::string > ¶ms, const std::string &suffix="", bool verbose=true, int warn=1) |
Write a sequence alignment file according to options. More... | |
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:
with one parameter per line.
Definition at line 37 of file SequenceApplicationTools.h.
|
inline |
Definition at line 40 of file SequenceApplicationTools.h.
|
inlinevirtual |
Definition at line 41 of file SequenceApplicationTools.h.
|
static |
Build an Alphabet object according to options.
Options used are:
- alphabet = [DNA|RNA|Protein], the alphabet type to use. = [DNA|RNA|Protein](length=n) a word-alphabet of words with length n = [EchinodermMitochondrialCodonAlphabet | InvertebrateMitochondrialCodonAlphabet | InvertebrateMitochondrialCodonAlphabet | StandardCodonAlphabet | VertebrateMitochondrialCodonAlphabet]([alphn=NA|RNA]) a codon-alphabet
params | The attribute map where options may be found. |
suffix | A suffix to be applied to each attribute name. |
suffixIsOptional | Tell if the suffix is absolutely required. |
verbose | Print some info to the 'message' output stream. |
allowGeneric | Tell if generic alphabets can be used. |
warn | Set the warning level (0: always display warnings, >0 display warnings on demand). |
Definition at line 43 of file SequenceApplicationTools.cpp.
References bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getBooleanParameter(), bpp::ApplicationTools::getStringParameter(), bpp::AlphabetTools::isNucleicAlphabet(), bpp::KeyvalTools::parseProcedure(), and bpp::TextTools::toString().
|
static |
Build a AlphabetIndex1 object for a given alphabet.
alphabet | The alphabet to use. This is currently only used for assessing the type of distance allowed. |
description | Which distance to use. See the Bio++ Program Suite reference manual for a description of the syntax. |
message | To be displayed when parsing. |
verbose | Tell if some info should be displayed while parsing. |
Exception | in case of bad description. |
Definition at line 228 of file SequenceApplicationTools.cpp.
References bpp::BppOAlphabetIndex1Format::read().
|
static |
Definition at line 248 of file SequenceApplicationTools.cpp.
References bpp::BppOAlphabetIndex1Format::read().
|
static |
Build a AlphabetIndex2 object for a given alphabet.
alphabet | The alphabet to use. This is currently only used for assessing the type of distance allowed. |
description | Which distance to use. See the Bio++ Program Suite reference manual for a description of the syntax. |
message | To be displayed when parsing. |
verbose | Tell if some info should be displayed while parsing. |
Exception | in case of bad description. |
Definition at line 238 of file SequenceApplicationTools.cpp.
References bpp::BppOAlphabetIndex2Format::read().
|
static |
Definition at line 259 of file SequenceApplicationTools.cpp.
References bpp::BppOAlphabetIndex2Format::read().
|
static |
Build a GeneticCode object according to options.
alphabet | pointer to the NucleicAlphabet. !!! the pointer will be owned by the genetic code!!! |
description | for the name of the GeneticCode: [EchinodermMitochondrialGeneticCode | InvertebrateMitochondrialGeneticCode | InvertebrateMitochondrialGeneticCode | StandardGeneticCode | VertebrateMitochondrialGeneticCode] |
Exception | in case of bad description. |
Definition at line 200 of file SequenceApplicationTools.cpp.
Referenced by getSitesToAnalyse().
|
static |
Build a ProbabilisticSiteContainer object according to the BppO syntax.
Sequences in file must be aligned. The supported sequence formats are Fasta, DCSE, Clustal, Mase and Phylip.
See the Bio++ program suite manual for a full description of the syntax.
alpha | The alphabet to use in the container. |
params | The attribute map where options may be found. |
suffix | A suffix to be applied to each attribute name. |
suffixIsOptional | Tell if the suffix is absolutely required. |
verbose | Print some info to the 'message' output stream. |
warn | Set the warning level (0: always display warnings, >0 display warnings on demand). |
Look for RNY translation
Look for Allelic translation
Definition at line 631 of file SequenceApplicationTools.cpp.
References bpp::ApplicationTools::displayMessage(), bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getAFilePath(), bpp::ApplicationTools::getBooleanParameter(), bpp::RandomTools::getSample(), bpp::SiteContainerTools::getSelectedSites(), bpp::MaseTools::getSelectedSites(), bpp::ApplicationTools::getStringParameter(), bpp::BppOAlignmentReaderFormat::getUnparsedArguments(), bpp::AlphabetTools::isAllelicAlphabet(), bpp::AlphabetTools::isRNYAlphabet(), bpp::KeyvalTools::parseProcedure(), bpp::BppOAlignmentReaderFormat::read(), bpp::BppOAlignmentReaderFormat::readProbabilistic(), bpp::SequenceTools::RNYslice(), bpp::NumCalcApplicationTools::seqFromString(), bpp::Table< class >::setColumn(), bpp::Table< class >::setRowNames(), and bpp::TextTools::toString().
|
static |
Build multiple ProbabilisticSiteContainer objects according to the BppO syntax.
Sequences in file must be aligned. The supported sequence format is Pasta.
See the Bio++ program suite manual for a full description of the syntax.
alpha | The alphabet to use in the container. |
params | The attribute map where options may be found. |
prefix | A prefix to be applied to each attribute name. |
suffix | A suffix to be applied to each attribute name. |
suffixIsOptional | Tell if the suffix is absolutely required. |
verbose | Print some info to the 'message' output stream. |
warn | Set the warning level (0: always display warnings, >0 display warnings on demand). |
Definition at line 389 of file SequenceApplicationTools.cpp.
References bpp::ApplicationTools::displayMessage(), bpp::ApplicationTools::displayWarning(), bpp::ApplicationTools::getStringParameter(), bpp::AlphabetTools::isCodonAlphabet(), bpp::TextTools::isDecimalInteger(), bpp::ApplicationTools::matchingParameters(), bpp::KeyvalTools::parseProcedure(), and bpp::TextTools::toString().
|
static |
Build a SequenceContainer object according to options.
The sequences do not have to be aligned. The supported sequence formats are Fasta, DCSE, Clustal, Mase, Phylip and GenBank.
See the Bio++ program suite manual for a full description of the syntax.
alpha | The alphabet to use in the container. |
params | The attribute map where options may be found. |
suffix | A suffix to be applied to each attribute name. |
suffixIsOptional | Tell if the suffix is absolutely required. |
verbose | Print some info to the 'message' output stream. |
warn | Set the warning level (0: always display warnings, >0 display warnings on demand). |
Definition at line 272 of file SequenceApplicationTools.cpp.
References bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getAFilePath(), bpp::ApplicationTools::getStringParameter(), and bpp::BppOSequenceReaderFormat::read().
|
static |
Build a SiteContainer object according to the BppO syntax.
Sequences in file must be aligned. The supported sequence formats are Fasta, DCSE, Clustal, Mase and Phylip.
See the Bio++ program suite manual for a full description of the syntax.
alpha | The alphabet to use in the container. |
params | The attribute map where options may be found. |
suffix | A suffix to be applied to each attribute name. |
suffixIsOptional | Tell if the suffix is absolutely required. |
verbose | Print some info to the 'message' output stream. |
warn | Set the warning level (0: always display warnings, >0 display warnings on demand). |
Look for RNY translation
Definition at line 477 of file SequenceApplicationTools.cpp.
References bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getAFilePath(), bpp::ApplicationTools::getBooleanParameter(), bpp::RandomTools::getSample(), bpp::SiteContainerTools::getSelectedSites(), bpp::MaseTools::getSelectedSites(), bpp::ApplicationTools::getStringParameter(), bpp::BppOAlignmentReaderFormat::getUnparsedArguments(), bpp::AlphabetTools::isRNYAlphabet(), bpp::KeyvalTools::parseProcedure(), bpp::BppOAlignmentReaderFormat::read(), bpp::SequenceTools::RNYslice(), bpp::NumCalcApplicationTools::seqFromString(), and bpp::TextTools::toString().
|
static |
Build multiple SiteContainer objects according to the BppO syntax.
Sequences in file must be aligned. The supported sequence formats are Fasta, DCSE, Clustal, Mase and Phylip.
See the Bio++ program suite manual for a full description of the syntax.
alpha | The alphabet to use in the container. |
params | The attribute map where options may be found. |
prefix | A prefix to be applied to each attribute name. |
suffix | A suffix to be applied to each attribute name. |
suffixIsOptional | Tell if the suffix is absolutely required. |
verbose | Print some info to the 'message' output stream. |
warn | Set the warning level (0: always display warnings, >0 display warnings on demand). |
Definition at line 301 of file SequenceApplicationTools.cpp.
References bpp::ApplicationTools::displayMessage(), bpp::ApplicationTools::displayWarning(), bpp::ApplicationTools::getStringParameter(), bpp::AlphabetTools::isCodonAlphabet(), bpp::TextTools::isDecimalInteger(), bpp::ApplicationTools::matchingParameters(), bpp::KeyvalTools::parseProcedure(), and bpp::TextTools::toString().
|
inlinestatic |
Retrieves sites suitable for the analysis.
Options used are:
If the 'complete' option is used, only fully resolve site will be taken into account. If the 'nogap' option is used, only sites without gap will be taken into account. If 'gapAsUnknown' is set to true and the all option is selected, gaps will be changed to 'unknown' character is sequences.
allSites | The site container from which sites must be retrieved. |
params | The attribute map where options may be found. |
suffix | A suffix to be applied to each attribute name. |
suffixIsOptional | Tell if the suffix is absolutely required. |
gapAsUnknown | Convert gaps to unknown characters. |
verbose | Print some info to the 'message' output stream. |
warn | Set the warning level (0: always display warnings, >0 display warnings on demand). |
Definition at line 326 of file SequenceApplicationTools.h.
References bpp::ApplicationTools::displayGauge(), bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::displayTask(), bpp::ApplicationTools::displayTaskDone(), bpp::SiteContainerTools::getCompleteSites(), getGeneticCode(), bpp::TemplateSequenceDataInterface< HashType >::getNumberOfSequences(), bpp::SiteContainerTools::getSitesWithoutGaps(), bpp::ApplicationTools::getStringParameter(), bpp::SymbolListTools::numberOfGaps(), bpp::SymbolListTools::numberOfUnresolved(), bpp::SiteContainerTools::removeSitesWithStopCodon(), bpp::NumConstants::TINY(), bpp::TextTools::toDouble(), and bpp::TextTools::toString().
|
static |
Retrieves selected sequences (by name).
This method works on the input container and discard sequences not present in the selection.
Recognized options are:
allSequences | The sequence container from which sequences should be filtered. |
params | The attribute map where options may be found. |
suffix | A suffix to be applied to each attribute name. |
suffixIsOptional | Tell if the suffix is absolutely required. |
verbose | Print some info to the 'message' output stream. |
warn | Set the warning level (0: always display warnings, >0 display warnings on demand). |
Definition at line 867 of file SequenceApplicationTools.cpp.
References bpp::ApplicationTools::displayResult(), bpp::TemplateSequenceDataInterface< HashType >::getSequenceNames(), bpp::ApplicationTools::getStringParameter(), and bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::removeSequence().
|
static |
Write a sequence alignment file according to options.
The supported sequence formats are Fasta, Mase and Phylip.
See the Bio++ program suite manual for a full description of the syntax.
sequences | The aligned sequences to write. |
params | The attribute map where options may be found. |
suffix | A suffix to be applied to each attribute name. |
verbose | Print some info to the 'message' output stream. |
warn | Set the warning level (0: always display warnings, >0 display warnings on demand). |
Definition at line 941 of file SequenceApplicationTools.cpp.
References bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getAFilePath(), bpp::ApplicationTools::getStringParameter(), and bpp::BppOAlignmentWriterFormat::read().
|
static |
Write a sequence file according to options.
The supported sequence formats are Fasta and Mase.
See the Bio++ program suite manual for a full description of the syntax.
sequences | The sequences to write. |
params | The attribute map where options may be found. |
suffix | A suffix to be applied to each attribute name. |
verbose | Print some info to the 'message' output stream. |
warn | Set the warning level (0: always display warnings, >0 display warnings on demand). |
Definition at line 918 of file SequenceApplicationTools.cpp.
References bpp::ApplicationTools::displayResult(), bpp::ApplicationTools::getAFilePath(), bpp::ApplicationTools::getStringParameter(), and bpp::BppOSequenceWriterFormat::read().