//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();
phylipfile = validParameter.validFile(parameters, "phylip", true);
if (phylipfile == "not open") { abort = true; }
else if (phylipfile == "not found") { phylipfile = ""; }
- else { distfile = phylipfile; format = "phylip"; }
+ else { distfile = phylipfile; format = "phylip"; m->setPhylipFile(phylipfile); }
columnfile = validParameter.validFile(parameters, "column", true);
if (columnfile == "not open") { abort = true; }
else if (columnfile == "not found") { columnfile = ""; }
- 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 if (namefile == "not found") { namefile = ""; }
+ else { m->setNameFile(namefile); }
fastafile = validParameter.validFile(parameters, "fasta", true);
if (fastafile == "not open") { abort = true; }
else if (fastafile == "not found") { fastafile = ""; }
- else { distfile = fastafile; splitmethod = "fasta"; }
+ else { distfile = fastafile; splitmethod = "fasta"; m->setFastaFile(fastafile); }
taxFile = validParameter.validFile(parameters, "taxonomy", true);
if (taxFile == "not open") { abort = true; }
else if (taxFile == "not found") { taxFile = ""; }
+ else { m->setTaxonomyFile(taxFile); }
if ((phylipfile == "") && (columnfile == "") && (fastafile == "")) {
//is there are current file available for either of these?
listFileNames.push_back(tempName);
}
in.close();
- remove((toString(processIDS[i]) + ".temp").c_str());
+ m->mothurRemove((toString(processIDS[i]) + ".temp"));
//get labels
filename = toString(processIDS[i]) + ".temp.labels";
if (labels.count(tempName) == 0) { labels.insert(tempName); }
}
in2.close();
- remove((toString(processIDS[i]) + ".temp.labels").c_str());
+ m->mothurRemove((toString(processIDS[i]) + ".temp.labels"));
}
}
#else
listFileNames = cluster(distName, labels); //clusters individual files and returns names of list files
#endif
#endif
- if (m->control_pressed) { for (int i = 0; i < listFileNames.size(); i++) { remove(listFileNames[i].c_str()); } return 0; }
+ if (m->control_pressed) { for (int i = 0; i < listFileNames.size(); i++) { m->mothurRemove(listFileNames[i]); } return 0; }
if (saveCutoff != cutoff) { m->mothurOut("Cutoff was " + toString(saveCutoff) + " changed cutoff to " + toString(cutoff)); m->mothurOutEndLine(); }
ListVector* listSingle;
map<float, int> labelBins = completeListFile(listFileNames, singletonName, labels, listSingle); //returns map of label to numBins
- if (m->control_pressed) { if (listSingle != NULL) { delete listSingle; } for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); } return 0; }
+ if (m->control_pressed) { if (listSingle != NULL) { delete listSingle; } for (int i = 0; i < outputNames.size(); i++) { m->mothurRemove(outputNames[i]); } return 0; }
mergeLists(listFileNames, labelBins, listSingle);
- 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->mothurOut("It took " + toString(time(NULL) - estart) + " seconds to merge."); m->mothurOutEndLine();
listSingle->push_back(secondCol);
}
in.close();
- remove(singleton.c_str());
+ m->mothurRemove(singleton);
numSingleBins = listSingle->getNumBins();
}else{ listSingle = NULL; numSingleBins = 0; }
for (int k = 0; k < listNames.size(); k++) {
if (m->control_pressed) {
- if (listSingle != NULL) { delete listSingle; listSingle = NULL; remove(singleton.c_str()); }
- for (int i = 0; i < listNames.size(); i++) { remove(listNames[i].c_str()); }
+ if (listSingle != NULL) { delete listSingle; listSingle = NULL; m->mothurRemove(singleton); }
+ for (int i = 0; i < listNames.size(); i++) { m->mothurRemove(listNames[i]); }
return labelBin;
}
delete input;
outFilled.close();
- remove(listNames[k].c_str());
+ m->mothurRemove(listNames[k]);
rename(filledInList.c_str(), listNames[k].c_str());
}
//get the list info from each file
for (int k = 0; k < listNames.size(); k++) {
- if (m->control_pressed) { if (listSingle != NULL) { delete listSingle; } for (int i = 0; i < listNames.size(); i++) { remove(listNames[i].c_str()); } delete rabund; return 0; }
+ if (m->control_pressed) { if (listSingle != NULL) { delete listSingle; } for (int i = 0; i < listNames.size(); i++) { m->mothurRemove(listNames[i]); } delete rabund; return 0; }
InputData* input = new InputData(listNames[k], "list");
ListVector* list = input->getListVector(thisLabel);
if (listSingle != NULL) { delete listSingle; }
- for (int i = 0; i < listNames.size(); i++) { remove(listNames[i].c_str()); }
+ for (int i = 0; i < listNames.size(); i++) { m->mothurRemove(listNames[i]); }
return 0;
}
if (m->control_pressed) { //clean up
delete matrix; delete list; delete cluster; delete rabund;
listFile.close();
- for (int i = 0; i < listFileNames.size(); i++) { remove(listFileNames[i].c_str()); }
+ for (int i = 0; i < listFileNames.size(); i++) { m->mothurRemove(listFileNames[i]); }
listFileNames.clear(); return listFileNames;
}
listFile.close();
if (m->control_pressed) { //clean up
- for (int i = 0; i < listFileNames.size(); i++) { remove(listFileNames[i].c_str()); }
+ for (int i = 0; i < listFileNames.size(); i++) { m->mothurRemove(listFileNames[i]); }
listFileNames.clear(); return listFileNames;
}
- remove(thisDistFile.c_str());
- remove(thisNamefile.c_str());
+ m->mothurRemove(thisDistFile);
+ m->mothurRemove(thisNamefile);
if (saveCutoff != cutoff) {
if (hard) { saveCutoff = m->ceilDist(saveCutoff, precision); }
string thisOutputDir = outputDir;
if (outputDir == "") { thisOutputDir = m->hasPath(fastafile); }
string outputFileName = thisOutputDir + m->getRootName(m->getSimpleName(fastafile)) + "dist";
- remove(outputFileName.c_str());
+ m->mothurRemove(outputFileName);
for (int i = 0; i < distNames.size(); i++) {