-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAlignment.H
59 lines (55 loc) · 2.23 KB
/
Alignment.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
55
56
57
58
59
/***********************************************************************
Alignment.H
BOOM : Bioinformatics Object Oriented Modules
Copyright (C)2012 William H. Majoros ([email protected]).
This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
License (GPL) version 3, as described at www.opensource.org.
************************************************************************/
#ifndef INCL_Alignment_H
#define INCL_Alignment_H
#include "Sequence.H"
#include <iostream>
#include "MatchType.H"
#include "SubstitutionMatrix.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.
************************************************************************/
namespace BOOM {
class Alignment
{
public:
static int MAX_WIDTH;
Alignment(const Sequence &,const Sequence &,const Alphabet &,double score=0);
const Sequence &getFirstSequence() const;
const Sequence &getSecondSequence() const;
int getAlignmentLength() const;
MatchType operator[](int position) const;
Alignment &operator+=(MatchType);
double getScore() const;
int countMatches() const;
void countMismatches(int &mismatches,int &insertions) const;
int countNearMatches(SubstitutionMatrix<float> &);
int countNearMatches(SubstitutionMatrix<double> &);
void getResidualsOnRight(Sequence &,Sequence &);
void render(String &,String &);
void printOn(ostream &) const;
String getCigarString() const;
private:
const Sequence &s1, &s2;
Vector<MatchType> matchData;
double score;
const Alphabet &alphabet;
friend ostream &operator<<(ostream &,const Alignment &);
};
ostream &operator<<(ostream &,BOOM::Alignment const &);
}
#endif