ppALIGN API documentation
Align Class Reference
#include <align.hpp>
Classes | |
| class | GapsAlignedError |
Public Types | |
| typedef std::vector< AlignEntry > | parent_t |
Public Member Functions | |
| Align () | |
| Align (const std::string &str) | |
| Align (const Sequence &s1, const Sequence &s2, Pair startPos=Pair(0, 0)) | |
| void | SetStartPos (Pair p) |
| void | push_back (const AlignEntry &v) |
| void | push_back (long i, long j) |
| Pair | FirstPair () const |
| Pair | LastPair () const |
| Pair | SeqOffset () const |
| Pair | SeqEnd () const |
Alignment analysis | |
| int | Score (const Sequence::const_iterator &first_begin, const Sequence::const_iterator &second_begin, const ScoreMatrix &scoreMatrix, int gap_open, int gap_extension, bool local=false) const |
| int | Score (const Sequence &s1, const Sequence &s2, const ScoreMatrix &scoreMatrix, int gap_open, int gap_extension, bool local=false) const |
| int | Gaps () const |
| int | Identity (const Sequence &s1, const Sequence &s2) const |
| int | Positive (const Sequence &s1, const Sequence &s2, const ScoreMatrix &s) const |
| Pair | MakeLocal (Sequence &seq1, Sequence &seq2) |
| Pair | MakeLocal (Align &align, Sequence &seq1, Sequence &seq2, long offset=0) const |
Friends | |
| std::ostream & | operator<< (std::ostream &ost, const Align &a) |
Detailed Description
A sequence of alignment states.
- Examples:
Definition at line 189 of file align.hpp.
Member Typedef Documentation
| typedef std::vector<AlignEntry> Align::parent_t |
Constructor & Destructor Documentation
| Align::Align | ( | ) | [inline] |
| Align::Align | ( | const std::string & | str | ) |
Constructor. Constructs an alignment from a sequence of states.
- Parameters:
-
str string of states (M, I or D for Match, Insertion or Deletion)
Constructor. Constructs an alignment from a pair of sequences s1 and s2 and the starting position in startPos. The sequences s1 and s2 may contain the gap symbol. The startPos is an offset that is added to each AlignEntry::pair. The alignment can be constructed as
DnaSequence seq1("AAGG--GTCT"); DnaSequence seq2("AAGGCCGT-T"); Align align(seq1,seq2);
- Parameters:
-
s1 first sequence s2 second sequence startPos offset of the alignment, if the alignment is local.
Member Function Documentation
| Pair Align::FirstPair | ( | ) | const [inline] |
| Pair Align::LastPair | ( | ) | const [inline] |
Transforms the alignment to a local alignment.
Like MakeLocal(Sequence & seq1, Sequence & seq2) but the alignment is not changed. Instead a copy of the aligned part of the alignment is returned to align. This is an alignment of the modified sequences
- Parameters:
-
[out] align alignment where padding states [in,out] seq1 sequence [in,out] seq2 sequence
- Returns:
- first pair of the original sequences
Transforms the alignment to a local alignment.
Removes padding parts of the alignment and removes unaligned part of the sequences.
- Parameters:
-
[in,out] seq1 sequence [in,out] seq2 sequence
- Returns:
- first pair of the original sequences
| int Align::Positive | ( | const Sequence & | s1, | |
| const Sequence & | s2, | |||
| const ScoreMatrix & | s | |||
| ) | const [inline] |
| void Align::push_back | ( | long | i, | |
| long | j | |||
| ) | [inline] |
| void Align::push_back | ( | const AlignEntry & | v | ) | [inline] |
| int Align::Score | ( | const Sequence & | s1, | |
| const Sequence & | s2, | |||
| const ScoreMatrix & | scoreMatrix, | |||
| int | gap_open, | |||
| int | gap_extension, | |||
| bool | local = false | |||
| ) | const [inline] |
Compute the score of the alignment for an affine gap cost model.
- Parameters:
-
s1 first sequence s2 second sequence scoreMatrix score matrix gap_open costs to open a gap gap_extension costs to extend a gap local if true compute only the local score (from the first match to the last match)
- Returns:
- score of the alignment
| int Align::Score | ( | const Sequence::const_iterator & | first_begin, | |
| const Sequence::const_iterator & | second_begin, | |||
| const ScoreMatrix & | scoreMatrix, | |||
| int | gap_open, | |||
| int | gap_extension, | |||
| bool | local = false | |||
| ) | const |
Compute the score of the alignment for an affine gap cost model.
- Parameters:
-
first_begin iterator of the starting point in the first sequence second_begin iterator of the starting point in the second sequence scoreMatrix score matrix gap_open costs to open a gap gap_extension costs to extend a gap local if true compute only the local score (from the first match to the last match)
- Returns:
- score of the alignment
| Pair Align::SeqEnd | ( | ) | const [inline] |
| Pair Align::SeqOffset | ( | ) | const [inline] |
| void Align::SetStartPos | ( | Pair | p | ) |
Set start position in the sequence position. Iterate throught the alignment and add the offsets p.i and p.j to all pairs and gaps.
- Parameters:
-
p positions in the sequences
Friends And Related Function Documentation
| std::ostream& operator<< | ( | std::ostream & | ost, | |
| const Align & | a | |||
| ) | [friend] |
write sequence of states in forward direction
The documentation for this class was generated from the following file:
- src/align.hpp