bpp-seq  2.2.0
bpp::Stockholm Class Reference

The Stockholm alignment file format. More...

#include <Bpp/Seq/Io/Stockholm.h>

+ Inheritance diagram for bpp::Stockholm:
+ Collaboration diagram for bpp::Stockholm:

Public Member Functions

 Stockholm (bool checkSequenceNames=true)
 Build a new Stockholm object. More...
 
virtual ~Stockholm ()
 
bool checkNames () const
 
void checkNames (bool yn)
 Tell whether the sequence names should be checked when reading from files. More...
 
const std::string getDataType () const
 
The OAlignment interface.
void writeAlignment (std::ostream &output, const SiteContainer &sc) const throw (Exception)
 Write a container to a stream. More...
 
void writeAlignment (const std::string &path, const SiteContainer &sc, bool overwrite=true) const throw (Exception)
 Write a container to a file. More...
 
The IOSequence interface.
const std::string getFormatName () const
 
const std::string getFormatDescription () const
 

Private Attributes

bool checkNames_
 

Detailed Description

The Stockholm alignment file format.

Write to Stockholm files. Only sequence data is read/written, annotation and secondary structures are ignored.

Definition at line 57 of file Stockholm.h.

Constructor & Destructor Documentation

◆ Stockholm()

bpp::Stockholm::Stockholm ( bool  checkSequenceNames = true)
inline

Build a new Stockholm object.

Parameters
checkSequenceNamesTell if the names in the file should be checked for unicity (slower, in o(n*n) where n is the number of sequences).

Definition at line 71 of file Stockholm.h.

◆ ~Stockholm()

virtual bpp::Stockholm::~Stockholm ( )
inlinevirtual

Definition at line 74 of file Stockholm.h.

Member Function Documentation

◆ checkNames() [1/2]

bool bpp::Stockholm::checkNames ( ) const
inline
Warning
This is not used for now, will be when reading is implemented.
Returns
true if the names are to be checked when reading sequences from files.

Definition at line 106 of file Stockholm.h.

References checkNames_.

◆ checkNames() [2/2]

void bpp::Stockholm::checkNames ( bool  yn)
inline

Tell whether the sequence names should be checked when reading from files.

Warning
This is not used for now, will be when reading is implemented.
Parameters
ynwhether the sequence names should be checked when reading from files.

Definition at line 114 of file Stockholm.h.

References checkNames_.

◆ getDataType()

const std::string bpp::IOSequence::getDataType ( ) const
inlineinherited

Definition at line 65 of file IoSequence.h.

◆ getFormatDescription()

const std::string bpp::Stockholm::getFormatDescription ( ) const
inline

Definition at line 96 of file Stockholm.h.

◆ getFormatName()

const std::string bpp::Stockholm::getFormatName ( ) const
inline

Definition at line 95 of file Stockholm.h.

◆ writeAlignment() [1/2]

void Stockholm::writeAlignment ( std::ostream &  output,
const SiteContainer sc 
) const
throw (Exception
)
virtual

Write a container to a stream.

Parameters
outputThe output stream where to write.
scThe container to write.
Exceptions
ExceptionIf the file is not in the specified format.

Implements bpp::AbstractOAlignment.

Definition at line 54 of file Stockholm.cpp.

◆ writeAlignment() [2/2]

void bpp::Stockholm::writeAlignment ( const std::string &  path,
const SiteContainer sc,
bool  overwrite = true 
) const
throw (Exception
)
inlinevirtual

Write a container to a file.

Parameters
pathThe path to the file to write.
scThe container to write.
overwriteIf true the sequences are written at the beginning of the file instead of being appended. Any previous content will be lost.
Exceptions
ExceptionIf the file is not in the specified format.

Reimplemented from bpp::AbstractOAlignment.

Definition at line 84 of file Stockholm.h.

References bpp::AbstractOAlignment::writeAlignment().

Member Data Documentation

◆ checkNames_

bool bpp::Stockholm::checkNames_
private

Definition at line 62 of file Stockholm.h.

Referenced by checkNames().


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