]> git.donarmstrong.com Git - mothur.git/blob - ccode.h
added more descriptive error messages to sharedlist
[mothur.git] / ccode.h
1 #ifndef CCODE_H
2 #define CCODE_H
3
4 /*
5  *  ccode.h
6  *  Mothur
7  *
8  *  Created by westcott on 8/24/09.
9  *  Copyright 2009 Schloss LAB. All rights reserved.
10  *
11  */
12
13 #include "chimera.h"
14 #include "dist.h"
15 #include "decalc.h"
16
17 //This class was created using the algorythms described in the 
18 // "Evaluating putative chimeric sequences from PCR-amplified products" paper 
19 //by Juan M. Gonzalez, Johannes Zimmerman and Cesareo Saiz-Jimenez.
20
21 /***********************************************************/
22
23 class Ccode : public Chimera {
24         
25         public:
26                 Ccode(string, string);  
27                 ~Ccode();
28                 
29                 void getChimeras();
30                 void print(ostream&);
31                 
32                 void setCons(string c)          {}
33                 void setQuantiles(string q) {}
34                 
35                 
36         private:
37         
38                 Dist* distCalc;
39                 DeCalculator* decalc;
40                 int iters;
41                 string fastafile, templateFile;
42                 
43                 
44                 vector<linePair*> lines;
45                 vector<linePair*> templateLines;
46                 vector<Sequence*> querySeqs;
47                 vector<Sequence*> templateSeqs;
48                 
49                 vector<int> windows;
50                 vector< vector<Sequence*> > closest;  //closest[0] is a vector of sequence at are closest to queryseqs[0]...
51                 vector< vector<float> > averageRef;  //averageRef[0] is the average distance at each window for the references for querySeqs[0]
52                 vector< vector<float> > averageQuery;  //averageQuery[0] is the average distance at each winow for the query for querySeqs[0]
53                 
54                 vector< vector<Sequence*> > findClosest(int, int, int); 
55                 void removeBadReferenceSeqs(vector<Sequence*>&, int);  //removes sequences from closest that are to different of too similar to eachother. 
56                 void trimSequences();
57                 vector<int> findWindows();
58                 vector<float> getAverageRef(vector<Sequence*>);
59                 vector<float> getAverageQuery (vector<Sequence*>, int);
60                 
61                 
62                 int getDiff(string, string);  //return number of mismatched bases, a gap to base is not counted as a mismatch
63                 
64                 void createProcessesClosest();
65                 
66 };
67
68 /***********************************************************/
69
70 #endif
71
72