X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=getlabelcommand.cpp;h=8535db3203c6da354ce55e1a4f095f07b6d4e487;hb=d205e70ae86dbee2efc2df02f2717975854de6ba;hp=236eef24acfdb4c0b82d2802abe63562db53ef4a;hpb=ca9ac1d80c62f57270b0dcd49410ebe08a8aecd6;p=mothur.git diff --git a/getlabelcommand.cpp b/getlabelcommand.cpp index 236eef2..8535db3 100644 --- a/getlabelcommand.cpp +++ b/getlabelcommand.cpp @@ -16,7 +16,6 @@ vector GetlabelCommand::setParameters(){ CommandParameter plist("list", "InputTypes", "", "", "LRSS", "LRSS", "none",false,false); parameters.push_back(plist); CommandParameter prabund("rabund", "InputTypes", "", "", "LRSS", "LRSS", "none",false,false); parameters.push_back(prabund); CommandParameter psabund("sabund", "InputTypes", "", "", "LRSS", "LRSS", "none",false,false); parameters.push_back(psabund); - CommandParameter pshared("shared", "InputTypes", "", "", "LRSS", "LRSS", "none",false,false); parameters.push_back(pshared); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir); @@ -44,7 +43,7 @@ GetlabelCommand::GetlabelCommand(){ string GetlabelCommand::getHelpString(){ try { string helpString = ""; - helpString += "The get.label command parameters are list, sabund, rabund and shared file. \n"; + helpString += "The get.label command parameters are list, sabund and rabund file. \n"; helpString += "The get.label command should be in the following format: \n"; helpString += "get.label()\n"; helpString += "Example get.label().\n"; @@ -63,6 +62,7 @@ GetlabelCommand::GetlabelCommand(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(); @@ -83,13 +83,6 @@ GetlabelCommand::GetlabelCommand(string option) { if (inputDir == "not found"){ inputDir = ""; } else { string path; - it = parameters.find("shared"); - //user has given a template file - if(it != parameters.end()){ - path = m->hasPath(it->second); - //if the user has not given a path then, add inputdir. else leave path alone. - if (path == "") { parameters["shared"] = inputDir + it->second; } - } it = parameters.find("rabund"); //user has given a template file @@ -120,47 +113,38 @@ GetlabelCommand::GetlabelCommand(string option) { listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { listfile = ""; abort = true; } else if (listfile == "not found") { listfile = ""; } - else { format = "list"; inputfile = listfile; } + else { format = "list"; inputfile = listfile; m->setListFile(listfile); } sabundfile = validParameter.validFile(parameters, "sabund", true); if (sabundfile == "not open") { sabundfile = ""; abort = true; } else if (sabundfile == "not found") { sabundfile = ""; } - else { format = "sabund"; inputfile = sabundfile; } + else { format = "sabund"; inputfile = sabundfile; m->setSabundFile(sabundfile); } rabundfile = validParameter.validFile(parameters, "rabund", true); if (rabundfile == "not open") { rabundfile = ""; abort = true; } else if (rabundfile == "not found") { rabundfile = ""; } - else { format = "rabund"; inputfile = rabundfile; } - - sharedfile = validParameter.validFile(parameters, "shared", true); - if (sharedfile == "not open") { sharedfile = ""; abort = true; } - else if (sharedfile == "not found") { sharedfile = ""; } - else { format = "sharedfile"; inputfile = sharedfile; } + else { format = "rabund"; inputfile = rabundfile; m->setRabundFile(rabundfile); } - if ((sharedfile == "") && (listfile == "") && (rabundfile == "") && (sabundfile == "")) { + if ((listfile == "") && (rabundfile == "") && (sabundfile == "")) { //is there are current file available for any of these? - //give priority to shared, then list, then rabund, then sabund + //give priority to list, then rabund, then sabund //if there is a current shared file, use it - sharedfile = m->getSharedFile(); - if (sharedfile != "") { inputfile = sharedfile; format = "sharedfile"; m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); } + + listfile = m->getListFile(); + if (listfile != "") { inputfile = listfile; format = "list"; m->mothurOut("Using " + listfile + " as input file for the list parameter."); m->mothurOutEndLine(); } else { - listfile = m->getListFile(); - if (listfile != "") { inputfile = listfile; format = "list"; m->mothurOut("Using " + listfile + " as input file for the list parameter."); m->mothurOutEndLine(); } + rabundfile = m->getRabundFile(); + if (rabundfile != "") { inputfile = rabundfile; format = "rabund"; m->mothurOut("Using " + rabundfile + " as input file for the rabund parameter."); m->mothurOutEndLine(); } else { - rabundfile = m->getRabundFile(); - if (rabundfile != "") { inputfile = rabundfile; format = "rabund"; m->mothurOut("Using " + rabundfile + " as input file for the rabund parameter."); m->mothurOutEndLine(); } + sabundfile = m->getSabundFile(); + if (sabundfile != "") { inputfile = sabundfile; format = "sabund"; m->mothurOut("Using " + sabundfile + " as input file for the sabund parameter."); m->mothurOutEndLine(); } else { - sabundfile = m->getSabundFile(); - if (sabundfile != "") { inputfile = sabundfile; format = "sabund"; m->mothurOut("Using " + sabundfile + " as input file for the sabund parameter."); m->mothurOutEndLine(); } - else { - m->mothurOut("No valid current files. You must provide a list, sabund, rabund or shared file before you can use the collect.single command."); m->mothurOutEndLine(); - abort = true; - } + m->mothurOut("No valid current files. You must provide a list, sabund or rabund file."); m->mothurOutEndLine(); + abort = true; } } } } - } } @@ -184,10 +168,10 @@ int GetlabelCommand::execute(){ if (m->control_pressed) { delete input; delete order; return 0; } - m->mothurOut(label); m->mothurOutEndLine(); - label = order->getLabel(); + m->mothurOut(label); m->mothurOutEndLine(); + delete order; order = input->getOrderVector(); }