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 "counttable.h"
16 #include "sharedrabundvector.h"
17 #include "sharedsabundvector.h"
19 /* This class is a child to datavector. It represents OTU information at a certain distance.
20 A sharedlistvector can be converted into a sharedordervector, sharedrabundvector or sharedsabundvectorand
21 as well as an ordervector, rabundvector or sabundvector.
22 Each member of the internal container "data" represents an individual OTU.
23 Each individual in the OTU belongs to a group.
24 So data[0] = "a,b,c,d,e,f".
25 example: listvector = a,b,c,d,e,f g,h,i j,k l m
26 rabundvector = 6 3 2 1 1
27 sabundvector = 2 1 1 0 0 1
28 ordervector = 1 1 1 1 1 1 2 2 2 3 3 4 5 */
30 class SharedListVector : public DataVector {
34 SharedListVector(int);
35 SharedListVector(ifstream&);
36 SharedListVector(const SharedListVector& lv) : DataVector(lv.label), data(lv.data), maxRank(lv.maxRank), numBins(lv.numBins), numSeqs(lv.numSeqs){ groupmap = NULL; countTable = NULL; };
37 ~SharedListVector(){ if (groupmap != NULL) { delete groupmap; } if (countTable != NULL) { delete countTable; } };
39 int getNumBins() { return numBins; }
40 int getNumSeqs() { return numSeqs; }
41 int getMaxRank() { return maxRank; }
43 void set(int, string);
45 void push_back(string);
51 RAbundVector getRAbundVector();
52 SAbundVector getSAbundVector();
53 OrderVector getOrderVector(map<string,int>*);
54 SharedOrderVector* getSharedOrderVector();
55 SharedRAbundVector getSharedRAbundVector(string); //get sharedrabundvector for a certain group
56 SharedSAbundVector getSharedSAbundVector(string); //get sharedsabundvector for a certain group
57 vector<SharedRAbundVector*> getSharedRAbundVector(); //returns sharedRabundVectors for all the users groups
60 vector<string> data; //data[i] is a list of names of sequences in the ith OTU.
62 CountTable* countTable;