X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=rarefactsharedcommand.cpp;h=64bdbb4ceebd18f5abeff63b26fbb4d4ac3dc924;hb=8dd3c225255d7084e3aff8740aa4f1f1cabb367a;hp=746b09e8df8f4719f7ded9504e4f732b49fb559b;hpb=ca9ac1d80c62f57270b0dcd49410ebe08a8aecd6;p=mothur.git diff --git a/rarefactsharedcommand.cpp b/rarefactsharedcommand.cpp index 746b09e..64bdbb4 100644 --- a/rarefactsharedcommand.cpp +++ b/rarefactsharedcommand.cpp @@ -49,7 +49,7 @@ string RareFactSharedCommand::getHelpString(){ helpString += validCalculator.printCalc("sharedrarefaction"); helpString += "The label parameter is used to analyze specific labels in your input.\n"; helpString += "The groups parameter allows you to specify which of the groups in your groupfile you would like analyzed. You must enter at least 2 valid groups.\n"; - helpString += "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n\n"; + helpString += "Note: No spaces between parameter labels (i.e. freq), '=' and parameters (i.e.yourFreq).\n"; return helpString; } catch(exception& e) { @@ -81,6 +81,7 @@ RareFactSharedCommand::RareFactSharedCommand(string option) { //allow user to run help if(option == "help") { help(); abort = true; calledHelp = true; } + else if(option == "citation") { citation(); abort = true; calledHelp = true;} else { vector myArray = setParameters(); @@ -123,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 @@ -146,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; } @@ -205,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; } @@ -227,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; } @@ -272,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; } @@ -293,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; } @@ -313,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();