X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=corraxescommand.cpp;h=b943aa4bf9dd962a4364af7069d24eb64c380a78;hb=65e21482d022d12f7a78a8d436fb51f322603e41;hp=07c5707e0c195cf26596e5ef328af83994ebd031;hpb=1bf53bca7e26bf091588bc8ca6e68cbfae1df6fe;p=mothur.git diff --git a/corraxescommand.cpp b/corraxescommand.cpp index 07c5707..b943aa4 100644 --- a/corraxescommand.cpp +++ b/corraxescommand.cpp @@ -158,7 +158,7 @@ CorrAxesCommand::CorrAxesCommand(string option) { pickedGroups = true; m->splitAtDash(groups, Groups); } - m->Groups = Groups; + m->setGroups(Groups); outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = m->hasPath(inputFileName); } @@ -760,6 +760,7 @@ int CorrAxesCommand::eliminateZeroOTUS(vector& thisloo //for each bin vector newBinLabels; + string snumBins = toString(thislookup[0]->getNumBins()); for (int i = 0; i < thislookup[0]->getNumBins(); i++) { if (m->control_pressed) { for (int j = 0; j < newLookup.size(); j++) { delete newLookup[j]; } return 0; } @@ -776,7 +777,13 @@ int CorrAxesCommand::eliminateZeroOTUS(vector& thisloo } //if there is a bin label use it otherwise make one - string binLabel = "Otu" + (i+1); + string binLabel = "Otu"; + string sbinNumber = toString(i+1); + if (sbinNumber.length() < snumBins.length()) { + int diff = snumBins.length() - sbinNumber.length(); + for (int h = 0; h < diff; h++) { binLabel += "0"; } + } + binLabel += sbinNumber; if (i < m->currentBinLabels.size()) { binLabel = m->currentBinLabels[i]; } newBinLabels.push_back(binLabel); @@ -907,12 +914,13 @@ int CorrAxesCommand::getMetadata(){ //remove any groups the user does not want, and set globaldata->groups with only valid groups SharedUtil* util; util = new SharedUtil(); - - util->setGroups(m->Groups, groupNames); + Groups = m->getGroups(); + util->setGroups(Groups, groupNames); + m->setGroups(Groups); for (int i = 0; i < lookupFloat.size(); i++) { //if this sharedrabund is not from a group the user wants then delete it. - if (util->isValidGroup(lookupFloat[i]->getGroup(), m->Groups) == false) { + if (util->isValidGroup(lookupFloat[i]->getGroup(), m->getGroups()) == false) { delete lookupFloat[i]; lookupFloat[i] = NULL; lookupFloat.erase(lookupFloat.begin()+i); i--;