]> git.donarmstrong.com Git - mothur.git/blob - chimera.h
worked on chimeras
[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 "sparsematrix.hpp"
16 #include "sequence.hpp"
17
18 typedef list<PCell>::iterator MatData;
19 typedef map<int, float> SeqMap;  //maps sequence to all distance for that seqeunce
20
21
22 /***********************************************************************/
23
24 class Chimera {
25
26         public:
27         
28                 Chimera(){};
29                 Chimera(string);
30                 Chimera(string, string);
31                 virtual ~Chimera(){};
32                 virtual void setFilter(bool f)                  {       filter = f;                     }
33                 virtual void setCorrection(bool c)              {       correction = c;         }
34                 virtual void setProcessors(int p)               {       processors = p;         }
35                 virtual void setWindow(int w)                   {       window = w;                     }
36                 virtual void setIncrement(int i)                {       increment = i;          }
37                 
38                 virtual void setCons(string) {};
39                 virtual void setQuantiles(string) {};
40                 
41                 virtual vector<Sequence*> readSeqs(string file) {
42                         try {
43                                 ifstream in;
44                                 openInputFile(file, in);
45                                 vector<Sequence*> container;
46                                 
47                                 //read in seqs and store in vector
48                                 while(!in.eof()){
49
50                                         Sequence* current = new Sequence(in);
51                                         container.push_back(current);
52                                         gobble(in);
53                                 }
54                                 
55                                 in.close();
56                                 return container;
57                         }
58                         catch(exception& e) {
59                                 errorOut(e, "Chimera", "readSeqs");
60                                 exit(1);
61                         }
62                 }
63                 
64                 
65                 //pure functions
66                 virtual void getChimeras() = 0; 
67                 virtual void print(ostream&) = 0;       
68                 
69         protected:
70                 
71                 bool filter, correction;
72                 int processors, window, increment;
73                         
74
75 };
76
77 /***********************************************************************/
78
79 #endif
80