]> git.donarmstrong.com Git - mothur.git/blob - listvector.hpp
added mothur.h and fixed includes in many files
[mothur.git] / listvector.hpp
1 #ifndef LIST_H
2 #define LIST_H
3
4 #include "datavector.hpp"
5
6 /* This class is a child to datavector.  It represents OTU information at a certain distance. 
7         A list vector can be converted into and ordervector, rabundvector or sabundvector.
8         Each member of the internal container "data" represents an individual OTU.
9         So data[0] = "a,b,c,d,e,f".
10         example: listvector             =       a,b,c,d,e,f             g,h,i           j,k             l               m  
11                          rabundvector   =       6                               3                       2               1               1
12                          sabundvector   =       2               1               1               0               0               1
13                          ordervector    =       1       1       1       1       1       1       2       2       2       3       3       4       5 */
14
15 class ListVector : public DataVector {
16         
17 public:
18         ListVector();
19         ListVector(int);
20 //      ListVector(const ListVector&);
21         ListVector(string, vector<string>);
22         ListVector(const ListVector& lv) : DataVector(lv.label), data(lv.data), maxRank(lv.maxRank), numBins(lv.numBins), numSeqs(lv.numSeqs){};
23         ListVector(ifstream&);
24         ~ListVector(){};
25         
26         int getNumBins()                                                        {       return numBins;         }
27         int getNumSeqs()                                                        {       return numSeqs;         }
28         int getMaxRank()                                                        {       return maxRank;         }
29
30         void set(int, string);  
31         string get(int);
32         void push_back(string);
33         void resize(int);
34         void clear();
35         int size();
36         void print(ostream&);
37         
38         RAbundVector getRAbundVector();
39         SAbundVector getSAbundVector();
40         OrderVector getOrderVector(map<string,int>*);
41         
42 private:
43         vector<string> data;  //data[i] is a list of names of sequences in the ith OTU.
44         int maxRank;
45         int numBins;
46         int numSeqs;
47
48 };
49
50 #endif