Permalink
Browse files

Adds contigsreport to current files saved

  • Loading branch information...
1 parent 23f155b commit 241a1743e73b5740de4fc5c0556312c291690117 @mothur-westcott mothur-westcott committed Feb 20, 2017
@@ -164,6 +164,8 @@ int GetCurrentCommand::execute(){
m->setTaxonomyFile("");
}else if (types[i] == "constaxonomy") {
m->setConsTaxonomyFile("");
+ }else if (types[i] == "contigsreport") {
+ m->setContigsReportFile("");
}else if (types[i] == "flow") {
m->setFlowFile("");
}else if (types[i] == "biom") {
@@ -583,7 +583,7 @@ int MakeContigsCommand::execute(){
string currentReport = "";
itTypes = outputTypes.find("report");
if (itTypes != outputTypes.end()) {
- if ((itTypes->second).size() != 0) { currentReport = (itTypes->second)[0]; }
+ if ((itTypes->second).size() != 0) { currentReport = (itTypes->second)[0]; m->setContigsReportFile(currentReport); }
}
//output group counts
@@ -26,6 +26,7 @@ vector<string> SetCurrentCommand::setParameters(){
CommandParameter plist("list", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(plist);
CommandParameter ptaxonomy("taxonomy", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(ptaxonomy);
CommandParameter pconstaxonomy("constaxonomy", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pconstaxonomy);
+ CommandParameter pcontigsreport("contigsreport", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pcontigsreport);
CommandParameter pqfile("qfile", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(pqfile);
CommandParameter paccnos("accnos", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(paccnos);
CommandParameter prabund("rabund", "InputTypes", "", "", "none", "none", "none","",false,false); parameters.push_back(prabund);
@@ -59,9 +60,9 @@ string SetCurrentCommand::getHelpString(){
try {
string helpString = "";
helpString += "The set.current command allows you to set the current files saved by mothur.\n";
- helpString += "The set.current command parameters are: current, clear, phylip, column, list, rabund, sabund, name, group, design, order, tree, shared, ordergroup, relabund, fasta, qfile, sff, oligos, accnos, biom, count, summary, file, constaxonomy and taxonomy.\n";
+ helpString += "The set.current command parameters are: current, clear, phylip, column, list, rabund, sabund, name, group, design, order, tree, shared, ordergroup, relabund, fasta, qfile, sff, oligos, accnos, biom, count, summary, file, contigsreport, constaxonomy and taxonomy.\n";
helpString += "The current parameter is used to input the output file from get.current. This function is intended to allow you to input filenames from previous instances on mothur. NOTE: If you have a current file set in the file *.current_files.summary file, and also set a value for that file type, the value set takes precedence. For example, if you run set.current(current=current_files.summary, fasta=abrecovery.fasta) and your have fasta=final.fasta in the *.current_files.summary file the current fasta file will be set to abrecovery.fasta.\n";
- helpString += "The clear paramter is used to indicate which file types you would like to clear values for, multiple types can be separated by dashes.\n";
+ helpString += "The clear parameter is used to indicate which file types you would like to clear values for, multiple types can be separated by dashes.\n";
helpString += "The set.current command should be in the following format: \n";
helpString += "set.current(fasta=yourFastaFile) or set.current(fasta=amazon.fasta, clear=name-accnos)\n";
return helpString;
@@ -307,6 +308,14 @@ SetCurrentCommand::SetCurrentCommand(string option) {
//if the user has not given a path then, add inputdir. else leave path alone.
if (path == "") { parameters["constaxonomy"] = inputDir + it->second; }
}
+
+ it = parameters.find("contigsreport");
+ //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["contigsreport"] = inputDir + it->second; }
+ }
it = parameters.find("flow");
//user has given a template file
@@ -458,6 +467,11 @@ SetCurrentCommand::SetCurrentCommand(string option) {
else if (taxonomyfile == "not found") { taxonomyfile = ""; }
if (taxonomyfile != "") { m->setTaxonomyFile(taxonomyfile); }
+ contigsreportfile = validParameter.validFile(parameters, "contigsreport", true);
+ if (contigsreportfile == "not open") { m->mothurOut("Ignoring: " + parameters["contigsreport"]); m->mothurOutEndLine(); contigsreportfile = ""; }
+ else if (contigsreportfile == "not found") { contigsreportfile = ""; }
+ if (contigsreportfile != "") { m->setContigsReportFile(contigsreportfile); }
+
constaxonomyfile = validParameter.validFile(parameters, "constaxonomy", true);
if (constaxonomyfile == "not open") { m->mothurOut("Ignoring: " + parameters["constaxonomy"]); m->mothurOutEndLine(); constaxonomyfile = ""; }
else if (constaxonomyfile == "not found") { constaxonomyfile = ""; }
@@ -552,6 +566,8 @@ int SetCurrentCommand::execute(){
m->setTaxonomyFile("");
}else if (types[i] == "constaxonomy") {
m->setConsTaxonomyFile("");
+ }else if (types[i] == "contigsreport") {
+ m->setContigsReportFile("");
}else if (types[i] == "flow") {
m->setFlowFile("");
}else if (types[i] == "biom") {
@@ -41,7 +41,7 @@ class SetCurrentCommand : public Command {
vector<string> types;
string accnosfile, phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, designfile, taxonomyfile, biomfile, countfile, summaryfile, currentFile, outputDir;
- string orderfile, treefile, sharedfile, ordergroupfile, relabundfile, fastafile, qualfile, sfffile, oligosfile, processors, flowfile, filefile, constaxonomyfile;
+ string orderfile, treefile, sharedfile, ordergroupfile, relabundfile, fastafile, qualfile, sfffile, oligosfile, processors, flowfile, filefile, constaxonomyfile, contigsreportfile;
int readCurrentFiles();
View
@@ -45,6 +45,7 @@ set<string> MothurOut::getCurrentTypes() {
types.insert("shared");
types.insert("taxonomy");
types.insert("constaxonomy");
+ types.insert("contigsreport");
types.insert("tree");
types.insert("flow");
types.insert("biom");
@@ -85,6 +86,7 @@ void MothurOut::printCurrentFiles(string filename) {
if (sharedfile != "") { mothurOut("shared=" + sharedfile, out); mothurOutEndLine(out); }
if (taxonomyfile != "") { mothurOut("taxonomy=" + taxonomyfile, out); mothurOutEndLine(out); }
if (constaxonomyfile != "") { mothurOut("constaxonomy=" + constaxonomyfile, out); mothurOutEndLine(out);}
+ if (contigsreportfile != ""){ mothurOut("contigsreport=" + contigsreportfile, out); mothurOutEndLine(out);}
if (treefile != "") { mothurOut("tree=" + treefile, out); mothurOutEndLine(out); }
if (flowfile != "") { mothurOut("flow=" + flowfile, out); mothurOutEndLine(out); }
if (biomfile != "") { mothurOut("biom=" + biomfile, out); mothurOutEndLine(out); }
@@ -115,6 +117,7 @@ void MothurOut::printCurrentFiles(string filename) {
if (sharedfile != "") { mothurOut("shared=" + sharedfile); mothurOutEndLine(); }
if (taxonomyfile != "") { mothurOut("taxonomy=" + taxonomyfile); mothurOutEndLine(); }
if (constaxonomyfile != "") { mothurOut("constaxonomy=" + constaxonomyfile); mothurOutEndLine();}
+ if (contigsreportfile != ""){ mothurOut("contigsreport=" + contigsreportfile); mothurOutEndLine();}
if (treefile != "") { mothurOut("tree=" + treefile); mothurOutEndLine(); }
if (flowfile != "") { mothurOut("flow=" + flowfile); mothurOutEndLine(); }
if (biomfile != "") { mothurOut("biom=" + biomfile); mothurOutEndLine(); }
@@ -154,6 +157,7 @@ bool MothurOut::hasCurrentFiles() {
if (sharedfile != "") { return true; }
if (taxonomyfile != "") { return true; }
if (constaxonomyfile != "") { return true; }
+ if (contigsreportfile != ""){ return true; }
if (treefile != "") { return true; }
if (flowfile != "") { return true; }
if (biomfile != "") { return true; }
@@ -187,6 +191,8 @@ void MothurOut::clearCurrentFiles() {
treefile = "";
sharedfile = "";
ordergroupfile = "";
+ contigsreportfile = "";
+ constaxonomyfile = "";
relabundfile = "";
fastafile = "";
qualfile = "";
View
@@ -233,7 +233,7 @@ class MothurOut {
int control_pressed;
bool executing, runParse, jumble, gui, mothurCalling, debug, quietMode;
- //current files - if you add a new type you must edit optionParser->getParameters, get.current and set.current commands and mothurOut->printCurrentFiles/clearCurrentFiles/getCurrentTypes. add a get and set function.
+ //current files - if you add a new type you must edit optionParser->getParameters, get.current and set.current commands and mothurOut->printCurrentFiles/clearCurrentFiles/getCurrentTypes/hasCurrentFiles. add a get and set function.
string getPhylipFile() { return phylipfile; }
string getColumnFile() { return columnfile; }
string getListFile() { return listfile; }
@@ -260,6 +260,7 @@ class MothurOut {
string getFileFile() { return filefile; }
string getProcessors() { return processors; }
string getConsTaxonomyFile(){ return constaxonomyfile; }
+ string getContigsReportFile(){ return contigsreportfile; }
int getNumErrors() { return numErrors; }
void setListFile(string f) { listfile = getFullPathName(f); }
@@ -286,6 +287,7 @@ class MothurOut {
void setSummaryFile(string f) { summaryfile = getFullPathName(f); }
void setFileFile(string f) { filefile = getFullPathName(f); }
void setConsTaxonomyFile(string f) { constaxonomyfile = getFullPathName(f); }
+ void setContigsReportFile(string f) { contigsreportfile = getFullPathName(f); }
void setCountTableFile(string f) { counttablefile = getFullPathName(f); groupMode = "count"; }
void setProcessors(string p) { processors = p; mothurOut("\nUsing " + toString(p) + " processors.\n"); }
@@ -326,6 +328,7 @@ class MothurOut {
biomfile = "";
counttablefile = "";
summaryfile = "";
+ contigsreportfile = "";
gui = false;
printedSharedHeaders = false;
printedListHeaders = false;
@@ -347,7 +350,7 @@ class MothurOut {
string releaseDate, version;
string accnosfile, phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, designfile, taxonomyfile, biomfile, filefile;
- string orderfile, treefile, sharedfile, ordergroupfile, relabundfile, fastafile, qualfile, sfffile, oligosfile, processors, flowfile, counttablefile, summaryfile, constaxonomyfile;
+ string orderfile, treefile, sharedfile, ordergroupfile, relabundfile, fastafile, qualfile, sfffile, oligosfile, processors, flowfile, counttablefile, summaryfile, constaxonomyfile, contigsreportfile;
vector<string> Groups;
vector<string> namesOfGroups;
View
@@ -150,6 +150,8 @@ map<string, string> OptionParser::getParameters() {
it->second = m->getTaxonomyFile();
}else if (it->first == "constaxonomy") {
it->second = m->getConsTaxonomyFile();
+ }else if (it->first == "contigsreport") {
+ it->second = m->getContigsReportFile();
}else if (it->first == "biom") {
it->second = m->getBiomFile();
}else if (it->first == "count") {

0 comments on commit 241a174

Please sign in to comment.