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