X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sharedlistvector.cpp;h=b5624508ac792aa82d367ed04ed1fbaf571d4cd6;hb=477e76a8a79b60f6cd4253324dd830bdea25e3e9;hp=2bceace2565f404a08b85e5af59cf18e295bd41a;hpb=fd282e6b4be2560f5b1bd154a9e8d24b798eefaf;p=mothur.git diff --git a/sharedlistvector.cpp b/sharedlistvector.cpp index 2bceace..b562450 100644 --- a/sharedlistvector.cpp +++ b/sharedlistvector.cpp @@ -10,16 +10,17 @@ using namespace std; -#include -#include + #include "sabundvector.hpp" #include "rabundvector.hpp" #include "ordervector.hpp" -#include "datavector.hpp" -#include "utilities.hpp" #include "sharedlistvector.h" #include "sharedordervector.h" +#include "sharedutilities.h" + +/***********************************************************************/ +SharedListVector::SharedListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){}; /***********************************************************************/ @@ -29,21 +30,22 @@ SharedListVector::SharedListVector(int n): DataVector(), data(n, "") , maxRank(0 SharedListVector::SharedListVector(ifstream& f) : DataVector(), maxRank(0), numBins(0), numSeqs(0) { try { globaldata = GlobalData::getInstance(); - + //set up groupmap for later. groupmap = new GroupMap(globaldata->getGroupFile()); groupmap->readMap(); int hold; + string inputData; f >> label >> hold; data.assign(hold, ""); - string inputData = ""; for(int i=0;i> inputData; set(i, inputData); } + } catch(exception& e) { cout << "Standard Error: " << e.what() << " has occurred in the SharedListVector class Function SharedListVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; @@ -283,6 +285,28 @@ SharedRAbundVector SharedListVector::getSharedRAbundVector(string groupName) { exit(1); } } +/***********************************************************************/ +vector SharedListVector::getSharedRAbundVector() { + try { + SharedUtil* util; + util = new SharedUtil(); + vector lookup; + + util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups); + util->getSharedVectors(globaldata->Groups, lookup, this->getSharedOrderVector()); + + return lookup; + } + catch(exception& e) { + cout << "Standard Error: " << e.what() << " has occurred in the SharedListVector class Function getSharedRAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + exit(1); + } + catch(...) { + cout << "An unknown error has occurred in the SharedListVector class function getSharedRAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + exit(1); + } + +} /***********************************************************************/ SharedSAbundVector SharedListVector::getSharedSAbundVector(string groupName) {