]> git.donarmstrong.com Git - mothur.git/blob - chimera.h
checking in chimera files in progress after move to michigan
[mothur.git] / chimera.h
1 #ifndef CHIMERA_H
2 #define CHIMERA_H
3
4 /*
5  *  chimera.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
14 #include "mothur.h"
15 #include "sequence.hpp"
16
17
18 struct Preference {
19                 string name;
20                 vector<string> leftParent; //keep the name of closest left associated with the two scores
21                 vector<string> rightParent; //keep the name of closest right associated with the two scores
22                 vector<float> score;  //so you can keep last score and calc this score and keep whichever is bigger.
23                 vector<float> closestLeft;  //keep the closest left associated with the two scores
24                 vector<float> closestRight; //keep the closest right associated with the two scores
25                 int midpoint;
26
27 };
28
29 struct SeqDist {
30         Sequence* seq;
31         float dist;
32 };
33
34 //********************************************************************************************************************
35 //sorts lowest to highest
36 inline bool compareSeqDist(SeqDist left, SeqDist right){
37         return (left.dist < right.dist);        
38
39 //********************************************************************************************************************
40
41 struct sim {
42                 Sequence* leftParent;
43                 Sequence* rightParent; 
44                 float score;  
45                 int midpoint;
46 };
47
48 struct linePair {
49                         int start;
50                         int end;
51                         linePair(int i, int j) : start(i), end(j) {}
52                         linePair(){}
53 };
54
55 /***********************************************************************/
56
57 class Chimera {
58
59         public:
60         
61                 Chimera(){};
62                 Chimera(string);
63                 Chimera(string, string);
64                 virtual ~Chimera(){};
65                 virtual void setFilter(bool f)                  {       filter = f;                     }
66                 virtual void setCorrection(bool c)              {       correction = c;         }
67                 virtual void setProcessors(int p)               {       processors = p;         }
68                 virtual void setWindow(int w)                   {       window = w;                     }
69                 virtual void setIncrement(int i)                {       increment = i;          }
70                 virtual void setNumWanted(int n)                {       numWanted = n;          }
71                 
72                 virtual void setCons(string){};
73                 virtual void setQuantiles(string){};
74                 virtual vector<Sequence*> readSeqs(string);
75                 virtual vector< vector<float> > readQuantiles();
76                 virtual void setMask(string);
77                 virtual void runFilter(vector<Sequence*>);
78                 virtual void createFilter(vector<Sequence*>);
79                 
80                 
81                 //pure functions
82                 virtual void getChimeras() = 0; 
83                 virtual void print(ostream&) = 0;       
84                 
85         protected:
86                 
87                 bool filter, correction;
88                 int processors, window, increment, numWanted;
89                 string seqMask, quanfile, filterString;
90                         
91
92 };
93
94 /***********************************************************************/
95
96 #endif
97