]> git.donarmstrong.com Git - mothur.git/blob - pintail.h
*** empty log message ***
[mothur.git] / pintail.h
1 #ifndef PINTAIL_H
2 #define PINTAIL_H
3
4 /*
5  *  pintail.h
6  *  Mothur
7  *
8  *  Created by Sarah Westcott on 7/9/09.
9  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10  *
11  */
12
13 #include "chimera.h"
14 #include "dist.h"
15
16 //This class was created using the algorythms described in the 
17 // "At Least 1 in 20 16S rRNA Sequence Records Currently Held in the Public Repositories is Estimated To Contain Substantial Anomalies" paper 
18 //by Kevin E. Ashelford 1, Nadia A. Chuzhanova 3, John C. Fry 1, Antonia J. Jones 2 and Andrew J. Weightman 1.
19
20 /***********************************************************/
21
22 class Pintail : public Chimera {
23         
24         public:
25                 Pintail(string);        
26                 ~Pintail();
27                 
28                 void getChimeras();
29                 void print(ostream&);
30                 
31                 
32         private:
33         
34                 struct linePair {
35                         int start;
36                         int end;
37                         linePair(int i, int j) : start(i), end(j) {}
38                 };
39
40         
41                 Dist* distCalculator;
42                 string fastafile;
43                 int iters;
44                 vector<linePair*> lines;
45                 vector<Sequence*> querySeqs;
46                 vector<Sequence*> templateSeqs;
47                 
48                 map<Sequence*, Sequence*> bestfit;  //maps a query sequence to its most similiar sequence in the template
49                 map<Sequence*, Sequence*>::iterator itBest;
50                 
51                 map<Sequence*, vector<float> > obsDistance;  //maps a query sequence to its observed distance at each window
52                 map<Sequence*, vector<float> > expectedDistance;  //maps a query sequence to its expected distance at each window
53                 map<Sequence*, vector<float> >::iterator itObsDist;
54                 map<Sequence*, vector<float> >::iterator itExpDist;
55                 
56                 vector<float> averageProbability;                       //Qav
57                 map<Sequence*, float> seqCoef;                          //maps a sequence to its coefficient
58                 map<Sequence*, float> DE;                                       //maps a sequence to its deviation
59                 map<Sequence*, float>::iterator itCoef; 
60                 
61                 vector<Sequence*> readSeqs(string);
62                 vector<float> findQav(vector<float>);
63                 vector<float> calcFreq(vector<Sequence*>);
64                 map<Sequence*, float> getCoef(vector<float>);
65                 
66                 void findPairs(int, int);
67                 void calcObserved(int, int);
68                 void calcExpected(int, int);
69                 void calcDE(int, int);
70         
71                 void createProcessesPairs();
72                 void createProcessesObserved();
73                 void createProcessesExpected();
74                 void createProcessesDE();
75                 
76 };
77
78 /***********************************************************/
79
80 #endif
81