-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAlignmentPath.H
54 lines (50 loc) · 2.09 KB
/
AlignmentPath.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/****************************************************************
AlignmentPath.H
Represents an alignment between two sequences (nucleotide, amino
acid, or other). The alignment is represented by a list of
match classifications (MATCH/INSERTION/DELETION) that describe
the individual points on the path through an alignment matrix
(i.e., DIAGONAL/UP/RIGHT). This is a (relatively) compact
representation that is bounded by the sum of the two sequence
lengths, but it does not give constant time access to a random
base. It is time-efficient only when processing the entire
alignment from left to right. A constant-time random-access
alignment representation could be derived from this.
****************************************************************/
#ifndef INCL_AlignmentPath_H
#define INCL_AlignmentPath_H
#include "BOOM/Sequence.H"
#include <iostream>
#include "MatchType.H"
#include "AlignmentSubstMatrix.H"
using namespace std;
using namespace BOOM;
class AlignmentPath {
public:
static int MAX_WIDTH;
AlignmentPath(const Sequence &,const Sequence &,Alphabet &,double score=0);
const Sequence &getFirstSequence() const;
const Sequence &getSecondSequence() const;
int getAlignmentLength() const; // length of *full* alignment
int getAlignedLength() const; // not including indels at either end
MatchType operator[](int position) const;
AlignmentPath &operator+=(MatchType);
double getScore() const;
void countMismatches(int &mismatches,int &insertions) const;
int countNearMatches(AlignmentSubstMatrix<float> &);
int countNearMatches(AlignmentSubstMatrix<double> &);
void getResidualsOnRight(Sequence &,Sequence &);
void countNonNColumns(int &cols,int &matches) const;
void getMatchExtent(int &firstBegin,int &firstEnd,int &secondBegin,int &secondEnd) const;
String getCigarString() const;
private:
const Sequence &s1, &s2;
Vector<MatchType> matchData;
double score;
Alphabet &alphabet;
friend ostream &operator<<(ostream &,const AlignmentPath &);
void printOn(ostream &) const;
};
ostream &operator<<(ostream &,const AlignmentPath &);
#endif