]> git.donarmstrong.com Git - mothur.git/blobdiff - pintail.h
chimeras
[mothur.git] / pintail.h
index 797c99e1543ace2df4a142015a17fe56eaf4f033..ed52c3aa0d010c70bd99bb045ac3715a5d8cb94e 100644 (file)
--- 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.
@@ -25,61 +27,51 @@ class Pintail : public Chimera {
                Pintail(string, string);        
                ~Pintail();
                
-               void getChimeras();
+               int getChimeras(Sequence*);
                void print(ostream&);
                
-               void setCons(string c) { consfile = c;  }
+               void setCons(string c)          { consfile = c;  }
+               void setQuantiles(string q) { quanfile = q;  }
                
                
        private:
        
-               struct linePair {
-                       int start;
-                       int end;
-                       linePair(int i, int j) : start(i), end(j) {}
-               };
-
                Dist* distcalculator;
+               DeCalculator* decalc;
                int iters;
-               string fastafile, templateFile, consfile;
-               vector<linePair*> lines;
-               vector<Sequence*> querySeqs;
-               vector<Sequence*> templateSeqs;
+               string fastafile, consfile;
                
-               vector<Sequence> bestfit;  //bestfit[0] matches queryseqs[0]...
+               vector<linePair*> templateLines;
+               Sequence*querySeq;
+                               
+               Sequence* bestfit;  //closest match to query in template
                
-               vector< vector<float> > obsDistance;  //obsDistance[0] is the vector of observed distances for queryseqs[0]... 
-               vector< vector<float> > expectedDistance;  //expectedDistance[0] is the vector of expected distances for queryseqs[0]... 
-               vector<float> deviation;  //deviation[0] is the percentage of mismatched pairs over the whole seq between querySeqs[0] and its best match.
-               vector< vector<int> > windows;  // windows[0] is a vector containing the starting spot in queryseqs[0] aligned sequence for each window.
+               vector<float>  obsDistance;  //obsDistance is the vector of observed distances for query 
+               vector<float>  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<int>  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< map<int, int> >  trim;  //trim[0] is the start and end position of trimmed querySeqs[0].  Used to find the variability over each sequence window.
                                                                                
-               vector<int> windowSizes;    //windowSizes[0] = window size of querySeqs[0]
-               
-               vector< vector<float> > Qav;    //Qav[0] is the vector of average variablility for queryseqs[0]... 
-               vector<float>  seqCoef;                         //seqCoef[0] is the coeff for queryseqs[0]...
-               vector<float> DE;                                       //DE[0] is the deviaation for queryseqs[0]...
-               vector<float> probabilityProfile;
+               int windowSizes;                        //windowSizes = window size of query
+               vector<int> windowSizesTemplate;    //windowSizesTemplate[0] = window size of templateSeqs[0]
                
-               vector<Sequence*> readSeqs(string);
-               void trimSeqs(Sequence*, Sequence&, int);
-               vector<float> readFreq();
-               vector< vector<float> > findQav(int, int);  
-               vector<float> calcFreq(vector<Sequence*>);
-               vector<float> getCoef(int, int);
+               map<int, int> trimmed;    //trimmed = start and stop of trimmed sequences for query
+               map<int, int>::iterator it;
                
-               vector<Sequence> findPairs(int, int);
-               vector< vector<int> > findWindows(int, int);
-               vector< vector<float> > calcObserved(int, int);
-               vector< vector<float> > calcExpected(int, int);
-               vector<float> calcDE(int, int);
-               vector<float> calcDist(int, int);
-       
-               void createProcessesSpots();
-               void createProcesses();
+               vector<float>  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<float> probabilityProfile;
+               vector< vector<float> > 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<quanMember> > 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<int>  h;
                
                
+               vector<float> readFreq();
+               Sequence* findPairs(Sequence*);
+                       
+               void createProcessesQuan();
+               void doPrep();
                
 };