The clustal sequence file format.
More...
#include <Bpp/Seq/Io/Clustal.h>
|
| | Clustal (bool checkSequenceNames=true, unsigned int nbExtraSpacesBeforeSeq=5, unsigned int charsByLine=100) throw (Exception) |
| | Build a new Clustal object. More...
|
| |
| virtual | ~Clustal () |
| |
| 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 |
| |
|
| void | appendAlignmentFromStream (std::istream &input, SiteContainer &sc) const throw (Exception) |
| | Append sequences to a container from a stream. More...
|
| |
|
As a SiteContainer is a subclass of SequenceContainer, we hereby implement the ISequence interface by downcasting the interface.
|
| virtual SequenceContainer * | readSequences (std::istream &input, const Alphabet *alpha) const throw (Exception) |
| | Create a new container from a stream. More...
|
| |
| virtual SequenceContainer * | readSequences (const std::string &path, const Alphabet *alpha) const throw (Exception) |
| | Create a new container from a file. More...
|
| |
|
| 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...
|
| |
|
| const std::string | getFormatName () const |
| |
| const std::string | getFormatDescription () const |
| |
|
| virtual void | readAlignment (std::istream &input, SiteContainer &sc) const throw (Exception) |
| | Add sequences to a container from a stream. More...
|
| |
| virtual void | readAlignment (const std::string &path, SiteContainer &sc) const throw (Exception) |
| | Add sequences to a container from a file. More...
|
| |
| virtual AlignedSequenceContainer * | readAlignment (const std::string &path, const Alphabet *alpha) const throw (Exception) |
| | Create a new container from a file. More...
|
| |
| virtual AlignedSequenceContainer * | readAlignment (std::istream &input, const Alphabet *alpha) const throw (Exception) |
| | Create a new container from a stream. More...
|
| |
The clustal sequence file format.
An AlignedSequenceContainer object is used instead of a VectorSequenceContainer.
Definition at line 57 of file Clustal.h.
◆ Clustal()
| bpp::Clustal::Clustal |
( |
bool |
checkSequenceNames = true, |
|
|
unsigned int |
nbExtraSpacesBeforeSeq = 5, |
|
|
unsigned int |
charsByLine = 100 |
|
) |
| |
| throw | ( | Exception |
| ) | | |
|
inline |
Build a new Clustal object.
- Parameters
-
| checkSequenceNames | Tell if the names in the file should be checked for unicity (slower, in o(n*n) where n is the number of sequences). |
| nbExtraSpacesBeforeSeq | Specify the number of extra space characters separating the sequence name form content. The default is 5 (hence 6 spaces in total) for backward compatibility, using 0 will not allow for any space in the sequence names. |
| charsByLine | Number of character per line when writing file. |
Definition at line 75 of file Clustal.h.
◆ ~Clustal()
| virtual bpp::Clustal::~Clustal |
( |
| ) |
|
|
inlinevirtual |
◆ appendAlignmentFromFile()
| virtual void bpp::AbstractIAlignment::appendAlignmentFromFile |
( |
const std::string & |
path, |
|
|
SiteContainer & |
sc |
|
) |
| const |
| throw | ( | Exception |
| ) | | |
|
inlineprotectedvirtualinherited |
◆ appendAlignmentFromStream()
| void Clustal::appendAlignmentFromStream |
( |
std::istream & |
input, |
|
|
SiteContainer & |
sc |
|
) |
| const |
| throw | ( | Exception |
| ) | | |
|
virtual |
Append sequences to a container from a stream.
This is the unique method to implement!
- Parameters
-
| input | The input stream to read. |
| sc | The sequence container to update. |
- Exceptions
-
| Exception | If the file is not in the specified format. |
Implements bpp::AbstractIAlignment.
Definition at line 52 of file Clustal.cpp.
◆ checkNames() [1/2]
| bool bpp::Clustal::checkNames |
( |
| ) |
const |
|
inline |
- Returns
- true if the names are to be checked when reading sequences from files.
Definition at line 134 of file Clustal.h.
References checkNames_.
◆ checkNames() [2/2]
| void bpp::Clustal::checkNames |
( |
bool |
yn | ) |
|
|
inline |
Tell whether the sequence names should be checked when reading from files.
- Parameters
-
| yn | whether the sequence names should be checked when reading from files. |
Definition at line 141 of file Clustal.h.
References checkNames_.
◆ getDataType()
| const std::string bpp::IOSequence::getDataType |
( |
| ) |
const |
|
inlineinherited |
◆ getFormatDescription()
| const std::string bpp::Clustal::getFormatDescription |
( |
| ) |
const |
|
inline |
◆ getFormatName()
| const std::string bpp::Clustal::getFormatName |
( |
| ) |
const |
|
inline |
◆ readAlignment() [1/4]
| virtual void bpp::AbstractIAlignment::readAlignment |
( |
std::istream & |
input, |
|
|
SiteContainer & |
sc |
|
) |
| const |
| throw | ( | Exception |
| ) | | |
|
inlinevirtualinherited |
◆ readAlignment() [2/4]
| virtual void bpp::AbstractIAlignment::readAlignment |
( |
const std::string & |
path, |
|
|
SiteContainer & |
sc |
|
) |
| const |
| throw | ( | Exception |
| ) | | |
|
inlinevirtualinherited |
◆ readAlignment() [3/4]
◆ readAlignment() [4/4]
◆ readAlignmentFromFile()
|
|
inlineprotectedvirtualinherited |
◆ readAlignmentFromStream()
|
|
inlineprotectedvirtualinherited |
◆ readSequences() [1/2]
| virtual SequenceContainer* bpp::Clustal::readSequences |
( |
std::istream & |
input, |
|
|
const Alphabet * |
alpha |
|
) |
| const |
| throw | ( | Exception |
| ) | | |
|
inlinevirtual |
◆ readSequences() [2/2]
| virtual SequenceContainer* bpp::Clustal::readSequences |
( |
const std::string & |
path, |
|
|
const Alphabet * |
alpha |
|
) |
| const |
| throw | ( | Exception |
| ) | | |
|
inlinevirtual |
◆ writeAlignment() [1/2]
| void Clustal::writeAlignment |
( |
std::ostream & |
output, |
|
|
const SiteContainer & |
sc |
|
) |
| const |
| throw | ( | Exception |
| ) | | |
|
virtual |
◆ writeAlignment() [2/2]
| void bpp::Clustal::writeAlignment |
( |
const std::string & |
path, |
|
|
const SiteContainer & |
sc, |
|
|
bool |
overwrite = true |
|
) |
| const |
| throw | ( | Exception |
| ) | | |
|
inlinevirtual |
Write a container to a file.
- Parameters
-
| path | The path to the file to write. |
| sc | The container to write. |
| overwrite | If true the sequences are written at the beginning of the file instead of being appended. Any previous content will be lost. |
- Exceptions
-
| Exception | If the file is not in the specified format. |
Reimplemented from bpp::AbstractOAlignment.
Definition at line 114 of file Clustal.h.
References bpp::AbstractOAlignment::writeAlignment().
◆ charsByLine_
| unsigned int bpp::Clustal::charsByLine_ |
|
private |
◆ checkNames_
| bool bpp::Clustal::checkNames_ |
|
private |
◆ nbSpacesBeforeSeq_
| unsigned int bpp::Clustal::nbSpacesBeforeSeq_ |
|
private |
The documentation for this class was generated from the following files: