]> git.donarmstrong.com Git - mothur.git/blob - sharedrabundvector.h
added headers to shared and relabund files
[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 "sharedrabundfloatvector.h"
17 #include "rabundvector.hpp"
18 //#include "groupmap.h"
19
20 /* This class is a child to datavector.  It represents OTU information at a certain distance. 
21         It is similiar to an rabundvector except each member of data knows which group it belongs to.
22         Each member of the internal container "data" is a struct of type individual. 
23         An individual which knows the OTU from which it came, 
24         the group it is in and its abundance.  */
25
26 //class GlobalData;
27
28 class SharedRAbundVector : public DataVector {
29         
30 public:
31         SharedRAbundVector();
32         SharedRAbundVector(int);
33         //SharedRAbundVector(string, vector<int>);
34         SharedRAbundVector(const SharedRAbundVector& bv) : DataVector(bv), data(bv.data), maxRank(bv.maxRank), numBins(bv.numBins), numSeqs(bv.numSeqs), group(bv.group), index(bv.index){};
35     SharedRAbundVector(ifstream&);
36         ~SharedRAbundVector();
37
38         int getNumBins();               
39         int getNumSeqs();                                                       
40         int getMaxRank();
41         string getGroup();
42         void setGroup(string);
43         int getGroupIndex();
44         void setGroupIndex(int);                                                                
45
46         void set(int, int, string);                     //OTU, abundance, groupname
47         void setData(vector <individual>);
48         individual get(int);
49         vector <individual> getData();
50         int getAbundance(int);
51         int numNZ();
52         void sortD();  //Sorts the data in descending order.
53         void push_front(int, int, string); //abundance, otu, groupname
54         void insert(int, int, string); //abundance, otu, groupname
55         void push_back(int, string);  //abundance, groupname
56         void pop_back();
57         void resize(int);
58         int size();
59         void clear();
60         vector<individual>::reverse_iterator rbegin();
61         vector<individual>::reverse_iterator rend();
62         
63         void print(ostream&);
64         void printHeaders(ostream&);
65                 
66         RAbundVector getRAbundVector();
67         RAbundVector getRAbundVector2();
68         SAbundVector getSAbundVector();
69         OrderVector getOrderVector(map<string,int>*);
70         SharedOrderVector getSharedOrderVector();
71         SharedSAbundVector getSharedSAbundVector();
72         SharedRAbundVector getSharedRAbundVector();
73         vector<SharedRAbundVector*> getSharedRAbundVectors();
74         vector<SharedRAbundFloatVector*> getSharedRAbundFloatVectors(vector<SharedRAbundVector*>);
75         
76 private:
77         vector<individual>  data; 
78         vector<SharedRAbundVector*> lookup;
79         //GlobalData* globaldata;
80         //GroupMap* groupmap;
81         int maxRank;
82         int numBins;
83         int numSeqs;
84         string group;
85         int index;      
86         
87         int eliminateZeroOTUS(vector<SharedRAbundVector*>&);
88 };
89
90
91 #endif
92