File: alignment.hpp

package info (click to toggle)
mothur 1.48.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,692 kB
  • sloc: cpp: 161,866; makefile: 122; sh: 31
file content (67 lines) | stat: -rwxr-xr-x 1,699 bytes parent folder | download | duplicates (2)
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
60
61
62
63
64
65
66
67
#ifndef DPALIGNMENT_H
#define DPALIGNMENT_H

/*
 *  dpalignment.h
 *  
 *
 *  Created by Pat Schloss on 12/15/08.
 *  Copyright 2008 Patrick D. Schloss. All rights reserved.
 *
 *  This is a class for an abstract datatype for classes that implement various types of alignment	algorithms.
 *	As of 12/01/21 these included alignments based on needleman-wunsch, and the	Gotoh algorithms
 * 
 */

#include "mothur.h"
#include "alignmentcell.hpp"
#include "currentfile.h"
#include "protein.hpp"
#include "sequence.hpp"

/**************************************************************************************************/

class Alignment {
	
public:
	Alignment(int);
    Alignment(int, int);
	Alignment();
	virtual ~Alignment();
	virtual void align(string, string, bool createBaseMap=false) = 0;
    virtual void alignPrimer(string, string) {}
    virtual void align(Sequence, Protein) {}
	
	string getSeqAAln();
	string getSeqBAln();
    map<int, int> getSeqAAlnBaseMap();
    map<int, int> getSeqBAlnBaseMap();
	int getCandidateStartPos();
	int getCandidateEndPos();
	int getTemplateStartPos();
	int getTemplateEndPos();
	
	int getPairwiseLength();
	virtual void resize(int);
	int getnRows() { return nRows; }

protected:
    
	void traceBack(bool createBaseMap);
    void proteinTraceBack(vector<string>, vector<AminoAcid>);
	string seqA, seqAaln;
	string seqB, seqBaln;
	int seqAstart, seqAend;
	int seqBstart, seqBend;
	int pairwiseLength;
	int nRows, nCols, lA, lB;
	vector<vector<AlignmentCell> > alignment;
    map<int, int> ABaseMap;
    map<int, int> BBaseMap;
	MothurOut* m;
    
};

/**************************************************************************************************/

#endif