1 #ifndef SHAREDRABUNDVECTOR_H
2 #define SHAREDRABUNDVECTOR_H
8 * Created by Sarah Westcott on 12/5/08.
9 * Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
13 #include "datavector.hpp"
14 #include "sharedordervector.h"
15 #include "sharedsabundvector.h"
16 #include "sharedrabundfloatvector.h"
17 #include "rabundvector.hpp"
18 //#include "groupmap.h"
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. */
28 class SharedRAbundVector : public DataVector {
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();
42 void setGroup(string);
44 void setBinLabel(string);
46 void setGroupIndex(int);
48 void set(int, int, string); //OTU, abundance, groupname
49 void setData(vector <individual>);
51 vector <individual> getData();
52 int getAbundance(int);
54 void sortD(); //Sorts the data in descending order.
55 void push_front(int, int, string); //abundance, otu, groupname
56 void insert(int, int, string); //abundance, otu, groupname
57 void push_back(int, string); //abundance, groupname
62 vector<individual>::reverse_iterator rbegin();
63 vector<individual>::reverse_iterator rend();
66 void printHeaders(ostream&);
68 RAbundVector getRAbundVector();
69 RAbundVector getRAbundVector2();
70 SAbundVector getSAbundVector();
71 OrderVector getOrderVector(map<string,int>*);
72 SharedOrderVector getSharedOrderVector();
73 SharedSAbundVector getSharedSAbundVector();
74 SharedRAbundVector getSharedRAbundVector();
75 vector<SharedRAbundVector*> getSharedRAbundVectors();
76 vector<SharedRAbundFloatVector*> getSharedRAbundFloatVectors(vector<SharedRAbundVector*>);
79 vector<individual> data;
80 vector<SharedRAbundVector*> lookup;
81 //GlobalData* globaldata;
89 int eliminateZeroOTUS(vector<SharedRAbundVector*>&);