helpString += "The default value for label is all lines in your inputfile.\n";
helpString += "The bin.seqs command outputs a .fasta file for each distance you specify appending the OTU number to each name.\n";
helpString += "If you provide a groupfile, then it also appends the sequences group to the name.\n";
- helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n\n";
+ helpString += "Note: No spaces between parameter labels (i.e. fasta), '=' and parameters (i.e.yourFastaFile).\n";
return helpString;
}
catch(exception& e) {
//allow user to run help
if(option == "help") { help(); abort = true; calledHelp = true; }
+ else if(option == "citation") { citation(); abort = true; calledHelp = true;}
else {
vector<string> myArray = setParameters();
else { m->mothurOut("You have no current fasta file and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; }
}
else if (fastafile == "not open") { abort = true; }
+ else { m->setFastaFile(fastafile); }
listfile = validParameter.validFile(parameters, "list", true);
if (listfile == "not found") {
else { m->mothurOut("You have no current list file and the list parameter is required."); m->mothurOutEndLine(); abort = true; }
}
else if (listfile == "not open") { listfile = ""; abort = true; }
+ else { m->setListFile(listfile); }
//if the user changes the output directory command factory will send this info to us in the output parameter
outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){
}
namesfile = validParameter.validFile(parameters, "name", true);
- if (namesfile == "not open") { abort = true; }
+ if (namesfile == "not open") { namesfile = ""; abort = true; }
else if (namesfile == "not found") { namesfile = ""; }
+ else { m->setNameFile(namesfile); }
groupfile = validParameter.validFile(parameters, "group", true);
if (groupfile == "not open") { abort = true; }
else if (groupfile == "not found") { groupfile = ""; }
+ else { m->setGroupFile(groupfile); }
+
+ if (namesfile == ""){
+ vector<string> files; files.push_back(fastafile);
+ parser.getNameFile(files);
+ }
}
}
while((list != NULL) && ((allLines == 1) || (userLabels.size() != 0))) {
- if(m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } delete input; delete fasta; if (groupfile != "") { delete groupMap; } return 0; }
+ if(m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } delete input; delete fasta; if (groupfile != "") { delete groupMap; } return 0; }
if(allLines == 1 || labels.count(list->getLabel()) == 1){
error = process(list);
- if (error == 1) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } delete input; delete fasta; if (groupfile != "") { delete groupMap; } return 0; }
+ if (error == 1) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } delete input; delete fasta; if (groupfile != "") { delete groupMap; } return 0; }
processedLabels.insert(list->getLabel());
userLabels.erase(list->getLabel());
list = input->getListVector(lastLabel);
error = process(list);
- if (error == 1) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } delete input; delete fasta; if (groupfile != "") { delete groupMap; } return 0; }
+ if (error == 1) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } delete input; delete fasta; if (groupfile != "") { delete groupMap; } return 0; }
processedLabels.insert(list->getLabel());
userLabels.erase(list->getLabel());
list = input->getListVector();
}
- if(m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } delete input; delete fasta; if (groupfile != "") { delete groupMap; } return 0; }
+ if(m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } delete input; delete fasta; if (groupfile != "") { delete groupMap; } return 0; }
//output error messages about any remaining user labels
set<string>::iterator it;
list = input->getListVector(lastLabel);
error = process(list);
- if (error == 1) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } delete input; delete fasta; if (groupfile != "") { delete groupMap; } return 0; }
+ if (error == 1) { for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } delete input; delete fasta; if (groupfile != "") { delete groupMap; } return 0; }
delete list;
}
delete fasta;
if (groupfile != "") { delete groupMap; }
- if(m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
-
- delete input;
- delete fasta;
- if (groupfile != "") { delete groupMap; }
+ 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();