bpp-seq  2.2.0
bpp::MaseTools Class Reference

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) throw (IOException)
 Get a site selection from a Mase+ header file. More...
 
static SequenceSelection getSequenceSet (const Comments &maseFileHeader, const std::string &setName) throw (IOException)
 Get a sequence selection from a Mase+ header file. More...
 
static SiteContainergetSelectedSites (const SiteContainer &sequences, const std::string &setName) throw (IOException)
 Create a new container corresponding to a site set given in the mase+ format. More...
 
static SequenceContainergetSelectedSequences (const OrderedSequenceContainer &sequences, const std::string &setName) throw (IOException)
 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) throw (Exception)
 Get the phase of a given coding region from a mase+ header. More...
 

Detailed Description

Utilitary methods that deal with the Mase format.

This class particularily 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 63 of file MaseTools.h.

Member Function Documentation

◆ getAvailableSequenceSelections()

map< string, size_t > MaseTools::getAvailableSequenceSelections ( const Comments maseHeader)
static

Get a list of all available sequences selections.

Parameters
maseHeaderComments as described in the Mase+ format specification.
Returns
A vector of selection names.

Definition at line 243 of file MaseTools.cpp.

◆ getAvailableSiteSelections()

map< string, size_t > MaseTools::getAvailableSiteSelections ( const Comments maseHeader)
static

Get a list of all available site selections.

Parameters
maseHeaderComments as described in the Mase+ format specification.
Returns
A vector of selection names.

Definition at line 196 of file MaseTools.cpp.

◆ getPhase()

size_t MaseTools::getPhase ( const Comments maseFileHeader,
const std::string &  setName 
)
throw (Exception
)
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.

Parameters
maseFileHeaderComments in Mase+ format.
setNamea cds site selection name.
Returns
1,2 or 3.
Exceptions
ExceptionIf no corresponding tag found in file.

Definition at line 269 of file MaseTools.cpp.

◆ getSelectedSequences()

SequenceContainer * MaseTools::getSelectedSequences ( const OrderedSequenceContainer sequences,
const std::string &  setName 
)
throw (IOException
)
static

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.

Parameters
sequencesThe container to get the sequence from.
setNameThe name of the set to retrieve.
Exceptions
IOExceptionIf the specified set is not found.

Definition at line 184 of file MaseTools.cpp.

◆ getSelectedSites()

SiteContainer * MaseTools::getSelectedSites ( const SiteContainer sequences,
const std::string &  setName 
)
throw (IOException
)
static

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.

Parameters
sequencesThe container to get the sites from.
setNameThe name of the set to retrieve.
Exceptions
IOExceptionIf the specified set is not found.

Definition at line 151 of file MaseTools.cpp.

Referenced by bpp::SequenceApplicationTools::getSiteContainer().

◆ getSequenceSet()

SequenceSelection MaseTools::getSequenceSet ( const Comments maseFileHeader,
const std::string &  setName 
)
throw (IOException
)
static

Get a sequence selection from a Mase+ header file.

Parameters
maseFileHeaderThe header of the mase+ file as comments lines.
setNameThe name of the set to retrieve.
Exceptions
IOExceptionIf the specified set is not found.

Definition at line 104 of file MaseTools.cpp.

◆ getSiteSet()

SiteSelection MaseTools::getSiteSet ( const Comments maseFileHeader,
const std::string &  setName 
)
throw (IOException
)
static

Get a site selection from a Mase+ header file.

Parameters
maseFileHeaderThe header of the mase+ file as comments lines.
setNameThe name of the set to retrieve.
Exceptions
IOExceptionIf the specified set is not found.

Definition at line 52 of file MaseTools.cpp.


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