]> git.donarmstrong.com Git - mothur.git/blob - sharedsabundvector.h
finishing the container classes, combining read.otu and read.list commands. some...
[mothur.git] / sharedsabundvector.h
1 #ifndef SHAREDSABUND_H
2 #define SHAREDSABUND_H
3
4
5 /*
6  *  sharedSharedSAbundVector.h
7  *  Dotur
8  *
9  *  Created by Sarah Westcott on 12/10/08.
10  *  Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
11  *
12  */
13
14
15 #include <Carbon/Carbon.h>
16 #include "datavector.hpp"
17 #include "rabundvector.hpp"
18 #include "ordervector.hpp"
19 #include "sharedordervector.h"
20 #include "sharedrabundvector.h"
21
22 /* This class is a child to datavector.  It represents OTU information at a certain distance. 
23         It is similiar to an sabundvector except each member of data knows which group it belongs to.
24         Each member of the internal container "data" is a struct of type individual. 
25         An individual which knows the OTU from which it came, 
26         the group it is in and its abundance.  */
27
28 using namespace std;
29
30 class SharedSAbundVector : public DataVector {
31         
32 public:
33         SharedSAbundVector();
34         SharedSAbundVector(int);
35         SharedSAbundVector(const SharedSAbundVector& rv) : DataVector(rv.label), data(rv.data), maxRank(rv.maxRank), numBins(rv.numBins), numSeqs(rv.numSeqs){};
36         ~SharedSAbundVector(){};
37
38         int getNumBins();       
39         int getNumSeqs();       
40         int getMaxRank();       
41         string getGroup();
42         void setGroup(string);  
43         
44         void set(int, int, string);      //OTU, abundance, group
45         individual get(int);
46         int getAbundance(int);
47         void push_back(int, int, string);       //abundance, OTU, group
48         void pop_back();
49         void resize(int);
50         int size();
51
52         void print(ostream&);
53                 
54         RAbundVector getRAbundVector(); 
55         SAbundVector getSAbundVector();
56         OrderVector getOrderVector(map<string,int>*);
57         SharedSAbundVector getSharedSAbundVector();
58         SharedRAbundVector getSharedRAbundVector();
59         SharedOrderVector getSharedOrderVector();
60         
61 private:
62         vector<individual> data;
63         
64         int maxRank;
65         int numBins;
66         int numSeqs;
67         string group;
68 };
69
70 #endif
71