bpp-seq3
3.0.0
|
Utilitary methods that deal with the Mase format. More...
#include <Bpp/Seq/Io/MaseTools.h>
Static Public Member Functions | |
static SiteSelection | getSiteSet (const Comments &maseFileHeader, const std::string &setName) |
Get a site selection from a Mase+ header file. More... | |
static SequenceSelection | getSequenceSet (const Comments &maseFileHeader, const std::string &setName) |
Get a sequence selection from a Mase+ header file. More... | |
template<class SiteType , class SequenceType > | |
static std::unique_ptr< TemplateVectorSiteContainer< SiteType, SequenceType > > | getSelectedSites (const TemplateSiteContainerInterface< SiteType, SequenceType, std::string > &sequences, const std::string &setName) |
Create a new container corresponding to a site set given in the mase+ format. More... | |
template<class SequenceType , class HashType > | |
static std::unique_ptr< TemplateSequenceContainerInterface< SequenceType, HashType > > | getSelectedSequences (const TemplateSequenceContainerInterface< SequenceType, HashType > &sequences, const std::string &setName) |
Create a new container corresponding to a site set given in the mase+ format. More... | |
static std::map< std::string, size_t > | getAvailableSiteSelections (const Comments &maseHeader) |
Get a list of all available site selections. More... | |
static std::map< std::string, size_t > | getAvailableSequenceSelections (const Comments &maseHeader) |
Get a list of all available sequences selections. More... | |
static size_t | getPhase (const Comments &maseFileHeader, const std::string &setName) |
Get the phase of a given coding region from a mase+ header. More... | |
Utilitary methods that deal with the Mase format.
This class particularly covers the Mase+ format, which allows site and sequence selection. Mase+ tags are in the header of the mase file, which is stored in the 'general comment' section of sequence containers. Most of the methods here hence work on the general comments associated to a container.
Definition at line 27 of file MaseTools.h.
|
static |
Get a list of all available sequences selections.
maseHeader | Comments as described in the Mase+ format specification. |
Definition at line 163 of file MaseTools.cpp.
References bpp::StringTokenizer::hasMoreToken(), and bpp::StringTokenizer::nextToken().
|
static |
Get a list of all available site selections.
maseHeader | Comments as described in the Mase+ format specification. |
Definition at line 116 of file MaseTools.cpp.
References bpp::StringTokenizer::hasMoreToken(), and bpp::StringTokenizer::nextToken().
|
static |
Get the phase of a given coding region from a mase+ header.
Look for a /codon_start tag with a phase indice and a site selection with name setName.
maseFileHeader | Comments in Mase+ format. |
setName | a cds site selection name. |
Exception | If no corresponding tag found in file. |
Definition at line 189 of file MaseTools.cpp.
References bpp::StringTokenizer::hasMoreToken(), and bpp::StringTokenizer::nextToken().
|
inlinestatic |
Create a new container corresponding to a site set given in the mase+ format.
A new VectorSequenceContainer is created, whose destruction is up to the user. The container passed as argument must have 'general comments' in the mase+ format. This function calls the getSequenceSet() function on the comments and then calls for SiteContainerTools::getSelectedSequences() on the selection.
sequences | The container to get the sequence from. |
setName | The name of the set to retrieve. |
IOException | If the specified set is not found. |
Definition at line 85 of file MaseTools.h.
References getSequenceSet().
|
inlinestatic |
Create a new container corresponding to a site set given in the mase+ format.
A new VectorSiteContainer is created, whose destruction is up to the user. The container passed as argument must have 'general comments' in the mase+ format. This function calls the getSiteSet() function on the comments and then calls for SiteContainerTools::getSelectedSites() on the selection.
sequences | The container to get the sites from. |
setName | The name of the set to retrieve. |
IOException | If the specified set is not found. |
Definition at line 62 of file MaseTools.h.
References bpp::Commentable::getComments(), and getSiteSet().
Referenced by bpp::SequenceApplicationTools::getProbabilisticSiteContainer(), and bpp::SequenceApplicationTools::getSiteContainer().
|
static |
Get a sequence selection from a Mase+ header file.
maseFileHeader | The header of the mase+ file as comments lines. |
setName | The name of the set to retrieve. |
IOException | If the specified set is not found. |
Definition at line 69 of file MaseTools.cpp.
References bpp::StringTokenizer::hasMoreToken(), bpp::StringTokenizer::nextToken(), and bpp::StringTokenizer::unparseRemainingTokens().
Referenced by getSelectedSequences().
|
static |
Get a site selection from a Mase+ header file.
maseFileHeader | The header of the mase+ file as comments lines. |
setName | The name of the set to retrieve. |
IOException | If the specified set is not found. |
Definition at line 17 of file MaseTools.cpp.
References bpp::StringTokenizer::hasMoreToken(), bpp::StringTokenizer::nextToken(), and bpp::StringTokenizer::unparseRemainingTokens().
Referenced by getSelectedSites().