]> git.donarmstrong.com Git - mothur.git/blob - rabundvector.hpp
started shared utilities, updates to venn and heatmap added tree.groups command
[mothur.git] / rabundvector.hpp
1 #ifndef RABUND_H
2 #define RABUND_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 rabundvector can be converted into and ordervector, listvector or sabundvector.
8         Each member of the internal container "data" represents an individual OTU.
9         So data[0] = 6, because there are six member in that OTU.
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 SAbundVector;
16 //class OrderVector;
17
18 class RAbundVector : public DataVector {
19         
20 public:
21         RAbundVector();
22         RAbundVector(int);
23         RAbundVector(vector<int>, int, int, int);
24 //      RAbundVector(const RAbundVector&);
25         RAbundVector(string, vector<int>);
26         RAbundVector(const RAbundVector& bv) : DataVector(bv), data(bv.data), maxRank(bv.maxRank), numBins(bv.numBins), numSeqs(bv.numSeqs){};
27         RAbundVector(ifstream&);
28         ~RAbundVector();
29
30         int getNumBins();               
31         int getNumSeqs();                                                       
32         int getMaxRank();                                                       
33
34         void set(int, int);     
35         int get(int);
36         void push_back(int);
37         void pop_back();
38         void resize(int);
39         int size();
40         void quicksort();
41         int sum();
42         int sum(int);
43         int numNZ();
44         vector<int>::reverse_iterator rbegin();
45         vector<int>::reverse_iterator rend();
46         
47         void print(ostream&);
48         void print(string, ostream&);
49         
50         RAbundVector getRAbundVector();
51         SAbundVector getSAbundVector();
52         OrderVector getOrderVector(map<string,int>*);
53         
54 private:
55         vector<int> data;
56         int maxRank;
57         int numBins;
58         int numSeqs;    
59 };
60
61
62 #endif