]> git.donarmstrong.com Git - mothur.git/blob - chimera.h
finished chimeraslayer method and added get.listcount command
[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                 string leftParent;
43                 string 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                 virtual void setKmerSize(int k)                 {       kmerSize = k;           }
72                 virtual void setSVG(int s)                              {       svg = s;                        }
73                 virtual void setName(string n)                  {       name = n;                       }
74                 virtual void setMatch(int m)                    {       match = m;                      }
75                 virtual void setMisMatch(int m)                 {       misMatch = m;           }
76                 virtual void setDivR(float d)                   {       divR = d;                       }
77                 virtual void setParents(int p)                  {       parents = p;            }
78                 virtual void setMinSim(int s)                   {       minSim = s;                     }
79                 virtual void setIters(int i)                    {       iters = i;                      }
80
81                 
82                 virtual void setCons(string){};
83                 virtual void setQuantiles(string){};
84                 virtual vector<Sequence*> readSeqs(string);
85                 virtual vector< vector<float> > readQuantiles();
86                 virtual void setMask(string);
87                 virtual void runFilter(vector<Sequence*>);
88                 virtual void createFilter(vector<Sequence*>);
89                 
90                 
91                 //pure functions
92                 virtual void getChimeras() = 0; 
93                 virtual void print(ostream&) = 0;       
94                 
95         protected:
96                 
97                 bool filter, correction, svg;
98                 int processors, window, increment, numWanted, kmerSize, match, misMatch, minSim, parents, iters;
99                 float divR;
100                 string seqMask, quanfile, filterString, name;
101                         
102
103 };
104
105 /***********************************************************************/
106
107 #endif
108