]> git.donarmstrong.com Git - mothur.git/blob - sabundvector.hpp
changes to blastdb to make filenames given to blast unique, changes to split.abund...
[mothur.git] / sabundvector.hpp
1 #ifndef SABUND_H
2 #define SABUND_H
3
4 #include "datavector.hpp"
5 #include "rabundvector.hpp"
6 #include "ordervector.hpp"
7 #include "calculator.h"
8
9
10 /* This class is a child to datavector.  It represents OTU information at a certain distance. 
11         A sabundvector can be converted into and ordervector, listvector or rabundvector.
12         Each member of the internal container "data" represents the number of OTU's with that many members, but staring at 1.
13         So data[1] = 2, because there are two OTUs with 1 member.
14         example: listvector             =       a,b,c,d,e,f             g,h,i           j,k             l               m  
15                          rabundvector   =       6                               3                       2               1               1
16                          sabundvector   =       2               1               1               0               0               1
17                          ordervector    =       1       1       1       1       1       1       2       2       2       3       3       4       5 */
18
19
20 class SAbundVector : public DataVector {
21         
22 public:
23         SAbundVector();
24         SAbundVector(int);
25 //      SAbundVector(const SAbundVector&);
26         SAbundVector(vector<int>, int, int, int);
27         SAbundVector(string, vector<int>);
28         SAbundVector(const SAbundVector& rv) : DataVector(rv.label), data(rv.data), maxRank(rv.maxRank), numBins(rv.numBins), numSeqs(rv.numSeqs){};
29         SAbundVector(ifstream&);
30         ~SAbundVector(){};
31
32         int getNumBins();       
33         int getNumSeqs();       
34         int getMaxRank();       
35         
36         void set(int, int);
37         int get(int);
38         void push_back(int);
39         void quicksort();
40         int sum();
41         void resize(int);
42         int size();
43
44         void print(ostream&);
45         void print(string, ostream&);
46                 
47         RAbundVector getRAbundVector();         
48         SAbundVector getSAbundVector();
49         OrderVector getOrderVector(map<string,int>*);
50         
51 private:
52         vector<int> data;
53 //      bool needToUpdate;
54 //      void updateStats();
55         
56         int maxRank;
57         int numBins;
58         int numSeqs;
59
60 };
61
62 #endif