X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=pintail.h;h=92c399889c3be0aa0e552fe296612eb336bc8168;hp=289af65b68cb2f37ddf3c392cf9c67572dd5560b;hb=df7e3ff9f68ef157b0328a2d353c3258c5d45d89;hpb=2ad3477dcd6a01628712b32e767353f917f2a95a diff --git a/pintail.h b/pintail.h index 289af65..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,73 +24,59 @@ class Pintail : public Chimera { public: - Pintail(string, 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; - int iters; - string fastafile, templateFile, consfile, quanfile; - - vector lines; - vector querySeqs; - vector templateSeqs; + DeCalculator* decalc; + int iters, window, increment, processors; + string fastafile, quanfile, consfile; - vector bestfit; //bestfit[0] matches queryseqs[0]... + vector templateLines; + Sequence* querySeq; + + Sequence* bestfit; //closest match to query in template - vector< vector > obsDistance; //obsDistance[0] is the vector of observed distances for queryseqs[0]... - vector< vector > expectedDistance; //expectedDistance[0] is the vector of expected distances for queryseqs[0]... - vector deviation; //deviation[0] is the percentage of mismatched pairs over the whole seq between querySeqs[0] and its best match. - vector< vector > windows; // windows[0] is a vector containing the starting spot in queryseqs[0] aligned sequence for each window. + 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 - vector windowSizes; //windowSizes[0] = window size of querySeqs[0] + int windowSizes; //windowSizes = window size of query + vector windowSizesTemplate; //windowSizesTemplate[0] = window size of templateSeqs[0] - vector< map > trimmed; //trimmed[0] = start and stop of trimmed sequences for querySeqs[0] + map trimmed; //trimmed = start and stop of trimmed sequences for query map::iterator it; - vector< vector > Qav; //Qav[0] is the vector of average variablility for queryseqs[0]... - vector seqCoef; //seqCoef[0] is the coeff for queryseqs[0]... - vector DE; //DE[0] is the deviaation for queryseqs[0]... + 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; - vector readSeqs(string); - map trimSeqs(Sequence*, Sequence, int); - vector readFreq(); vector< vector > readQuantiles(); - vector< vector > getQuantiles(int, int); - vector calcFreq(vector); - - - vector findPairs(int, int); - vector findWindows(Sequence*, int, int, int&); - vector calcObserved(Sequence*, Sequence, vector, int); - vector calcExpected(vector, float); - vector findQav(vector, int); - float calcDE(vector, vector); - float calcDist(Sequence*, Sequence, int, int); - float getCoef(vector, vector); - - void createProcessesSpots(); - void createProcesses(); + vector readFreq(); + Sequence* findPairs(Sequence*); + void createProcessesQuan(); - - + int doPrep(); + void printQuanFile(string, string); };