7 * Created by Sarah Westcott on 12/9/08.
8 * Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
12 /* This class is a child to datavector. It represents OTU information at a certain distance.
13 It is similiar to an order vector except each member of data knows which group it belongs to.
14 Each member of the internal container "data" represents is an individual which knows the OTU from which it came,
15 the group it is in and the abundance is equal to the OTU number. */
20 #include "datavector.hpp"
26 bool operator()(const individual& i1, const individual& i2) {
27 return (i1.abundance > i2.abundance);
31 #include "sabundvector.hpp"
32 #include "rabundvector.hpp"
33 #include "sharedrabundvector.h"
34 #include "sharedsabundvector.h"
35 #include "globaldata.hpp"
37 //#include "globaldata.hpp"
41 class SharedOrderVector : public DataVector {
45 // SharedOrderVector(int ns, int nb=0, int mr=0) : DataVector(), data(ns, -1), maxRank(0), numBins(0), numSeqs(0) {};
46 SharedOrderVector(const SharedOrderVector& ov) : DataVector(ov.label), data(ov.data), maxRank(ov.maxRank), numBins(ov.numBins), numSeqs(ov.numSeqs), needToUpdate(ov.needToUpdate) {if(needToUpdate == 1){ updateStats();}};
48 SharedOrderVector(string, vector<individual>);
49 SharedOrderVector(ifstream&);
50 ~SharedOrderVector(){};
52 void set(int, int, int, string); //index, OTU, abundance, group
54 void push_back(int, int, string); //OTU, abundance, group
58 vector<individual>::iterator begin();
59 vector<individual>::iterator end();
66 RAbundVector getRAbundVector();
67 SAbundVector getSAbundVector();
68 OrderVector getOrderVector(map<string,int>*);
69 SharedOrderVector getSharedOrderVector();
70 SharedRAbundVector getSharedRAbundVector(string); //get the sharedRabundvector for a sepecific group
71 SharedSAbundVector getSharedSAbundVector(string); //get the sharedSabundvector for a sepecific group
72 vector<SharedRAbundVector*> getSharedRAbundVector(); //returns sharedRabundVectors for all the users groups
75 GlobalData* globaldata;
77 vector<individual> data;
78 map< int, vector<individual> >::iterator it;