X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=removerarecommand.cpp;h=24b616560de3bed794d423f4cb7a3544f0d48f5f;hb=e0ce7cbc93d7d2fbb753ca694182db092a0ea0e7;hp=c320fa4d8854f003486bc71c8e6b0806ec7ae0e3;hpb=7bf9a81bba76538ecaf351ae208de3da4bf1b6dd;p=mothur.git diff --git a/removerarecommand.cpp b/removerarecommand.cpp index c320fa4..24b6165 100644 --- a/removerarecommand.cpp +++ b/removerarecommand.cpp @@ -220,7 +220,7 @@ RemoveRareCommand::RemoveRareCommand(string option) { string temp = validParameter.validFile(parameters, "nseqs", false); if (temp == "not found") { m->mothurOut("nseqs is a required parameter."); m->mothurOutEndLine(); abort = true; } - else { convert(temp, nseqs); } + else { m->mothurConvert(temp, nseqs); } temp = validParameter.validFile(parameters, "bygroup", false); if (temp == "not found") { temp = "f"; } byGroup = m->isTrue(temp); @@ -251,7 +251,7 @@ int RemoveRareCommand::execute(){ if (listfile != "") { processList(); } if (sharedfile != "") { processShared(); } - if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; } + if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; } if (outputNames.size() != 0) { m->mothurOutEndLine(); @@ -353,7 +353,8 @@ int RemoveRareCommand::processList(){ if (groupfile != "") { groupMap = new GroupMap(groupfile); groupMap->readMap(); SharedUtil util; - util.setGroups(Groups, groupMap->namesOfGroups); + vector namesGroups = groupMap->getNamesOfGroups(); + util.setGroups(Groups, namesGroups); m->openOutputFile(outputGroupFileName, outGroup); } @@ -365,7 +366,7 @@ int RemoveRareCommand::processList(){ //for each bin for (int i = 0; i < list->getNumBins(); i++) { - if (m->control_pressed) { if (groupfile != "") { delete groupMap; outGroup.close(); remove(outputGroupFileName.c_str()); } out.close(); remove(outputFileName.c_str()); return 0; } + if (m->control_pressed) { if (groupfile != "") { delete groupMap; outGroup.close(); m->mothurRemove(outputGroupFileName); } out.close(); m->mothurRemove(outputFileName); return 0; } //parse out names that are in accnos file string binnames = list->get(i); @@ -624,7 +625,7 @@ int RemoveRareCommand::processRabund(){ //********************************************************************************************************************** int RemoveRareCommand::processShared(){ try { - m->Groups = Groups; + m->setGroups(Groups); string thisOutputDir = outputDir; if (outputDir == "") { thisOutputDir += m->hasPath(sharedfile); }