X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sharedordervector.h;h=30d655f7347c07fcb9a887ac5330959702e09382;hb=edec660ee2be477ac1539109d949a60cb7e16243;hp=f925964e72b7bf7173945b7c04299bbfba1d2fdc;hpb=fd282e6b4be2560f5b1bd154a9e8d24b798eefaf;p=mothur.git diff --git a/sharedordervector.h b/sharedordervector.h index f925964..30d655f 100644 --- a/sharedordervector.h +++ b/sharedordervector.h @@ -2,7 +2,7 @@ #define SHAREDORDER_H /* * sharedorder.h - * Dotur + * Mothur * * Created by Sarah Westcott on 12/9/08. * Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved. @@ -23,13 +23,20 @@ struct individual { string group; int bin; int abundance; + bool operator()(const individual& i1, const individual& i2) { + return (i1.abundance > i2.abundance); + } }; -#include #include "sabundvector.hpp" #include "rabundvector.hpp" #include "sharedrabundvector.h" #include "sharedsabundvector.h" +#include "globaldata.hpp" +#include "groupmap.h" +//#include "globaldata.hpp" + +class GlobalData; class SharedOrderVector : public DataVector { @@ -39,18 +46,18 @@ public: 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();}}; SharedOrderVector(string, vector); -// SharedOrderVector(ifstream&); + SharedOrderVector(ifstream&); ~SharedOrderVector(){}; - void set(int, int, int, string); //index, OTU, abundance, group + individual get(int); - void push_back(int, int, string); //OTU, abundance, group void resize(int); int size(); void print(ostream&); vector::iterator begin(); vector::iterator end(); - + void push_back(int, int, string); //OTU, abundance, group MUST CALL UPDATE STATS AFTER PUSHBACK!!! + void updateStats(); int getNumBins(); int getNumSeqs(); @@ -62,15 +69,19 @@ public: SharedOrderVector getSharedOrderVector(); SharedRAbundVector getSharedRAbundVector(string); //get the sharedRabundvector for a sepecific group SharedSAbundVector getSharedSAbundVector(string); //get the sharedSabundvector for a sepecific group + vector getSharedRAbundVector(); //returns sharedRabundVectors for all the users groups private: + GlobalData* globaldata; + GroupMap* groupmap; vector data; map< int, vector >::iterator it; int maxRank; int numBins; int numSeqs; bool needToUpdate; - void updateStats(); + void set(int, int, int, string); //index, OTU, abundance, group + }; #endif