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. */
18 #include "datavector.hpp"
24 bool operator()(const individual& i1, const individual& i2) {
25 return (i1.abundance > i2.abundance);
27 individual() { group = ""; bin = 0; abundance = 0; }
30 struct individualFloat {
34 bool operator()(const individual& i1, const individual& i2) {
35 return (i1.abundance > i2.abundance);
37 individualFloat() { group = ""; bin = 0; abundance = 0.0; }
41 #include "sabundvector.hpp"
42 #include "rabundvector.hpp"
43 #include "sharedrabundvector.h"
44 #include "sharedsabundvector.h"
47 class SharedOrderVector : public DataVector {
51 // SharedOrderVector(int ns, int nb=0, int mr=0) : DataVector(), data(ns, -1), maxRank(0), numBins(0), numSeqs(0) {};
52 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();}};
54 SharedOrderVector(string, vector<individual>);
55 SharedOrderVector(ifstream&);
56 ~SharedOrderVector(){};
63 vector<individual>::iterator begin();
64 vector<individual>::iterator end();
65 void push_back(int, int, string); //OTU, abundance, group MUST CALL UPDATE STATS AFTER PUSHBACK!!!
73 RAbundVector getRAbundVector();
74 SAbundVector getSAbundVector();
75 OrderVector getOrderVector(map<string,int>*);
76 SharedOrderVector getSharedOrderVector();
77 SharedRAbundVector getSharedRAbundVector(string); //get the sharedRabundvector for a sepecific group
78 SharedSAbundVector getSharedSAbundVector(string); //get the sharedSabundvector for a sepecific group
79 vector<SharedRAbundVector*> getSharedRAbundVector(); //returns sharedRabundVectors for all the users groups
83 vector<individual> data;
84 map< int, vector<individual> >::iterator it;
89 void set(int, int, int, string); //index, OTU, abundance, group