X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=pintail.h;h=92c399889c3be0aa0e552fe296612eb336bc8168;hp=7c0f81bca5659a0f3fa56357dd70fe5498570334;hb=df7e3ff9f68ef157b0328a2d353c3258c5d45d89;hpb=0f297d3c211acbdfd4d941ef193a6702c5046dd1 diff --git a/pintail.h b/pintail.h index 7c0f81b..92c3998 100644 --- a/pintail.h +++ b/pintail.h @@ -12,7 +12,9 @@ #include "chimera.h" #include "dist.h" +#include "decalc.h" +/***********************************************************/ //This class was created using the algorythms described in the // "At Least 1 in 20 16S rRNA Sequence Records Currently Held in the Public Repositories is Estimated To Contain Substantial Anomalies" paper //by Kevin E. Ashelford 1, Nadia A. Chuzhanova 3, John C. Fry 1, Antonia J. Jones 2 and Andrew J. Weightman 1. @@ -22,56 +24,59 @@ class Pintail : public Chimera { public: - Pintail(string); + Pintail(string, string, bool, int, string, string, string, int, int, string); //fastafile, templatefile, filter, processors, mask, conservation, quantile, window, increment, outputDir) ~Pintail(); - void getChimeras(); - void print(ostream&); + int getChimeras(Sequence*); + Sequence print(ostream&, ostream&); + + void setCons(string c) { consfile = c; } + void setQuantiles(string q) { quanfile = q; } + #ifdef USE_MPI + Sequence print(MPI_File&, MPI_File&); + #endif private: - struct linePair { - int start; - int end; - linePair(int i, int j) : start(i), end(j) {} - }; - - - Dist* distCalculator; - string fastafile; - int iters; - vector lines; - vector querySeqs; - vector templateSeqs; + Dist* distcalculator; + DeCalculator* decalc; + int iters, window, increment, processors; + string fastafile, quanfile, consfile; - map bestfit; //maps a query sequence to its most similiar sequence in the template - map::iterator itBest; + vector templateLines; + Sequence* querySeq; + + Sequence* bestfit; //closest match to query in template - map > obsDistance; //maps a query sequence to its observed distance at each window - map > expectedDistance; //maps a query sequence to its expected distance at each window - map >::iterator itObsDist; - map >::iterator itExpDist; + vector obsDistance; //obsDistance is the vector of observed distances for query + vector expectedDistance; //expectedDistance is the vector of expected distances for query + float deviation; //deviation is the percentage of mismatched pairs over the whole seq between query and its best match. + vector windowsForeachQuery; // windowsForeachQuery is a vector containing the starting spot in query aligned sequence for each window. + //this is needed so you can move by bases and not just spots in the alignment + + int windowSizes; //windowSizes = window size of query + vector windowSizesTemplate; //windowSizesTemplate[0] = window size of templateSeqs[0] - vector averageProbability; //Qav - map seqCoef; //maps a sequence to its coefficient - map DE; //maps a sequence to its deviation - map::iterator itCoef; + map trimmed; //trimmed = start and stop of trimmed sequences for query + map::iterator it; - vector readSeqs(string); - vector findQav(vector); - vector calcFreq(vector); - map getCoef(vector); + vector Qav; //Qav is the vector of average variablility for query + float seqCoef; //seqCoef is the coeff for query + float DE; //DE is the deviaation for query + vector probabilityProfile; + vector< vector > quantiles; //quantiles[0] is the vector of deviations with ceiling score of 1, quantiles[1] is the vector of deviations with ceiling score of 2... + vector< vector > quantilesMembers; //quantiles[0] is the vector of deviations with ceiling score of 1, quantiles[1] is the vector of deviations with ceiling score of 2... + set h; + string mergedFilterString; - void findPairs(int, int); - void calcObserved(int, int); - void calcExpected(int, int); - void calcDE(int, int); - - void createProcessesPairs(); - void createProcessesObserved(); - void createProcessesExpected(); - void createProcessesDE(); + vector< vector > readQuantiles(); + vector readFreq(); + Sequence* findPairs(Sequence*); + + void createProcessesQuan(); + int doPrep(); + void printQuanFile(string, string); };