X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=maligner.h;fp=maligner.h;h=6277e7300a02fbe815468e223298f5f969813a51;hb=05a0195e07c42c996592ee1c8abb63adedb7f493;hp=0000000000000000000000000000000000000000;hpb=d2fc851cdaf57874b3ac8261b220fad35750daad;p=mothur.git diff --git a/maligner.h b/maligner.h new file mode 100644 index 0000000..6277e73 --- /dev/null +++ b/maligner.h @@ -0,0 +1,77 @@ +#ifndef MALIGNER_H +#define MALIGNER_H +/* + * maligner.h + * Mothur + * + * Created by westcott on 9/23/09. + * Copyright 2009 Schloss Lab. All rights reserved. + * + */ + +#include "decalc.h" + +/***********************************************************************/ +//This class was modeled after the chimeraMaligner written by the Broad Institute +/***********************************************************************/ +struct score_struct { + int prev; + int score; + int row; + int col; +}; +/***********************************************************************/ +struct trace_struct { + int col; + int oldCol; + int row; +}; +/***********************************************************************/ +struct results { + int regionStart; + int regionEnd; + string parent; + float queryToParent; + float queryToParentLocal; + float divR; +}; + +/**********************************************************************/ +class Maligner { + + public: + + Maligner(vector, int, int, int, float, int); + ~Maligner() {}; + + string getResults(Sequence*); + float getPercentID() { return percentIdenticalQueryChimera; } + vector getOutput() { return outputResults; } + + + private: + DeCalculator* decalc; + Sequence* query; + vector refSeqs; + vector db; + int numWanted, matchScore, misMatchPenalty, minCoverage; + float minDivR, percentIdenticalQueryChimera; + vector outputResults; + + vector minCoverageFilter(vector); //removes top matches that do not have minimum coverage with query. + int computeChimeraPenalty(); + void verticalFilter(vector); + + vector< vector > buildScoreMatrix(int, int); + void fillScoreMatrix(vector >&, vector, int); + vector extractHighestPath(vector >); + vector mapTraceRegionsToAlignment(vector, vector); + string constructChimericSeq(vector, vector); + float computePercentID(string, string); + +}; + +/***********************************************************************/ + +#endif +