]> git.donarmstrong.com Git - mothur.git/blob - sharedrabundvector.h
added the Calculators Thomas made in the fall. Added parameter and command error...
[mothur.git] / sharedrabundvector.h
1 #ifndef SHAREDRABUNDVECTOR_H
2 #define SHAREDRABUNDVECTOR_H
3
4 /*
5  *  sharedrabundvector.h
6  *  Dotur
7  *
8  *  Created by Sarah Westcott on 12/5/08.
9  *  Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
10  *
11  */
12
13 #include "datavector.hpp"
14 #include "sharedordervector.h"
15 #include "sharedsabundvector.h"
16 #include "rabundvector.hpp"
17
18 /* This class is a child to datavector.  It represents OTU information at a certain distance. 
19         It is similiar to an rabundvector except each member of data knows which group it belongs to.
20         Each member of the internal container "data" is a struct of type individual. 
21         An individual which knows the OTU from which it came, 
22         the group it is in and its abundance.  */
23
24
25
26 class SharedRAbundVector : public DataVector {
27         
28 public:
29         SharedRAbundVector();
30         SharedRAbundVector(int);
31         //SharedRAbundVector(string, vector<int>);
32         SharedRAbundVector(const SharedRAbundVector& bv) : DataVector(bv), data(bv.data), maxRank(bv.maxRank), numBins(bv.numBins), numSeqs(bv.numSeqs){};
33     //SharedRAbundVector(ifstream&);
34         ~SharedRAbundVector();
35
36         int getNumBins();               
37         int getNumSeqs();                                                       
38         int getMaxRank();
39         string getGroup();
40         void setGroup(string);
41         int getGroupIndex();
42         void setGroupIndex(int);                                                                
43
44         void set(int, int, string);                     //OTU, abundance, groupname
45         void setData(vector <individual>);
46         individual get(int);
47         vector <individual> getData();
48         int getAbundance(int);
49         int numNZ();
50         void sortD();  //Sorts the data in descending order.
51         void push_back(int, int, string);  //abundance, OTU, groupname
52         void pop_back();
53         void resize(int);
54         int size();
55         vector<individual>::reverse_iterator rbegin();
56         vector<individual>::reverse_iterator rend();
57         
58         void print(ostream&);
59                 
60         RAbundVector getRAbundVector();
61         RAbundVector getRAbundVector2();
62         SAbundVector getSAbundVector();
63         OrderVector getOrderVector(map<string,int>*);
64         SharedOrderVector getSharedOrderVector();
65         SharedSAbundVector getSharedSAbundVector();
66         SharedRAbundVector getSharedRAbundVector();
67         
68 private:
69         vector<individual>  data; 
70         int maxRank;
71         int numBins;
72         int numSeqs;
73         string group;
74         int index;      
75 };
76
77
78 #endif
79