CMAPLE 1.0.0
C++ MAximum Parsimonious Likelihood Estimation
|
#include <alignment.h>
Public Types | |
enum | InputType { IN_FASTA , IN_PHYLIP , IN_MAPLE , IN_AUTO , IN_UNKNOWN } |
Public Member Functions | |
Alignment () | |
Default constructor. | |
Alignment (std::istream &aln_stream, const std::string &ref_seq="", const InputType format=IN_AUTO, const cmaple::SeqRegion::SeqType seqtype=cmaple::SeqRegion::SEQ_AUTO) | |
Constructor from a stream of an alignment in FASTA, PHYLIP, or MAPLE format. | |
Alignment (const std::string &aln_filename, const std::string &ref_seq="", const InputType format=IN_AUTO, const cmaple::SeqRegion::SeqType seqtype=cmaple::SeqRegion::SEQ_AUTO) | |
Constructor from an alignment file in FASTA, PHYLIP, or MAPLE format. | |
~Alignment () | |
Destructor. | |
void | read (std::istream &aln_stream, const std::string &ref_seq="", const InputType format=IN_AUTO, const cmaple::SeqRegion::SeqType seqtype=cmaple::SeqRegion::SEQ_AUTO) |
Read an alignment from a stream in FASTA, PHYLIP, or MAPLE format. | |
void | read (const std::string &aln_filename, const std::string &ref_seq="", const InputType format=IN_AUTO, const cmaple::SeqRegion::SeqType seqtype=cmaple::SeqRegion::SEQ_AUTO) |
Read an alignment from a file in FASTA, PHYLIP, or MAPLE format. | |
void | write (std::ostream &aln_stream, const InputType &format=IN_MAPLE) |
Write the alignment to a stream in FASTA, PHYLIP, or MAPLE format. | |
void | write (const std::string &aln_filename, const InputType &format=IN_MAPLE, const bool overwrite=false) |
Write the alignment to a file in FASTA, PHYLIP, or MAPLE format. | |
Class presents the input alignment
cmaple::Alignment::Alignment | ( | std::istream & | aln_stream, |
const std::string & | ref_seq = "" , |
||
const InputType | format = IN_AUTO , |
||
const cmaple::SeqRegion::SeqType | seqtype = cmaple::SeqRegion::SEQ_AUTO |
||
) |
Constructor from a stream of an alignment in FASTA, PHYLIP, or MAPLE format.
[in] | aln_stream | A stream of an alignment file |
[in] | ref_seq | A reference sequence (optional). If not specified, it will be read from the alignment (in MAPLE format) or automatically generated from the alignment (in FASTA or PHYLIP format) |
[in] | format | Format of the alignment (optional): IN_MAPLE, IN_FASTA, IN_PHYLIP, or IN_AUTO (auto detection) |
[in] | seqtype | Data type of sequences (optional): SEQ_DNA (nucleotide data), SEQ_PROTEIN (amino acid data), or SEQ_AUTO (auto detection) |
std::invalid_argument | if any of the following situations occur.
|
cmaple::Alignment::Alignment | ( | const std::string & | aln_filename, |
const std::string & | ref_seq = "" , |
||
const InputType | format = IN_AUTO , |
||
const cmaple::SeqRegion::SeqType | seqtype = cmaple::SeqRegion::SEQ_AUTO |
||
) |
Constructor from an alignment file in FASTA, PHYLIP, or MAPLE format.
[in] | aln_filename | Name of an alignment file |
[in] | ref_seq | A reference sequence (optional). If not specified, it will be read from the alignment (in MAPLE format) or automatically generated from the alignment (in FASTA or PHYLIP format) |
[in] | format | Format of the alignment (optional): IN_MAPLE, IN_FASTA, IN_PHYLIP, or IN_AUTO (auto detection) |
[in] | seqtype | Data type of sequences (optional): SEQ_DNA (nucleotide data), SEQ_PROTEIN (amino acid data), or SEQ_AUTO (auto detection) |
std::invalid_argument | if any of the following situations occur.
|
std::ios_base::failure | if the alignment file is not found |
void cmaple::Alignment::read | ( | std::istream & | aln_stream, |
const std::string & | ref_seq = "" , |
||
const InputType | format = IN_AUTO , |
||
const cmaple::SeqRegion::SeqType | seqtype = cmaple::SeqRegion::SEQ_AUTO |
||
) |
Read an alignment from a stream in FASTA, PHYLIP, or MAPLE format.
[in] | aln_stream | A stream of an alignment file |
[in] | ref_seq | A reference sequence (optional). If not specified, it will be read from the alignment (in MAPLE format) or automatically generated from the alignment (in FASTA or PHYLIP format) |
[in] | format | Format of the alignment (optional): IN_MAPLE, IN_FASTA, IN_PHYLIP, or IN_AUTO (auto detection) |
[in] | seqtype | Data type of sequences (optional): SEQ_DNA (nucleotide data), SEQ_PROTEIN (amino acid data), or SEQ_AUTO (auto detection) |
std::invalid_argument | if any of the following situations occur.
|
void cmaple::Alignment::read | ( | const std::string & | aln_filename, |
const std::string & | ref_seq = "" , |
||
const InputType | format = IN_AUTO , |
||
const cmaple::SeqRegion::SeqType | seqtype = cmaple::SeqRegion::SEQ_AUTO |
||
) |
Read an alignment from a file in FASTA, PHYLIP, or MAPLE format.
[in] | aln_filename | Name of an alignment file |
[in] | ref_seq | A reference sequence (optional). If not specified, it will be read from the alignment (in MAPLE format) or automatically generated from the alignment (in FASTA or PHYLIP format) |
[in] | format | Format of the alignment (optional): IN_MAPLE, IN_FASTA, IN_PHYLIP, or IN_AUTO (auto detection) |
[in] | seqtype | Data type of sequences (optional): SEQ_DNA (nucleotide data), SEQ_PROTEIN (amino acid data), or SEQ_AUTO (auto detection) |
std::invalid_argument | if any of the following situations occur.
|
std::ios_base::failure | if the alignment file is not found |
Write the alignment to a stream in FASTA, PHYLIP, or MAPLE format.
[in] | aln_stream | A stream of the output alignment file |
[in] | format | Format of the output alignment (optional): IN_MAPLE, IN_FASTA, or IN_PHYLIP |
std::invalid_argument | if the format is unknown |
std::logic_error | if the alignment is empty (i.e., nothing to write) |
void cmaple::Alignment::write | ( | const std::string & | aln_filename, |
const InputType & | format = IN_MAPLE , |
||
const bool | overwrite = false |
||
) |
Write the alignment to a file in FASTA, PHYLIP, or MAPLE format.
[in] | aln_filename | Name of the output alignment file |
[in] | format | Format of the output alignment (optional): IN_MAPLE, IN_FASTA, or IN_PHYLIP |
[in] | overwrite | TRUE to overwrite the existing output file (optional) |
std::invalid_argument | if any of the following situations occur.
|
std::logic_error | if the alignment is empty (i.e., nothing to write) |
std::ios_base::failure | if aln_filename already exists and overwrite = false |