]> git.donarmstrong.com Git - mothur.git/blob - maligner.h
tie breaker fix to chimera.slayer
[mothur.git] / maligner.h
1 #ifndef MALIGNER_H
2 #define MALIGNER_H
3 /*
4  *  maligner.h
5  *  Mothur
6  *
7  *  Created by westcott on 9/23/09.
8  *  Copyright 2009 Schloss Lab. All rights reserved.
9  *
10  */
11  
12 #include "decalc.h"
13 #include "chimera.h"
14 #include "database.hpp"
15
16 /***********************************************************************/
17 //This class was modeled after the chimeraMaligner written by the Broad Institute
18 /**********************************************************************/
19 class Maligner {
20
21         public:
22                 
23                 Maligner(vector<Sequence*>, int, int, int, float, int, int, string, Database*, Database*);
24                 ~Maligner() {};
25                 
26                 string getResults(Sequence*, DeCalculator*);
27                 float getPercentID() {  return percentIdenticalQueryChimera;    }
28                 vector<results> getOutput()  {  return outputResults;                   }
29                 
30                                 
31         private:
32                 Sequence* query;
33                 vector<Sequence*> refSeqs;
34                 vector<Sequence*> db;
35                 int numWanted, matchScore, misMatchPenalty, minCoverage, minSimilarity;
36                 string searchMethod;
37                 float minDivR, percentIdenticalQueryChimera;
38                 vector<results> outputResults;
39                 vector<int> indexes;  //stores index into template seqs of the refSeqs, so we can return the whole sequence rather than the trimmed and filtered one
40                 map<int, int> spotMap;
41                 Database* databaseLeft;
42                 Database* databaseRight;
43                 
44                 vector<Sequence*> minCoverageFilter(vector<Sequence*>);  //removes top matches that do not have minimum coverage with query.
45                 int computeChimeraPenalty();
46                 void verticalFilter(vector<Sequence*>);
47                 
48                 vector< vector<score_struct> > buildScoreMatrix(int, int);
49                 void fillScoreMatrix(vector<vector<score_struct> >&, vector<Sequence*>, int);
50                 vector<trace_struct> extractHighestPath(vector<vector<score_struct> >);
51                 vector<trace_struct> mapTraceRegionsToAlignment(vector<score_struct>, vector<Sequence*>);
52                 string constructChimericSeq(vector<trace_struct>, vector<Sequence*>);
53                 string constructAntiChimericSeq(vector<trace_struct>, vector<Sequence*>);
54                 float computePercentID(string, string);
55                 string chimeraMaligner(int, DeCalculator*);
56                 vector<Sequence*> getBlastSeqs(Sequence*, int);
57                 vector<Sequence*> getKmerSeqs(Sequence*, int);
58                 MothurOut* m;
59                 
60 };
61
62 /***********************************************************************/
63
64 #endif
65