helpString += "The groups parameter allows you to indicate that you want representative sequences for each group specified for each OTU, group name should be separated by dashes. ex. groups=A-B-C.\n";
helpString += "The get.oturep command outputs a .fastarep and .rep.names file for each distance you specify, selecting one OTU representative for each bin.\n";
helpString += "If you provide a groupfile, then it also appends the names of the groups present in that bin.\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 fastafile 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") { abort = true; }
+ else { m->setListFile(listfile); }
phylipfile = validParameter.validFile(parameters, "phylip", true);
if (phylipfile == "not found") { phylipfile = ""; }
else if (phylipfile == "not open") { abort = true; }
- else { distFile = phylipfile; format = "phylip"; }
+ else { distFile = phylipfile; format = "phylip"; m->setPhylipFile(phylipfile); }
columnfile = validParameter.validFile(parameters, "column", true);
if (columnfile == "not found") { columnfile = ""; }
else if (columnfile == "not open") { abort = true; }
- else { distFile = columnfile; format = "column"; }
+ else { distFile = columnfile; format = "column"; m->setColumnFile(columnfile); }
namefile = validParameter.validFile(parameters, "name", true);
if (namefile == "not open") { abort = true; }
else if (namefile == "not found") { namefile = ""; }
+ else { m->setNameFile(namefile); }
if ((phylipfile == "") && (columnfile == "")) { //is there are current file available for either of these?
//give priority to column, then phylip
groupfile = validParameter.validFile(parameters, "group", true);
if (groupfile == "not open") { groupfile = ""; abort = true; }
else if (groupfile == "not found") { groupfile = ""; }
-
+ else { m->setGroupFile(groupfile); }
+
sorted = validParameter.validFile(parameters, "sorted", false); if (sorted == "not found"){ sorted = ""; }
if (sorted == "none") { sorted=""; }
if ((sorted != "") && (sorted != "name") && (sorted != "bin") && (sorted != "size") && (sorted != "group")) {
m->splitAtDash(groups, Groups);
}
}
- m->Groups = Groups;
+ m->setGroups(Groups);
string temp = validParameter.validFile(parameters, "large", false); if (temp == "not found") { temp = "F"; }
large = m->isTrue(temp);
//openfile for getMap to use
m->openInputFile(distFile, inRow);
- if (m->control_pressed) { inRow.close(); remove(distFile.c_str()); return 0; }
+ if (m->control_pressed) { inRow.close(); m->mothurRemove(distFile); return 0; }
}
if (m->control_pressed) {
- if (large) { inRow.close(); remove(distFile.c_str()); }
+ if (large) { inRow.close(); m->mothurRemove(distFile); }
return 0;
}
if (Groups.size() != 0) {
SharedUtil* util = new SharedUtil();
- util->setGroups(Groups, groupMap->namesOfGroups, "getoturep");
+ vector<string> gNamesOfGroups = groupMap->getNamesOfGroups();
+ util->setGroups(Groups, gNamesOfGroups, "getoturep");
+ groupMap->setNamesOfGroups(gNamesOfGroups);
delete util;
}
}
set<string> userLabels = labels;
if (m->control_pressed) {
- if (large) { inRow.close(); remove(distFile.c_str()); }
+ if (large) { inRow.close(); m->mothurRemove(distFile); }
delete input; delete list; return 0;
}
if (error == 1) { return 0; } //there is an error in hte input files, abort command
if (m->control_pressed) {
- if (large) { inRow.close(); remove(distFile.c_str()); }
- for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
+ if (large) { inRow.close(); m->mothurRemove(distFile); }
+ for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } outputTypes.clear();
delete input; delete list; return 0;
}
if (error == 1) { return 0; } //there is an error in hte input files, abort command
if (m->control_pressed) {
- if (large) { inRow.close(); remove(distFile.c_str()); }
- for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
+ if (large) { inRow.close(); m->mothurRemove(distFile); }
+ for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } outputTypes.clear();
delete input; delete list; return 0;
}
if (error == 1) { return 0; } //there is an error in hte input files, abort command
if (m->control_pressed) {
- if (large) { inRow.close(); remove(distFile.c_str()); }
- for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } outputTypes.clear();
+ if (large) { inRow.close(); m->mothurRemove(distFile); }
+ for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } outputTypes.clear();
delete input; delete list; return 0;
}
}
//close and remove formatted matrix file
if (large) {
inRow.close();
- remove(distFile.c_str());
+ m->mothurRemove(distFile);
}
delete input;
try{
// if only 1 sequence in bin or processing the "unique" label, then
// the first sequence of the OTU is the representative one
- if ((names.size() == 1) || (list->getLabel() == "unique")) {
+ if ((names.size() == 1)) {
return names[0];
}else{
vector<int> seqIndex(names.size());
out.close();
out2.close();
- remove(filename.c_str());
+ m->mothurRemove(filename);
rename(tempNameFile.c_str(), filename.c_str());
return 0;