]> git.donarmstrong.com Git - mothur.git/blob - sharedrabundfloatvector.h
sffinfo bug with flow grams right index when clipQualRight=0
[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
27 class SharedRAbundFloatVector : public DataVector {
28         
29 public:
30         SharedRAbundFloatVector();
31         SharedRAbundFloatVector(int);
32         SharedRAbundFloatVector(const SharedRAbundFloatVector& bv) : DataVector(bv), data(bv.data), maxRank(bv.maxRank), numBins(bv.numBins), numSeqs(bv.numSeqs), group(bv.group), index(bv.index){};
33     SharedRAbundFloatVector(ifstream&);
34         ~SharedRAbundFloatVector();
35
36         int getNumBins();               
37         float getNumSeqs();                                                     
38         float getMaxRank();
39         string getGroup();
40         void setGroup(string);
41         int getGroupIndex();
42         void setGroupIndex(int);                                                                
43
44         void set(int, float, string);                   //OTU, abundance, groupname
45         individualFloat get(int);
46         vector <individual> getData();
47         float getAbundance(int);
48         void push_front(float, int, string); //abundance, otu, groupname
49         void insert(float, int, string); //abundance, otu, groupname
50         void push_back(float, string);  //abundance, groupname
51         void pop_back();
52         void resize(int);
53         void clear();
54         int size();
55         
56         void print(ostream&);
57         void printHeaders(ostream&);
58                 
59         RAbundVector getRAbundVector();
60         SAbundVector getSAbundVector();
61         OrderVector getOrderVector(map<string,int>*);
62         //SharedOrderVector getSharedOrderVector();
63         //SharedSAbundVector getSharedSAbundVector();
64         //SharedRAbundVector getSharedRAbundVector();
65         SharedRAbundFloatVector getSharedRAbundFloatVector();
66         vector<SharedRAbundFloatVector*> getSharedRAbundFloatVectors();
67         
68 private:
69         vector<individualFloat>  data; 
70         vector<SharedRAbundFloatVector*> lookup;
71         //GlobalData* globaldata;
72         //GroupMap* groupmap;
73         float maxRank;
74         int numBins;
75         float numSeqs;
76         string group;
77         int index;      
78         
79         int eliminateZeroOTUS(vector<SharedRAbundFloatVector*>&);
80 };
81
82
83 #endif
84
85