#include <Alignment.hh>
Inheritance diagram for RazorBack::Alignment_:
Public Types | |
enum | Formatflags_ { UNKNOWN = 0, FASTA = 1, GCG = 2, PIR = 4, ANYFORMAT = 7 } |
available I/O formats. More... | |
Public Methods | |
Alignment_ () | |
Creates an empty alignment. | |
Alignment_ (size_t N) | |
Creates an alignment to hold N sequences. | |
const Monomer_& | monomer () const |
monomer(): provides const access to the monomer type. | |
size_t | seq_no () const |
seq_no(): returns the number of sequences in the alignment. | |
size_t | max_len () const |
max_len(): returns the maximal gapped length in the alignment. | |
const Gapseq_& | operator[] (size_t Idx) const |
[Idx]: unchecked const access to the Idx:th sequence. | |
const Gapseq_& | at (size_t Idx) const |
at(Idx): checked const access to the Idx:th sequence. More... | |
int | find (const string &ID) const |
find(ID): finds the sequence with ID string ID in the alignment. More... | |
string | vertical_string (size_t Apos) const |
vertical_string(Apos): creates and returns a string that contains the Apos:th vertical position. More... | |
bool | mmer_compat (const Monomer_ &Mseq, const Monomer_ &Mali) const |
mmer_compat(Mseq, [Mali]): returns true if the monomer type in Mseq for a sequence is compatible with the monomer type in Mali for an alignment (if omitted, the calling object's current monomer() object is used). More... | |
bool | mmer_compat (const Monomer_ &Mseq) const |
void | add_seq (const Gapseq_ &Seq) |
add_seq(Seq, [Idx]): adds the sequence Seq before position Idx. More... | |
void | add_seq (const Gapseq_ &Seq, size_t Idx) |
void | remove_seq (size_t Idx) |
remove_seq([Idx]): removes the Idx:th sequence from the alignment. More... | |
void | remove_seq () |
void | insert_gaps (size_t Seqidx, size_t Netpos, size_t Gaplen) |
insert_gaps(Seqidx, Netpos, Gaplen): invokes Gapseq_::insert_gaps(Netpos, Gaplen) for the Seqidx:th sequence in the alignment. More... | |
void | remove_gaps (size_t Seqidx, size_t Netpos) |
remove_gaps([Seqidx],[Netpos]): When both parameters are specified, then Gapseq_::remove_gaps(Netpos) is invoked for the Seqidx:th sequence in the alignment. More... | |
void | remove_gaps (size_t Seqidx) |
void | remove_gaps () |
Bioseqio_::Errtype_ | read_align (istream &Inf, int Type=Monomer_::USER, int Format=ANYFORMAT) |
read_align(Inf, Type, Format): tries to read a multiple alignment from the input stream Inf. More... | |
Bioseqio_::Errtype_ | write_align (ostream &Outf, int Format) const |
write_align(Outf, Format): writes the contents of the calling object to Outf according to the format specification in Format. More... | |
Protected Methods | |
void | set_monomer_type (const Monomer_ &Mseq, Monomer_ &Mali) |
hidden methods. | |
void | set_monomer_type (const Monomer_ &Mseq) |
size_t | set_maxlen () const |
Bioseqio_::Errtype_ | read_concat (istream &Inf, int Type, int Format) |
Bioseqio_::Errtype_ | read_msf (istream &Inf) |
Bioseqio_::Errtype_ | write_concat (ostream &Outf, int Format) const |
Bioseqio_::Errtype_ | write_msf (ostream &Outf) const |
Private Attributes | |
Monomer_ | Monomer |
contains the monomer alphabet. | |
vector<Gapseq_> | Sequences |
the aligned sequences. | |
size_t | Maxlen |
the maximal (gapped) alignment length. | |
bool | Dirty |
set to true after non-const access. |
Implements some simple manipulations and I/O.
Definition at line 50 of file Alignment.hh.
|
available I/O formats.
Reimplemented from RazorBack::Bioseqio_. Definition at line 177 of file Alignment.hh. |
|
Creates an empty alignment.
Definition at line 64 of file Alignment.hh. |
|
Creates an alignment to hold N sequences.
Definition at line 67 of file Alignment.hh. |
|
monomer(): provides const access to the monomer type.
Definition at line 70 of file Alignment.hh. Referenced by mmer_compat(). |
|
seq_no(): returns the number of sequences in the alignment.
Definition at line 73 of file Alignment.hh. |
|
max_len(): returns the maximal gapped length in the alignment.
Definition at line 76 of file Alignment.hh. |
|
[Idx]: unchecked const access to the Idx:th sequence.
Definition at line 79 of file Alignment.hh. |
|
at(Idx): checked const access to the Idx:th sequence. Throws Indexrangexc_ if Idx is illegal. |
|
find(ID): finds the sequence with ID string ID in the alignment. Returns a number in [ 0..seq_no() ) if found, -1 if not found. |
|
vertical_string(Apos): creates and returns a string that contains the Apos:th vertical position. E.g. for this alignment: * -ALI-GN- * --MIGGN- * SAVL-GNP * |
|
mmer_compat(Mseq, [Mali]): returns true if the monomer type in Mseq for a sequence is compatible with the monomer type in Mali for an alignment (if omitted, the calling object's current monomer() object is used). DNA, RNA and NUCL monomer types are compatible with each other (basically we allow any nucleotide sequence to be aligned to any other nucleotide sequence). All other monomer types are compatible only with themselves, UNKNOWN is incompatible with all definite types. Referenced by mmer_compat(). |
|
Definition at line 124 of file Alignment.hh. |
|
add_seq(Seq, [Idx]): adds the sequence Seq before position Idx. If the position is omitted then Seq will be added to the end. If Idx is illegal, Indexrangexc_ will be thrown. However, if the calling object was empty, then Idx is ignored and the sequence will be added anyway. The type of this first sequence will set the type of the whole alignment. Seq must have compatible monomers as the alignment itself as defined by the mmer_compat() method otherwise it will not be added and a warning is issued. |
|
|
|
remove_seq([Idx]): removes the Idx:th sequence from the alignment. If Idx is omitted then all sequences are deleted (complete reset). Nothing is done if the calling object was already empty. Throws Indexrangexc_ otherwise if Idx is illegal. |
|
|
|
insert_gaps(Seqidx, Netpos, Gaplen): invokes Gapseq_::insert_gaps(Netpos, Gaplen) for the Seqidx:th sequence in the alignment. Throws Indexrangexc_ if Seqidx is illegal. |
|
remove_gaps([Seqidx],[Netpos]): When both parameters are specified, then Gapseq_::remove_gaps(Netpos) is invoked for the Seqidx:th sequence in the alignment. If Netpos is omitted, then all gaps are removed from the Seqidx:th sequence. Throws Indexrangexc_ if Seqidx is illegal. Without any parameters, all gaps are deleted from all sequences. |
|
|
|
|
|
read_align(Inf, Type, Format): tries to read a multiple alignment from the input stream Inf. If Type is set to Monomer_::PROT, then only protein sequences will be read, if it is set to Monomer_::[DEOXY[RIBO]]NUCL, then only the corresponding nucleic acid sequences will be read, if Type is Monomer_::USER (default) or an OR-ed combination of PROT and *NUCL, then all types are considered and a polymer type autodetection is attempted. This is not foolproof. Format can be set to ANYFORMAT (default), in this case automatic file format detection is performed, or to PIR (proteins only), FASTA, GCG (protein or nucleic acid). No read is performed and FORMATERR is returned when incompatible type and format are specified. Return value: OK or an error enum if something went wrong. |
|
write_align(Outf, Format): writes the contents of the calling object to Outf according to the format specification in Format. Returns OK or an error enum if something went wrong. |
|
hidden methods.
Referenced by set_monomer_type(). |
|
Definition at line 208 of file Alignment.hh. |
|
Referenced by max_len(). |
|
|
|
|
|
|
|
|
|
contains the monomer alphabet.
Definition at line 55 of file Alignment.hh. |
|
the aligned sequences.
Definition at line 56 of file Alignment.hh. |
|
the maximal (gapped) alignment length.
Definition at line 57 of file Alignment.hh. |
|
set to true after non-const access.
Definition at line 58 of file Alignment.hh. |