X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=rarefactsharedcommand.cpp;h=64bdbb4ceebd18f5abeff63b26fbb4d4ac3dc924;hb=0ca63a8165baa0afa459e644ebe140ba496d5ba0;hp=0292cba70c536b38049dc943957127ec9a0cb95f;hpb=e150b0b0664caec517485ee6d69dcdade6dcae77;p=mothur.git diff --git a/rarefactsharedcommand.cpp b/rarefactsharedcommand.cpp index 0292cba..64bdbb4 100644 --- a/rarefactsharedcommand.cpp +++ b/rarefactsharedcommand.cpp @@ -124,7 +124,7 @@ RareFactSharedCommand::RareFactSharedCommand(string option) { sharedfile = m->getSharedFile(); if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setSharedFile(sharedfile); } //if the user changes the output directory command factory will send this info to us in the output parameter @@ -147,20 +147,25 @@ RareFactSharedCommand::RareFactSharedCommand(string option) { if (calc == "default") { calc = "sharedobserved"; } } m->splitAtDash(calc, Estimators); + if (m->inUsersGroups("citation", Estimators)) { + ValidCalculators validCalc; validCalc.printCitations(Estimators); + //remove citation from list of calcs + for (int i = 0; i < Estimators.size(); i++) { if (Estimators[i] == "citation") { Estimators.erase(Estimators.begin()+i); break; } } + } groups = validParameter.validFile(parameters, "groups", false); if (groups == "not found") { groups = ""; } else { m->splitAtDash(groups, Groups); } - m->Groups = Groups; + m->setGroups(Groups); string temp; temp = validParameter.validFile(parameters, "freq", false); if (temp == "not found") { temp = "100"; } - convert(temp, freq); + m->mothurConvert(temp, freq); temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } - convert(temp, nIters); + m->mothurConvert(temp, nIters); temp = validParameter.validFile(parameters, "jumble", false); if (temp == "not found") { temp = "T"; } if (m->isTrue(temp)) { jumble = true; } @@ -206,10 +211,10 @@ int RareFactSharedCommand::execute(){ string lastLabel = lookup[0]->getLabel(); if (m->control_pressed) { - m->Groups.clear(); + m->clearGroups(); delete input; for(int i=0;imothurRemove(outputNames[i]); } for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } return 0; } @@ -228,10 +233,10 @@ int RareFactSharedCommand::execute(){ //as long as you are not at the end of the file or done wih the lines you want while((lookup[0] != NULL) && ((allLines == 1) || (userLabels.size() != 0))) { if (m->control_pressed) { - m->Groups.clear(); + m->clearGroups(); delete input; for(int i=0;imothurRemove(outputNames[i]); } for (int i = 0; i < lookup.size(); i++) { delete lookup[i]; } return 0; } @@ -273,10 +278,10 @@ int RareFactSharedCommand::execute(){ } if (m->control_pressed) { - m->Groups.clear(); + m->clearGroups(); delete input; for(int i=0;imothurRemove(outputNames[i]); } return 0; } @@ -294,10 +299,10 @@ int RareFactSharedCommand::execute(){ } if (m->control_pressed) { - m->Groups.clear(); + m->clearGroups(); delete input; for(int i=0;imothurRemove(outputNames[i]); } return 0; } @@ -314,10 +319,10 @@ int RareFactSharedCommand::execute(){ } for(int i=0;iGroups.clear(); + m->clearGroups(); delete input; - 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; } m->mothurOutEndLine(); m->mothurOut("Output File Names: "); m->mothurOutEndLine();