]> git.donarmstrong.com Git - mothur.git/blob - sharedrabundfloatvector.h
pca command
[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         void clear();
55         int size();
56         
57         void print(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