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