X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sharedlistvector.cpp;h=6dfcb97f0aff013d15c1c641e93a24b0d7b229a3;hb=f06b339c5fc4b6d1b9d2a08fe16bf7670bf7aeb4;hp=1493ee99622602d914af8ca61400b522e4701132;hpb=4ad32478c7b1bbb464c839a6e133f5b517a3efec;p=mothur.git diff --git a/sharedlistvector.cpp b/sharedlistvector.cpp index 1493ee9..6dfcb97 100644 --- a/sharedlistvector.cpp +++ b/sharedlistvector.cpp @@ -16,19 +16,17 @@ /***********************************************************************/ -SharedListVector::SharedListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){globaldata = GlobalData::getInstance(); groupmap = NULL; } +SharedListVector::SharedListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){ groupmap = NULL; } /***********************************************************************/ -SharedListVector::SharedListVector(int n): DataVector(), data(n, "") , maxRank(0), numBins(0), numSeqs(0){globaldata = GlobalData::getInstance(); groupmap = NULL; } +SharedListVector::SharedListVector(int n): DataVector(), data(n, "") , maxRank(0), numBins(0), numSeqs(0){ groupmap = NULL; } /***********************************************************************/ 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 = new GroupMap(m->getGroupFile()); groupmap->readMap(); int hold; @@ -268,17 +266,20 @@ vector SharedListVector::getSharedRAbundVector() { vector lookup; //contains just the groups the user selected map finder; //contains all groups in groupmap string group, names, name; - - util->setGroups(globaldata->Groups, globaldata->gGroupmap->namesOfGroups); + + vector Groups = m->getGroups(); + vector allGroups = groupmap->getNamesOfGroups(); + util->setGroups(Groups, allGroups); + m->setGroups(Groups); delete util; - for (int i = 0; i < globaldata->gGroupmap->namesOfGroups.size(); i++) { + for (int i = 0; i < allGroups.size(); i++) { SharedRAbundVector* temp = new SharedRAbundVector(data.size()); - finder[globaldata->gGroupmap->namesOfGroups[i]] = temp; - finder[globaldata->gGroupmap->namesOfGroups[i]]->setLabel(label); - finder[globaldata->gGroupmap->namesOfGroups[i]]->setGroup(globaldata->gGroupmap->namesOfGroups[i]); - if (m->inUsersGroups(globaldata->gGroupmap->namesOfGroups[i], globaldata->Groups)) { //if this group is in user groups - lookup.push_back(finder[globaldata->gGroupmap->namesOfGroups[i]]); + finder[allGroups[i]] = temp; + finder[allGroups[i]]->setLabel(label); + finder[allGroups[i]]->setGroup(allGroups[i]); + if (m->inUsersGroups(allGroups[i], m->getGroups())) { //if this group is in user groups + lookup.push_back(finder[allGroups[i]]); } }