X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=sharedrabundvector.h;h=664718518e276c7c84984f5c1fe76c9b3bf46523;hp=6f8d630c4fdfe490e9a32912089608bb7892482c;hb=a8e2df1b96a57f5f29576b08361b86a96a8eff4f;hpb=20a2d0350a737a434c89f303662d64a8eeea7b05 diff --git a/sharedrabundvector.h b/sharedrabundvector.h index 6f8d630..6647185 100644 --- a/sharedrabundvector.h +++ b/sharedrabundvector.h @@ -1,8 +1,8 @@ -#ifndef SHAREDVECTOR_H -#define SHAREDVECTOR_H +#ifndef SHAREDRABUNDVECTOR_H +#define SHAREDRABUNDVECTOR_H /* - * sharedvector.h + * sharedrabundvector.h * Dotur * * Created by Sarah Westcott on 12/5/08. @@ -10,11 +10,19 @@ * */ -#include #include "datavector.hpp" #include "sharedordervector.h" +#include "sharedsabundvector.h" +#include "sharedrabundfloatvector.h" +#include "rabundvector.hpp" +//#include "groupmap.h" - +/* DataStructure for a shared file. + This class is a child to datavector. It represents OTU information at a certain distance. + It is similiar to an rabundvector except each member of data knows which group it belongs to. + Each member of the internal container "data" is a struct of type individual. + An individual which knows the OTU from which it came, + the group it is in and its abundance. */ class SharedRAbundVector : public DataVector { @@ -23,39 +31,63 @@ public: SharedRAbundVector(); SharedRAbundVector(int); //SharedRAbundVector(string, vector); - SharedRAbundVector(const SharedRAbundVector& bv) : DataVector(bv), data(bv.data), maxRank(bv.maxRank), numBins(bv.numBins), numSeqs(bv.numSeqs){}; -// SharedRAbundVector(ifstream&); + SharedRAbundVector(const SharedRAbundVector& bv) : DataVector(bv), data(bv.data), maxRank(bv.maxRank), numBins(bv.numBins), numSeqs(bv.numSeqs), group(bv.group), index(bv.index){}; + SharedRAbundVector(ifstream&); ~SharedRAbundVector(); int getNumBins(); int getNumSeqs(); int getMaxRank(); string getGroup(); - void setGroup(string); + void setGroup(string); + string getBinLabel(); + void setBinLabel(string); + int getGroupIndex(); + void setGroupIndex(int); - void set(int, int, string); + void set(int, int, string); //OTU, abundance, groupname + void setData(vector ); individual get(int); + vector getData(); int getAbundance(int); - void push_back(int, int, string); + vector getAbundances(); + int numNZ(); + void sortD(); //Sorts the data in descending order. + void push_front(int, int, string); //abundance, otu, groupname + void insert(int, int, string); //abundance, otu, groupname + void push_back(int, string); //abundance, groupname void pop_back(); void resize(int); int size(); + void clear(); vector::reverse_iterator rbegin(); vector::reverse_iterator rend(); void print(ostream&); + void printHeaders(ostream&); - SharedRAbundVector getSharedRAbundVector(); + RAbundVector getRAbundVector(); + RAbundVector getRAbundVector2(); SAbundVector getSAbundVector(); OrderVector getOrderVector(map*); SharedOrderVector getSharedOrderVector(); + SharedSAbundVector getSharedSAbundVector(); + SharedRAbundVector getSharedRAbundVector(); + vector getSharedRAbundVectors(); + vector getSharedRAbundFloatVectors(vector); private: vector data; + vector lookup; + //GlobalData* globaldata; + //GroupMap* groupmap; int maxRank; int numBins; int numSeqs; - string group; + string group; + int index; + + int eliminateZeroOTUS(vector&); };