8 * Created by Sarah Westcott on 1/22/09.
9 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
13 #include "datavector.hpp"
15 #include "sharedrabundvector.h"
16 #include "sharedsabundvector.h"
18 /* This class is a child to datavector. It represents OTU information at a certain distance.
19 A sharedlistvector can be converted into a sharedordervector, sharedrabundvector or sharedsabundvectorand
20 as well as an ordervector, rabundvector or sabundvector.
21 Each member of the internal container "data" represents an individual OTU.
22 Each individual in the OTU belongs to a group.
23 So data[0] = "a,b,c,d,e,f".
24 example: listvector = a,b,c,d,e,f g,h,i j,k l m
25 rabundvector = 6 3 2 1 1
26 sabundvector = 2 1 1 0 0 1
27 ordervector = 1 1 1 1 1 1 2 2 2 3 3 4 5 */
29 class SharedListVector : public DataVector {
33 SharedListVector(int);
34 SharedListVector(ifstream&);
35 SharedListVector(const SharedListVector& lv) : DataVector(lv.label), data(lv.data), maxRank(lv.maxRank), numBins(lv.numBins), numSeqs(lv.numSeqs){ groupmap = NULL; };
36 ~SharedListVector(){ if (groupmap != NULL) { delete groupmap; } };
38 int getNumBins() { return numBins; }
39 int getNumSeqs() { return numSeqs; }
40 int getMaxRank() { return maxRank; }
42 void set(int, string);
44 void push_back(string);
50 RAbundVector getRAbundVector();
51 SAbundVector getSAbundVector();
52 OrderVector getOrderVector(map<string,int>*);
53 SharedOrderVector* getSharedOrderVector();
54 SharedRAbundVector getSharedRAbundVector(string); //get sharedrabundvector for a certain group
55 SharedSAbundVector getSharedSAbundVector(string); //get sharedsabundvector for a certain group
56 vector<SharedRAbundVector*> getSharedRAbundVector(); //returns sharedRabundVectors for all the users groups
59 vector<string> data; //data[i] is a list of names of sequences in the ith OTU.