]> git.donarmstrong.com Git - mothur.git/blob - sharedrabundfloatvector.h
added sharedRabundFloatVector class to represent the relabund file. modified read...
[mothur.git] / sharedrabundfloatvector.h
1 #ifndef SHAREDRABUNDFLOATVECTOR_H
2 #define SHAREDRABUNDFLOATVECTOR_H
3
4 /*
5  *  sharedrabundfloatvector.h
6  *  Mothur
7  *
8  *  Created by westcott on 8/18/10.
9  *  Copyright 2010 Schloss Lab. All rights reserved.
10  *
11  */
12
13
14 #include "datavector.hpp"
15 #include "sharedordervector.h"
16 #include "sharedsabundvector.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 individualFloat. 
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 SharedRAbundFloatVector : public DataVector {
29         
30 public:
31         SharedRAbundFloatVector();
32         SharedRAbundFloatVector(int);
33         SharedRAbundFloatVector(const SharedRAbundFloatVector& bv) : DataVector(bv), data(bv.data), maxRank(bv.maxRank), numBins(bv.numBins), numSeqs(bv.numSeqs), group(bv.group), index(bv.index){};
34     SharedRAbundFloatVector(ifstream&);
35         ~SharedRAbundFloatVector();
36
37         int getNumBins();               
38         float getNumSeqs();                                                     
39         float getMaxRank();
40         string getGroup();
41         void setGroup(string);
42         int getGroupIndex();
43         void setGroupIndex(int);                                                                
44
45         void set(int, float, string);                   //OTU, abundance, groupname
46         individualFloat get(int);
47         vector <individual> getData();
48         float getAbundance(int);
49         void push_front(float, int, string); //abundance, otu, groupname
50         void insert(float, int, string); //abundance, otu, groupname
51         void push_back(float, string);  //abundance, groupname
52         void pop_back();
53         void resize(int);
54         int size();
55         
56         void print(ostream&);
57                 
58         RAbundVector getRAbundVector();
59         SAbundVector getSAbundVector();
60         OrderVector getOrderVector(map<string,int>*);
61         //SharedOrderVector getSharedOrderVector();
62         //SharedSAbundVector getSharedSAbundVector();
63         //SharedRAbundVector getSharedRAbundVector();
64         SharedRAbundFloatVector getSharedRAbundFloatVector();
65         vector<SharedRAbundFloatVector*> getSharedRAbundFloatVectors();
66         
67 private:
68         vector<individualFloat>  data; 
69         vector<SharedRAbundFloatVector*> lookup;
70         GlobalData* globaldata;
71         GroupMap* groupmap;
72         float maxRank;
73         int numBins;
74         float numSeqs;
75         string group;
76         int index;      
77 };
78
79
80 #endif
81
82