From: westcott Date: Tue, 14 Jun 2011 16:53:32 +0000 (+0000) Subject: working on current change X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=7bf9a81bba76538ecaf351ae208de3da4bf1b6dd working on current change --- diff --git a/getgroupscommand.cpp b/getgroupscommand.cpp index 37e5d40..1ba8aa7 100644 --- a/getgroupscommand.cpp +++ b/getgroupscommand.cpp @@ -164,15 +164,18 @@ GetGroupsCommand::GetGroupsCommand(string option) { //check for required parameters accnosfile = validParameter.validFile(parameters, "accnos", true); if (accnosfile == "not open") { abort = true; } - else if (accnosfile == "not found") { accnosfile = ""; } + else if (accnosfile == "not found") { accnosfile = ""; } + else { m->setAccnosFile(accnosfile); } fastafile = validParameter.validFile(parameters, "fasta", true); if (fastafile == "not open") { abort = true; } - else if (fastafile == "not found") { fastafile = ""; } + else if (fastafile == "not found") { fastafile = ""; } + else { m->setFastaFile(fastafile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } @@ -181,15 +184,17 @@ GetGroupsCommand::GetGroupsCommand(string option) { groupfile = m->getGroupFile(); if (groupfile != "") { m->mothurOut("Using " + groupfile + " as input file for the group parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current groupfile and the group parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setGroupFile(groupfile); } listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { abort = true; } else if (listfile == "not found") { listfile = ""; } + else { m->setListFile(listfile); } taxfile = validParameter.validFile(parameters, "taxonomy", true); if (taxfile == "not open") { abort = true; } else if (taxfile == "not found") { taxfile = ""; } + else { m->setTaxonomyFile(taxfile); } groups = validParameter.validFile(parameters, "groups", false); if (groups == "not found") { groups = "all"; } diff --git a/getlabelcommand.cpp b/getlabelcommand.cpp index aba8e8a..8535db3 100644 --- a/getlabelcommand.cpp +++ b/getlabelcommand.cpp @@ -113,17 +113,17 @@ 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; } + else { format = "rabund"; inputfile = rabundfile; m->setRabundFile(rabundfile); } if ((listfile == "") && (rabundfile == "") && (sabundfile == "")) { //is there are current file available for any of these? diff --git a/getlineagecommand.cpp b/getlineagecommand.cpp index fc17310..0d83613 100644 --- a/getlineagecommand.cpp +++ b/getlineagecommand.cpp @@ -169,15 +169,18 @@ GetLineageCommand::GetLineageCommand(string option) { //check for required parameters fastafile = validParameter.validFile(parameters, "fasta", true); if (fastafile == "not open") { abort = true; } - else if (fastafile == "not found") { fastafile = ""; } + else if (fastafile == "not found") { fastafile = ""; } + else { m->setFastaFile(fastafile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } else if (groupfile == "not found") { groupfile = ""; } + else { m->setGroupFile(groupfile); } alignfile = validParameter.validFile(parameters, "alignreport", true); if (alignfile == "not open") { abort = true; } @@ -186,6 +189,7 @@ GetLineageCommand::GetLineageCommand(string option) { listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { abort = true; } else if (listfile == "not found") { listfile = ""; } + else { m->setListFile(listfile); } taxfile = validParameter.validFile(parameters, "taxonomy", true); if (taxfile == "not open") { abort = true; } @@ -193,7 +197,7 @@ GetLineageCommand::GetLineageCommand(string option) { taxfile = m->getTaxonomyFile(); if (taxfile != "") { m->mothurOut("Using " + taxfile + " as input file for the taxonomy parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current taxonomy file and the taxonomy parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setTaxonomyFile(taxfile); } string usedDups = "true"; string temp = validParameter.validFile(parameters, "dups", false); diff --git a/getlistcountcommand.cpp b/getlistcountcommand.cpp index 4dc2063..57afd85 100644 --- a/getlistcountcommand.cpp +++ b/getlistcountcommand.cpp @@ -114,6 +114,7 @@ GetListCountCommand::GetListCountCommand(string option) { 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); } //check for optional parameter and set defaults diff --git a/getoturepcommand.cpp b/getoturepcommand.cpp index ce4b895..3e31691 100644 --- a/getoturepcommand.cpp +++ b/getoturepcommand.cpp @@ -203,6 +203,7 @@ GetOTURepCommand::GetOTURepCommand(string option) { 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") { @@ -211,20 +212,22 @@ GetOTURepCommand::GetOTURepCommand(string option) { 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 @@ -263,7 +266,8 @@ GetOTURepCommand::GetOTURepCommand(string option) { 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")) { diff --git a/getotuscommand.cpp b/getotuscommand.cpp index 681deb7..d29773c 100644 --- a/getotuscommand.cpp +++ b/getotuscommand.cpp @@ -134,7 +134,8 @@ GetOtusCommand::GetOtusCommand(string option) { //check for required parameters accnosfile = validParameter.validFile(parameters, "accnos", true); if (accnosfile == "not open") { abort = true; } - else if (accnosfile == "not found") { accnosfile = ""; } + else if (accnosfile == "not found") { accnosfile = ""; } + else { m->setAccnosFile(accnosfile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } @@ -142,7 +143,7 @@ GetOtusCommand::GetOtusCommand(string option) { groupfile = m->getGroupFile(); if (groupfile != "") { m->mothurOut("Using " + groupfile + " as input file for the group parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current group file and the group parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setGroupFile(groupfile); } listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { abort = true; } @@ -150,7 +151,7 @@ GetOtusCommand::GetOtusCommand(string option) { listfile = m->getListFile(); if (listfile != "") { m->mothurOut("Using " + listfile + " as input file for the list parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current list file and the list parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setListFile(listfile); } groups = validParameter.validFile(parameters, "groups", false); if (groups == "not found") { groups = ""; } diff --git a/getrabundcommand.cpp b/getrabundcommand.cpp index f886c23..9c89f7f 100644 --- a/getrabundcommand.cpp +++ b/getrabundcommand.cpp @@ -116,12 +116,12 @@ GetRAbundCommand::GetRAbundCommand(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); } //check for optional parameter and set defaults diff --git a/getrelabundcommand.cpp b/getrelabundcommand.cpp index d4caf5b..693e36d 100644 --- a/getrelabundcommand.cpp +++ b/getrelabundcommand.cpp @@ -111,7 +111,7 @@ GetRelAbundCommand::GetRelAbundCommand(string option) { sharedfile = m->getSharedFile(); if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setSharedFile(sharedfile); } //if the user changes the output directory command factory will send this info to us in the output parameter diff --git a/getsabundcommand.cpp b/getsabundcommand.cpp index 3f64136..799d8dc 100644 --- a/getsabundcommand.cpp +++ b/getsabundcommand.cpp @@ -114,12 +114,12 @@ GetSAbundCommand::GetSAbundCommand(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); } rabundfile = validParameter.validFile(parameters, "rabund", true); if (rabundfile == "not open") { rabundfile = ""; abort = true; } else if (rabundfile == "not found") { rabundfile = ""; } - else { format = "rabund"; inputfile = rabundfile; } + else { format = "rabund"; inputfile = rabundfile; m->setRabundFile(rabundfile); } //check for optional parameter and set defaults diff --git a/getseqscommand.cpp b/getseqscommand.cpp index a4697ca..71a2db9 100644 --- a/getseqscommand.cpp +++ b/getseqscommand.cpp @@ -201,21 +201,24 @@ GetSeqsCommand::GetSeqsCommand(string option) { m->mothurOut("You have no valid accnos file and accnos is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setAccnosFile(accnosfile); } if (accnosfile2 == "not found") { accnosfile2 = ""; } fastafile = validParameter.validFile(parameters, "fasta", true); if (fastafile == "not open") { abort = true; } - else if (fastafile == "not found") { fastafile = ""; } + else if (fastafile == "not found") { fastafile = ""; } + else { m->setFastaFile(fastafile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } else if (groupfile == "not found") { groupfile = ""; } + else { m->setGroupFile(groupfile); } alignfile = validParameter.validFile(parameters, "alignreport", true); if (alignfile == "not open") { abort = true; } @@ -224,14 +227,17 @@ GetSeqsCommand::GetSeqsCommand(string option) { listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { abort = true; } else if (listfile == "not found") { listfile = ""; } + else { m->setListFile(listfile); } taxfile = validParameter.validFile(parameters, "taxonomy", true); if (taxfile == "not open") { abort = true; } else if (taxfile == "not found") { taxfile = ""; } + else { m->setTaxonomyFile(taxfile); } qualfile = validParameter.validFile(parameters, "qfile", true); if (qualfile == "not open") { abort = true; } else if (qualfile == "not found") { qualfile = ""; } + else { m->setQualFile(qualfile); } accnosfile2 = validParameter.validFile(parameters, "accnos2", true); if (accnosfile2 == "not open") { abort = true; } diff --git a/getsharedotucommand.cpp b/getsharedotucommand.cpp index 9968770..06e199f 100644 --- a/getsharedotucommand.cpp +++ b/getsharedotucommand.cpp @@ -148,7 +148,7 @@ GetSharedOTUCommand::GetSharedOTUCommand(string option) { m->mothurOut("No valid current list file. You must provide a list file."); m->mothurOutEndLine(); abort = true; } - }else { format = "list"; } + }else { format = "list"; m->setListFile(listfile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } @@ -159,7 +159,7 @@ GetSharedOTUCommand::GetSharedOTUCommand(string option) { m->mothurOut("No valid current group file. You must provide a group file."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setGroupFile(groupfile); } if ((listfile == "") || (groupfile == "")) { m->mothurOut("The list and group parameters are required."); m->mothurOutEndLine(); abort = true; } @@ -197,7 +197,7 @@ GetSharedOTUCommand::GetSharedOTUCommand(string option) { fastafile = validParameter.validFile(parameters, "fasta", true); if (fastafile == "not open") { abort = true; } else if (fastafile == "not found") { fastafile = ""; } - + else { m->setFastaFile(fastafile); } } } diff --git a/hclustercommand.cpp b/hclustercommand.cpp index 3e99473..d98f5c6 100644 --- a/hclustercommand.cpp +++ b/hclustercommand.cpp @@ -135,16 +135,17 @@ HClusterCommand::HClusterCommand(string option) { 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 { m->setNameFile(namefile); } if ((phylipfile == "") && (columnfile == "")) { //is there are current file available for either of these? diff --git a/heatmapcommand.cpp b/heatmapcommand.cpp index cf5140a..0d8c5b0 100644 --- a/heatmapcommand.cpp +++ b/heatmapcommand.cpp @@ -153,27 +153,27 @@ HeatMapCommand::HeatMapCommand(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; } + else { format = "rabund"; inputfile = rabundfile; m->setRabundFile(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 = "sharedfile"; inputfile = sharedfile; m->setSharedFile(sharedfile); } relabundfile = validParameter.validFile(parameters, "relabund", true); if (relabundfile == "not open") { relabundfile = ""; abort = true; } else if (relabundfile == "not found") { relabundfile = ""; } - else { format = "relabund"; inputfile = relabundfile; } + else { format = "relabund"; inputfile = relabundfile; m->setRelAbundFile(relabundfile); } if ((sharedfile == "") && (listfile == "") && (rabundfile == "") && (sabundfile == "") && (relabundfile == "")) { diff --git a/heatmapsimcommand.cpp b/heatmapsimcommand.cpp index 92271d9..38e344d 100644 --- a/heatmapsimcommand.cpp +++ b/heatmapsimcommand.cpp @@ -158,21 +158,22 @@ HeatMapSimCommand::HeatMapSimCommand(string option) { phylipfile = validParameter.validFile(parameters, "phylip", true); if (phylipfile == "not open") { abort = true; } else if (phylipfile == "not found") { phylipfile = ""; } - else { format = "phylip"; inputfile = phylipfile; if (outputDir == "") { outputDir += m->hasPath(phylipfile); } } + else { format = "phylip"; inputfile = phylipfile; m-> setPhylipFile(phylipfile); if (outputDir == "") { outputDir += m->hasPath(phylipfile); } } columnfile = validParameter.validFile(parameters, "column", true); if (columnfile == "not open") { abort = true; } else if (columnfile == "not found") { columnfile = ""; } - else { format = "column"; inputfile = columnfile; if (outputDir == "") { outputDir += m->hasPath(columnfile); } } + else { format = "column"; inputfile = columnfile; m->setColumnFile(columnfile); if (outputDir == "") { outputDir += m->hasPath(columnfile); } } sharedfile = validParameter.validFile(parameters, "shared", true); if (sharedfile == "not open") { abort = true; } else if (sharedfile == "not found") { sharedfile = ""; } - else { format = "shared"; inputfile = sharedfile; if (outputDir == "") { outputDir += m->hasPath(sharedfile); } } + else { format = "shared"; inputfile = sharedfile; m->setSharedFile(sharedfile); if (outputDir == "") { outputDir += m->hasPath(sharedfile); } } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } //error checking on files diff --git a/homovacommand.cpp b/homovacommand.cpp index a8d2786..22fd1bf 100644 --- a/homovacommand.cpp +++ b/homovacommand.cpp @@ -125,7 +125,7 @@ HomovaCommand::HomovaCommand(string option) { if (phylipFileName != "") { m->mothurOut("Using " + phylipFileName + " as input file for the phylip parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current phylip file and the phylip parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setPhylipFile(phylipFileName); } //check for required parameters designFileName = validParameter.validFile(parameters, "design", true); @@ -135,7 +135,7 @@ HomovaCommand::HomovaCommand(string option) { designFileName = m->getDesignFile(); if (designFileName != "") { m->mothurOut("Using " + designFileName + " as input file for the design parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current design file and the design parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setDesignFile(designFileName); } string temp = validParameter.validFile(parameters, "iters", false); if (temp == "not found") { temp = "1000"; } diff --git a/indicatorcommand.cpp b/indicatorcommand.cpp index ac7efcf..ab9e275 100644 --- a/indicatorcommand.cpp +++ b/indicatorcommand.cpp @@ -147,21 +147,22 @@ IndicatorCommand::IndicatorCommand(string option) { treefile = m->getTreeFile(); if (treefile != "") { m->mothurOut("Using " + treefile + " as input file for the tree parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current tree file and the tree parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setTreeFile(treefile); } sharedfile = validParameter.validFile(parameters, "shared", true); if (sharedfile == "not open") { abort = true; } else if (sharedfile == "not found") { sharedfile = ""; } - else { inputFileName = sharedfile; } + else { inputFileName = sharedfile; m->setSharedFile(sharedfile); } relabundfile = validParameter.validFile(parameters, "relabund", true); if (relabundfile == "not open") { abort = true; } else if (relabundfile == "not found") { relabundfile = ""; } - else { inputFileName = relabundfile; } + else { inputFileName = relabundfile; m->setRelAbundFile(relabundfile); } designfile = validParameter.validFile(parameters, "design", true); if (designfile == "not open") { abort = true; } else if (designfile == "not found") { designfile = ""; } + else { m->setDesignFile(designfile); } groups = validParameter.validFile(parameters, "groups", false); if (groups == "not found") { groups = ""; Groups.push_back("all"); } diff --git a/libshuffcommand.cpp b/libshuffcommand.cpp index 1143011..c993a06 100644 --- a/libshuffcommand.cpp +++ b/libshuffcommand.cpp @@ -138,7 +138,7 @@ LibShuffCommand::LibShuffCommand(string option) { m->mothurOut("You must provide a phylip file."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setPhylipFile(phylipfile); } //check for required parameters groupfile = validParameter.validFile(parameters, "group", true); @@ -150,7 +150,7 @@ LibShuffCommand::LibShuffCommand(string option) { m->mothurOut("You must provide a group file."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setGroupFile(groupfile); } //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"){ diff --git a/listseqscommand.cpp b/listseqscommand.cpp index 902ac87..3fe8360 100644 --- a/listseqscommand.cpp +++ b/listseqscommand.cpp @@ -150,15 +150,18 @@ ListSeqsCommand::ListSeqsCommand(string option) { //check for required parameters fastafile = validParameter.validFile(parameters, "fasta", true); if (fastafile == "not open") { abort = true; } - else if (fastafile == "not found") { fastafile = ""; } + else if (fastafile == "not found") { fastafile = ""; } + else { m->setFastaFile(fastafile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } else if (groupfile == "not found") { groupfile = ""; } + else { m->setGroupFile(groupfile); } alignfile = validParameter.validFile(parameters, "alignreport", true); if (alignfile == "not open") { abort = true; } @@ -167,10 +170,12 @@ ListSeqsCommand::ListSeqsCommand(string option) { listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { abort = true; } else if (listfile == "not found") { listfile = ""; } - + else { m->setListFile(listfile); } + taxfile = validParameter.validFile(parameters, "taxonomy", true); if (taxfile == "not open") { abort = true; } else if (taxfile == "not found") { taxfile = ""; } + else { m->setTaxonomyFile(taxfile); } if ((fastafile == "") && (namefile == "") && (listfile == "") && (groupfile == "") && (alignfile == "") && (taxfile == "")) { m->mothurOut("You must provide a file."); m->mothurOutEndLine(); abort = true; } diff --git a/makefastqcommand.cpp b/makefastqcommand.cpp index 2dd45a5..82f7301 100644 --- a/makefastqcommand.cpp +++ b/makefastqcommand.cpp @@ -116,7 +116,7 @@ MakeFastQCommand::MakeFastQCommand(string option) { fastafile = m->getFastaFile(); if (fastafile != "") { m->mothurOut("Using " + fastafile + " as input file for the fasta parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setFastaFile(fastafile); } qualfile = validParameter.validFile(parameters, "qfile", true); if (qualfile == "not open") { abort = true; qualfile = ""; } @@ -124,7 +124,7 @@ MakeFastQCommand::MakeFastQCommand(string option) { qualfile = m->getQualFile(); if (qualfile != "") { m->mothurOut("Using " + qualfile + " as input file for the qfile parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current qualfile and the qfile parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setQualFile(qualfile); } //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"){ outputDir = m->hasPath(fastafile); } diff --git a/makegroupcommand.cpp b/makegroupcommand.cpp index e770464..2cab212 100644 --- a/makegroupcommand.cpp +++ b/makegroupcommand.cpp @@ -159,7 +159,7 @@ MakeGroupCommand::MakeGroupCommand(string option) { //erase from file list fastaFileNames.erase(fastaFileNames.begin()+i); i--; - }else{ filename += m->getRootName(m->getSimpleName(fastaFileNames[i])); } + }else{ filename += m->getRootName(m->getSimpleName(fastaFileNames[i])); m->setFastaFile(fastaFileNames[i]); } } } diff --git a/matrixoutputcommand.cpp b/matrixoutputcommand.cpp index 3b5d873..7800910 100644 --- a/matrixoutputcommand.cpp +++ b/matrixoutputcommand.cpp @@ -157,6 +157,7 @@ MatrixOutputCommand::MatrixOutputCommand(string option) { if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; } }else if (sharedfile == "not open") { sharedfile = ""; abort = true; } + else { m->setSharedFile(sharedfile); } //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"){ diff --git a/mergegroupscommand.cpp b/mergegroupscommand.cpp index f62bb0c..a01441e 100644 --- a/mergegroupscommand.cpp +++ b/mergegroupscommand.cpp @@ -126,7 +126,7 @@ MergeGroupsCommand::MergeGroupsCommand(string option) { designfile = m->getDesignFile(); if (designfile != "") { m->mothurOut("Using " + designfile + " as input file for the design parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current designfile and the design parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setDesignFile(designfile); } //make sure the user has already run the read.otu command sharedfile = validParameter.validFile(parameters, "shared", true); @@ -136,7 +136,7 @@ MergeGroupsCommand::MergeGroupsCommand(string option) { sharedfile = m->getSharedFile(); if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setSharedFile(sharedfile); } //check for optional parameter and set defaults // ...at some point should added some additional type checking... diff --git a/metastatscommand.cpp b/metastatscommand.cpp index 99a3043..0704f55 100644 --- a/metastatscommand.cpp +++ b/metastatscommand.cpp @@ -134,7 +134,7 @@ MetaStatsCommand::MetaStatsCommand(string option) { sharedfile = m->getSharedFile(); if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setSharedFile(sharedfile); } //check for required parameters designfile = validParameter.validFile(parameters, "design", true); @@ -144,7 +144,7 @@ MetaStatsCommand::MetaStatsCommand(string option) { designfile = m->getDesignFile(); if (designfile != "") { m->mothurOut("Using " + designfile + " as input file for the design parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current designfile and the design parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setDesignFile(designfile); } //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"){ diff --git a/mgclustercommand.cpp b/mgclustercommand.cpp index 5a790af..fd26717 100644 --- a/mgclustercommand.cpp +++ b/mgclustercommand.cpp @@ -141,6 +141,7 @@ MGClusterCommand::MGClusterCommand(string option) { namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } if ((blastfile == "")) { m->mothurOut("When executing a mgcluster command you must provide a blastfile."); m->mothurOutEndLine(); abort = true; } diff --git a/nmdscommand.cpp b/nmdscommand.cpp index 4567dbb..946aa68 100644 --- a/nmdscommand.cpp +++ b/nmdscommand.cpp @@ -128,7 +128,7 @@ NMDSCommand::NMDSCommand(string option) { phylipfile = m->getPhylipFile(); if (phylipfile != "") { m->mothurOut("Using " + phylipfile + " as input file for the phylip parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current phylip file and the phylip parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setPhylipFile(phylipfile); } axesfile = validParameter.validFile(parameters, "axes", true); if (axesfile == "not open") { axesfile = ""; abort = true; } diff --git a/normalizesharedcommand.cpp b/normalizesharedcommand.cpp index 07c353a..a4bdd47 100644 --- a/normalizesharedcommand.cpp +++ b/normalizesharedcommand.cpp @@ -122,12 +122,12 @@ NormalizeSharedCommand::NormalizeSharedCommand(string option) { 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 = "sharedfile"; inputfile = sharedfile; m->setSharedFile(sharedfile); } relabundfile = validParameter.validFile(parameters, "relabund", true); if (relabundfile == "not open") { relabundfile = ""; abort = true; } else if (relabundfile == "not found") { relabundfile = ""; } - else { format = "relabund"; inputfile = relabundfile; } + else { format = "relabund"; inputfile = relabundfile; m->setRelAbundFile(relabundfile); } if ((sharedfile == "") && (relabundfile == "")) { diff --git a/otuhierarchycommand.cpp b/otuhierarchycommand.cpp index cc57032..b1f0539 100644 --- a/otuhierarchycommand.cpp +++ b/otuhierarchycommand.cpp @@ -110,6 +110,7 @@ OtuHierarchyCommand::OtuHierarchyCommand(string option) { abort = true; } }else if (listFile == "not open") { 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"){ diff --git a/pairwiseseqscommand.cpp b/pairwiseseqscommand.cpp index db03251..75a1388 100644 --- a/pairwiseseqscommand.cpp +++ b/pairwiseseqscommand.cpp @@ -198,6 +198,8 @@ PairwiseSeqsCommand::PairwiseSeqsCommand(string option) { //erase from file list fastaFileNames.erase(fastaFileNames.begin()+i); i--; + }else { + m->setFastaFile(fastaFileNames[i]); } } } diff --git a/parselistscommand.cpp b/parselistscommand.cpp index b791be7..e2c3e01 100644 --- a/parselistscommand.cpp +++ b/parselistscommand.cpp @@ -123,7 +123,7 @@ ParseListCommand::ParseListCommand(string option) { abort = true; } - } + }else { m->setListFile(listfile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } @@ -137,6 +137,7 @@ ParseListCommand::ParseListCommand(string option) { if (error == 1) { abort = true; } }else { m->mothurOut("No valid current group file. You must provide a group file."); m->mothurOutEndLine(); abort = true; } }else { + m->setGroupFile(groupfile); groupMap = new GroupMap(groupfile); int error = groupMap->readMap(); diff --git a/parsimonycommand.cpp b/parsimonycommand.cpp index 403b2b8..6e69cad 100644 --- a/parsimonycommand.cpp +++ b/parsimonycommand.cpp @@ -144,16 +144,18 @@ ParsimonyCommand::ParsimonyCommand(string option) { treefile = m->getTreeFile(); if (treefile != "") { m->mothurOut("Using " + treefile + " as input file for the tree parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current tree file and the tree parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setTreeFile(treefile); } //check for required parameters groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } else if (groupfile == "not found") { groupfile = ""; } + else { m->setGroupFile(groupfile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } } //if the user changes the output directory command factory will send this info to us in the output parameter diff --git a/pcacommand.cpp b/pcacommand.cpp index e273e5f..5eed456 100644 --- a/pcacommand.cpp +++ b/pcacommand.cpp @@ -117,12 +117,12 @@ PCACommand::PCACommand(string option) { sharedfile = validParameter.validFile(parameters, "shared", true); if (sharedfile == "not open") { sharedfile = ""; abort = true; } else if (sharedfile == "not found") { sharedfile = ""; } - else { mode = "sharedfile"; inputFile = sharedfile; } + else { mode = "sharedfile"; inputFile = sharedfile; m->setSharedFile(sharedfile); } relabundfile = validParameter.validFile(parameters, "relabund", true); if (relabundfile == "not open") { relabundfile = ""; abort = true; } else if (relabundfile == "not found") { relabundfile = ""; } - else { mode = "relabund"; inputFile = relabundfile; } + else { mode = "relabund"; inputFile = relabundfile; m->setRelAbundFile(relabundfile); } if ((sharedfile == "") && (relabundfile == "")) { diff --git a/pcoacommand.cpp b/pcoacommand.cpp index 5d91737..20e8e1b 100644 --- a/pcoacommand.cpp +++ b/pcoacommand.cpp @@ -111,7 +111,7 @@ PCOACommand::PCOACommand(string option) { phylipfile = m->getPhylipFile(); if (phylipfile != "") { m->mothurOut("Using " + phylipfile + " as input file for the phylip parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current phylip file and the phylip parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setPhylipFile(phylipfile); } filename = phylipfile; diff --git a/phylodiversitycommand.cpp b/phylodiversitycommand.cpp index 8e8c7b6..abb1243 100644 --- a/phylodiversitycommand.cpp +++ b/phylodiversitycommand.cpp @@ -150,16 +150,18 @@ PhyloDiversityCommand::PhyloDiversityCommand(string option) { treefile = m->getTreeFile(); if (treefile != "") { m->mothurOut("Using " + treefile + " as input file for the tree parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current tree file and the tree parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setTreeFile(treefile); } //check for required parameters groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { groupfile = ""; abort = true; } else if (groupfile == "not found") { groupfile = ""; } + else { m->setGroupFile(groupfile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = m->hasPath(treefile); } diff --git a/phylotypecommand.cpp b/phylotypecommand.cpp index c03fcc1..ef23375 100644 --- a/phylotypecommand.cpp +++ b/phylotypecommand.cpp @@ -129,11 +129,12 @@ PhylotypeCommand::PhylotypeCommand(string option) { abort = true; } }else if (taxonomyFileName == "not open") { abort = true; } + else { m->setTaxonomyFile(taxonomyFileName); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } - else { readNamesFile(); } + else { readNamesFile(); m->setNameFile(namefile); } //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"){ diff --git a/pipelinepdscommand.cpp b/pipelinepdscommand.cpp index 7a9d530..898ad9b 100644 --- a/pipelinepdscommand.cpp +++ b/pipelinepdscommand.cpp @@ -188,6 +188,7 @@ PipelineCommand::PipelineCommand(string option) { sffFile = validParameter.validFile(parameters, "sff", true); if (sffFile == "not found") { m->mothurOut("sff is a required parameter for the pipeline command."); m->mothurOutEndLine(); abort = true; } else if (sffFile == "not open") { sffFile = ""; abort = true; } + else { m->setSFFFile(sffFile); } oligosFile = validParameter.validFile(parameters, "oligos", true); if (oligosFile == "not found") { m->mothurOut("oligos is a required parameter for the pipeline command."); m->mothurOutEndLine(); abort = true; } diff --git a/preclustercommand.cpp b/preclustercommand.cpp index 9299a6c..f13b29c 100644 --- a/preclustercommand.cpp +++ b/preclustercommand.cpp @@ -124,6 +124,7 @@ PreClusterCommand::PreClusterCommand(string option) { 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); } //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"){ @@ -136,7 +137,7 @@ PreClusterCommand::PreClusterCommand(string option) { namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not found") { namefile = ""; } else if (namefile == "not open") { abort = true; } - else { readNameFile(); } + else { readNameFile(); m->setNameFile(namefile); } string temp = validParameter.validFile(parameters, "diffs", false); if(temp == "not found"){ temp = "1"; } convert(temp, diffs); diff --git a/rarefactcommand.cpp b/rarefactcommand.cpp index 82251c4..b9007f4 100644 --- a/rarefactcommand.cpp +++ b/rarefactcommand.cpp @@ -184,22 +184,22 @@ RareFactCommand::RareFactCommand(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; } + else { format = "rabund"; inputfile = rabundfile; m->setRabundFile(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 = "sharedfile"; inputfile = sharedfile; m->setSharedFile(sharedfile); } if ((sharedfile == "") && (listfile == "") && (rabundfile == "") && (sabundfile == "")) { //is there are current file available for any of these? diff --git a/rarefactsharedcommand.cpp b/rarefactsharedcommand.cpp index fe92f97..717fec2 100644 --- a/rarefactsharedcommand.cpp +++ b/rarefactsharedcommand.cpp @@ -124,7 +124,7 @@ RareFactSharedCommand::RareFactSharedCommand(string option) { sharedfile = m->getSharedFile(); if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setSharedFile(sharedfile); } //if the user changes the output directory command factory will send this info to us in the output parameter diff --git a/removegroupscommand.cpp b/removegroupscommand.cpp index 7034941..9b53728 100644 --- a/removegroupscommand.cpp +++ b/removegroupscommand.cpp @@ -166,14 +166,17 @@ RemoveGroupsCommand::RemoveGroupsCommand(string option) { accnosfile = validParameter.validFile(parameters, "accnos", true); if (accnosfile == "not open") { abort = true; } else if (accnosfile == "not found") { accnosfile = ""; } + else { m->setAccnosFile(accnosfile); } fastafile = validParameter.validFile(parameters, "fasta", true); if (fastafile == "not open") { abort = true; } else if (fastafile == "not found") { fastafile = ""; } + else { m->setFastaFile(fastafile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } @@ -182,15 +185,17 @@ RemoveGroupsCommand::RemoveGroupsCommand(string option) { groupfile = m->getGroupFile(); if (groupfile != "") { m->mothurOut("Using " + groupfile + " as input file for the group parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current groupfile and the group parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setGroupFile(groupfile); } listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { abort = true; } else if (listfile == "not found") { listfile = ""; } + else { m->setListFile(listfile); } taxfile = validParameter.validFile(parameters, "taxonomy", true); if (taxfile == "not open") { abort = true; } else if (taxfile == "not found") { taxfile = ""; } + else { m->setTaxonomyFile(taxfile); } groups = validParameter.validFile(parameters, "groups", false); if (groups == "not found") { groups = ""; } diff --git a/removelineagecommand.cpp b/removelineagecommand.cpp index 5f5435f..d1db13f 100644 --- a/removelineagecommand.cpp +++ b/removelineagecommand.cpp @@ -171,14 +171,17 @@ RemoveLineageCommand::RemoveLineageCommand(string option) { fastafile = validParameter.validFile(parameters, "fasta", true); if (fastafile == "not open") { abort = true; } else if (fastafile == "not found") { fastafile = ""; } + else { m->setFastaFile(fastafile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } else if (groupfile == "not found") { groupfile = ""; } + else { m->setGroupFile(groupfile); } alignfile = validParameter.validFile(parameters, "alignreport", true); if (alignfile == "not open") { abort = true; } @@ -187,6 +190,7 @@ RemoveLineageCommand::RemoveLineageCommand(string option) { listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { abort = true; } else if (listfile == "not found") { listfile = ""; } + else { m->setListFile(listfile); } taxfile = validParameter.validFile(parameters, "taxonomy", true); if (taxfile == "not open") { abort = true; } @@ -194,7 +198,7 @@ RemoveLineageCommand::RemoveLineageCommand(string option) { taxfile = m->getTaxonomyFile(); if (taxfile != "") { m->mothurOut("Using " + taxfile + " as input file for the taxonomy parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current taxonomy file and the taxonomy parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setTaxonomyFile(taxfile); } string usedDups = "true"; string temp = validParameter.validFile(parameters, "dups", false); diff --git a/removeotuscommand.cpp b/removeotuscommand.cpp index 30f337b..0fbed18 100644 --- a/removeotuscommand.cpp +++ b/removeotuscommand.cpp @@ -134,7 +134,8 @@ RemoveOtusCommand::RemoveOtusCommand(string option) { //check for required parameters accnosfile = validParameter.validFile(parameters, "accnos", true); if (accnosfile == "not open") { abort = true; } - else if (accnosfile == "not found") { accnosfile = ""; } + else if (accnosfile == "not found") { accnosfile = ""; } + else { m->setAccnosFile(accnosfile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } @@ -142,7 +143,7 @@ RemoveOtusCommand::RemoveOtusCommand(string option) { groupfile = m->getGroupFile(); if (groupfile != "") { m->mothurOut("Using " + groupfile + " as input file for the group parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current group file and the group parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setGroupFile(groupfile); } listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { abort = true; } @@ -150,7 +151,7 @@ RemoveOtusCommand::RemoveOtusCommand(string option) { listfile = m->getListFile(); if (listfile != "") { m->mothurOut("Using " + listfile + " as input file for the list parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current list file and the list parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setListFile(listfile); } groups = validParameter.validFile(parameters, "groups", false); if (groups == "not found") { groups = ""; } diff --git a/removerarecommand.cpp b/removerarecommand.cpp index 255448e..c320fa4 100644 --- a/removerarecommand.cpp +++ b/removerarecommand.cpp @@ -160,23 +160,28 @@ RemoveRareCommand::RemoveRareCommand(string option) { //check for file parameters listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { abort = true; } - else if (listfile == "not found") { listfile = ""; } + else if (listfile == "not found") { listfile = ""; } + else { m->setListFile(listfile); } sabundfile = validParameter.validFile(parameters, "sabund", true); if (sabundfile == "not open") { abort = true; } else if (sabundfile == "not found") { sabundfile = ""; } + else { m->setSabundFile(sabundfile); } rabundfile = validParameter.validFile(parameters, "rabund", true); if (rabundfile == "not open") { abort = true; } else if (rabundfile == "not found") { rabundfile = ""; } + else { m->setRabundFile(rabundfile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { groupfile = ""; abort = true; } else if (groupfile == "not found") { groupfile = ""; } + else { m->setGroupFile(groupfile); } sharedfile = validParameter.validFile(parameters, "shared", true); if (sharedfile == "not open") { sharedfile = ""; abort = true; } else if (sharedfile == "not found") { sharedfile = ""; } + else { m->setSharedFile(sharedfile); } if ((sharedfile == "") && (listfile == "") && (rabundfile == "") && (sabundfile == "")) { //is there are current file available for any of these? diff --git a/removeseqscommand.cpp b/removeseqscommand.cpp index c7dd5c2..b8bb464 100644 --- a/removeseqscommand.cpp +++ b/removeseqscommand.cpp @@ -191,19 +191,22 @@ RemoveSeqsCommand::RemoveSeqsCommand(string option) { m->mothurOut("You have no valid accnos file and accnos is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setAccnosFile(accnosfile); } fastafile = validParameter.validFile(parameters, "fasta", true); if (fastafile == "not open") { abort = true; } else if (fastafile == "not found") { fastafile = ""; } - + else { m->setFastaFile(fastafile); } + namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } - + else { m->setNameFile(namefile); } + groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } - else if (groupfile == "not found") { groupfile = ""; } + else if (groupfile == "not found") { groupfile = ""; } + else { m->setGroupFile(groupfile); } alignfile = validParameter.validFile(parameters, "alignreport", true); if (alignfile == "not open") { abort = true; } @@ -212,15 +215,17 @@ RemoveSeqsCommand::RemoveSeqsCommand(string option) { listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { abort = true; } else if (listfile == "not found") { listfile = ""; } + else { m->setListFile(listfile); } taxfile = validParameter.validFile(parameters, "taxonomy", true); if (taxfile == "not open") { abort = true; } else if (taxfile == "not found") { taxfile = ""; } + else { m->setTaxonomyFile(taxfile); } qualfile = validParameter.validFile(parameters, "qfile", true); if (qualfile == "not open") { abort = true; } else if (qualfile == "not found") { qualfile = ""; } - + else { m->setQualFile(qualfile); } string usedDups = "true"; string temp = validParameter.validFile(parameters, "dups", false); diff --git a/reversecommand.cpp b/reversecommand.cpp index 17924c9..ea2ddeb 100644 --- a/reversecommand.cpp +++ b/reversecommand.cpp @@ -113,11 +113,13 @@ ReverseSeqsCommand::ReverseSeqsCommand(string option) { fastaFileName = validParameter.validFile(parameters, "fasta", true); if (fastaFileName == "not open") { abort = true; } else if (fastaFileName == "not found") { fastaFileName = "";}// m->mothurOut("fasta is a required parameter for the reverse.seqs command."); m->mothurOutEndLine(); abort = true; } + else { m->setFastaFile(fastaFileName); } qualFileName = validParameter.validFile(parameters, "qfile", true); if (qualFileName == "not open") { abort = true; } else if (qualFileName == "not found") { qualFileName = ""; }//m->mothurOut("fasta is a required parameter for the reverse.seqs command."); m->mothurOutEndLine(); abort = true; } - + else { m->setQualFile(qualFileName); } + if((fastaFileName == "") && (qualFileName == "")){ fastaFileName = m->getFastaFile(); if (fastaFileName != "") { m->mothurOut("Using " + fastaFileName + " as input file for the fasta parameter."); m->mothurOutEndLine(); } diff --git a/screenseqscommand.cpp b/screenseqscommand.cpp index b68a8cc..9f7aa40 100644 --- a/screenseqscommand.cpp +++ b/screenseqscommand.cpp @@ -173,20 +173,24 @@ ScreenSeqsCommand::ScreenSeqsCommand(string option) { if (fastafile != "") { m->mothurOut("Using " + fastafile + " as input file for the fasta parameter."); m->mothurOutEndLine(); } 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 if (fastafile == "not open") { abort = true; } + else { m->setFastaFile(fastafile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } else if (groupfile == "not found") { groupfile = ""; } + else { m->setGroupFile(groupfile); } qualfile = validParameter.validFile(parameters, "qfile", true); if (qualfile == "not open") { abort = true; } else if (qualfile == "not found") { qualfile = ""; } + else { m->setQualFile(qualfile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { namefile = ""; abort = true; } else if (namefile == "not found") { namefile = ""; } - + else { m->setNameFile(namefile); } + alignreport = validParameter.validFile(parameters, "alignreport", true); if (alignreport == "not open") { abort = true; } else if (alignreport == "not found") { alignreport = ""; } diff --git a/secondarystructurecommand.cpp b/secondarystructurecommand.cpp index 2b84cc3..cc53ee0 100644 --- a/secondarystructurecommand.cpp +++ b/secondarystructurecommand.cpp @@ -127,11 +127,12 @@ AlignCheckCommand::AlignCheckCommand(string option) { fastafile = m->getFastaFile(); if (fastafile != "") { m->mothurOut("Using " + fastafile + " as input file for the fasta parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setFastaFile(fastafile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { namefile = ""; abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } //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"){ diff --git a/sensspeccommand.cpp b/sensspeccommand.cpp index 213a2ca..726c904 100644 --- a/sensspeccommand.cpp +++ b/sensspeccommand.cpp @@ -134,16 +134,17 @@ SensSpecCommand::SensSpecCommand(string option) { 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); } if ((phylipfile == "") && (columnfile == "")) { //is there are current file available for either of these? //give priority to column, then phylip diff --git a/seqerrorcommand.cpp b/seqerrorcommand.cpp index 6ce944e..564e412 100644 --- a/seqerrorcommand.cpp +++ b/seqerrorcommand.cpp @@ -164,6 +164,7 @@ SeqErrorCommand::SeqErrorCommand(string option) { else { m->mothurOut("You have no current fasta file and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; } } else if (queryFileName == "not open") { abort = true; } + else { m->setFastaFile(queryFileName); } referenceFileName = validParameter.validFile(parameters, "reference", true); if (referenceFileName == "not found") { m->mothurOut("reference is a required parameter for the seq.error command."); m->mothurOutEndLine(); abort = true; } @@ -174,11 +175,13 @@ SeqErrorCommand::SeqErrorCommand(string option) { namesFileName = validParameter.validFile(parameters, "name", true); if(namesFileName == "not found"){ namesFileName = ""; } else if (namesFileName == "not open") { namesFileName = ""; abort = true; } + else { m->setNameFile(namesFileName); } qualFileName = validParameter.validFile(parameters, "qfile", true); if(qualFileName == "not found"){ qualFileName = ""; } else if (qualFileName == "not open") { qualFileName = ""; abort = true; } - + else { m->setQualFile(qualFileName); } + reportFileName = validParameter.validFile(parameters, "report", true); if(reportFileName == "not found"){ reportFileName = ""; } else if (reportFileName == "not open") { reportFileName = ""; abort = true; } diff --git a/seqsummarycommand.cpp b/seqsummarycommand.cpp index 620de95..8c7b9b6 100644 --- a/seqsummarycommand.cpp +++ b/seqsummarycommand.cpp @@ -116,11 +116,12 @@ SeqSummaryCommand::SeqSummaryCommand(string option) { fastafile = m->getFastaFile(); if (fastafile != "") { m->mothurOut("Using " + fastafile + " as input file for the fasta parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setFastaFile(fastafile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { namefile = ""; abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } //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"){ diff --git a/sffinfocommand.cpp b/sffinfocommand.cpp index 77af9e6..2073282 100644 --- a/sffinfocommand.cpp +++ b/sffinfocommand.cpp @@ -170,7 +170,7 @@ SffInfoCommand::SffInfoCommand(string option) { //erase from file list filenames.erase(filenames.begin()+i); i--; - } + }else { m->setSFFFile(filenames[i]); } } } diff --git a/sharedcommand.cpp b/sharedcommand.cpp index b322007..38bc480 100644 --- a/sharedcommand.cpp +++ b/sharedcommand.cpp @@ -131,7 +131,7 @@ SharedCommand::SharedCommand(string option) { listfile = m->getListFile(); if (listfile != "") { m->mothurOut("Using " + listfile + " as input file for the list parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current list file and the list parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setListFile(listfile); } ordergroupfile = validParameter.validFile(parameters, "ordergroup", true); if (ordergroupfile == "not open") { abort = true; } diff --git a/splitabundcommand.cpp b/splitabundcommand.cpp index ba59dfe..aa47940 100644 --- a/splitabundcommand.cpp +++ b/splitabundcommand.cpp @@ -152,12 +152,12 @@ SplitAbundCommand::SplitAbundCommand(string option) { listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { abort = true; } else if (listfile == "not found") { listfile = ""; } - else{ inputFile = listfile; } + else{ inputFile = listfile; m->setListFile(listfile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } - else{ inputFile = namefile; } + else{ inputFile = namefile; m->setNameFile(namefile); } fastafile = validParameter.validFile(parameters, "fasta", true); if (fastafile == "not open") { abort = true; } @@ -165,7 +165,7 @@ SplitAbundCommand::SplitAbundCommand(string option) { fastafile = m->getFastaFile(); if (fastafile != "") { m->mothurOut("Using " + fastafile + " as input file for the fasta parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setFastaFile(fastafile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { groupfile = ""; abort = true; } @@ -175,7 +175,7 @@ SplitAbundCommand::SplitAbundCommand(string option) { int error = groupMap->readMap(); if (error == 1) { abort = true; } - + m->setGroupFile(groupfile); } groups = validParameter.validFile(parameters, "groups", false); diff --git a/splitgroupscommand.cpp b/splitgroupscommand.cpp index 220c7cc..6dd6206 100644 --- a/splitgroupscommand.cpp +++ b/splitgroupscommand.cpp @@ -126,6 +126,7 @@ SplitGroupCommand::SplitGroupCommand(string option) { namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } fastafile = validParameter.validFile(parameters, "fasta", true); if (fastafile == "not open") { abort = true; } @@ -133,7 +134,7 @@ SplitGroupCommand::SplitGroupCommand(string option) { fastafile = m->getFastaFile(); if (fastafile != "") { m->mothurOut("Using " + fastafile + " as input file for the fasta parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current fastafile and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setFastaFile(fastafile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { groupfile = ""; abort = true; } @@ -141,7 +142,7 @@ SplitGroupCommand::SplitGroupCommand(string option) { groupfile = m->getGroupFile(); if (groupfile != "") { m->mothurOut("Using " + groupfile + " as input file for the group parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current groupfile and the group parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setGroupFile(groupfile); } groups = validParameter.validFile(parameters, "groups", false); if (groups == "not found") { groups = ""; } diff --git a/subsamplecommand.cpp b/subsamplecommand.cpp index 0f7bdec..95a0442 100644 --- a/subsamplecommand.cpp +++ b/subsamplecommand.cpp @@ -182,32 +182,38 @@ SubSampleCommand::SubSampleCommand(string option) { //check for required parameters listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { listfile = ""; abort = true; } - else if (listfile == "not found") { listfile = ""; } + else if (listfile == "not found") { listfile = ""; } + else { m->setListFile(listfile); } sabundfile = validParameter.validFile(parameters, "sabund", true); if (sabundfile == "not open") { sabundfile = ""; abort = true; } else if (sabundfile == "not found") { sabundfile = ""; } + else { m->setSabundFile(sabundfile); } rabundfile = validParameter.validFile(parameters, "rabund", true); if (rabundfile == "not open") { rabundfile = ""; abort = true; } else if (rabundfile == "not found") { rabundfile = ""; } + else { m->setRabundFile(rabundfile); } fastafile = validParameter.validFile(parameters, "fasta", true); if (fastafile == "not open") { fastafile = ""; abort = true; } else if (fastafile == "not found") { fastafile = ""; } + else { m->setFastaFile(fastafile); } sharedfile = validParameter.validFile(parameters, "shared", true); if (sharedfile == "not open") { sharedfile = ""; abort = true; } else if (sharedfile == "not found") { sharedfile = ""; } + else { m->setSharedFile(sharedfile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { namefile = ""; abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { groupfile = ""; abort = true; } else if (groupfile == "not found") { groupfile = ""; } - + else { m->setGroupFile(groupfile); } //check for optional parameter and set defaults // ...at some point should added some additional type checking... diff --git a/summarycommand.cpp b/summarycommand.cpp index 4d71c07..2bb8877 100644 --- a/summarycommand.cpp +++ b/summarycommand.cpp @@ -164,22 +164,22 @@ SummaryCommand::SummaryCommand(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; } + else { format = "rabund"; inputfile = rabundfile; m->setRabundFile(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 = "sharedfile"; inputfile = sharedfile; m->setSharedFile(sharedfile); } if ((sharedfile == "") && (listfile == "") && (rabundfile == "") && (sabundfile == "")) { //is there are current file available for any of these? diff --git a/summarysharedcommand.cpp b/summarysharedcommand.cpp index cc1a374..b3b4b18 100644 --- a/summarysharedcommand.cpp +++ b/summarysharedcommand.cpp @@ -161,7 +161,7 @@ SummarySharedCommand::SummarySharedCommand(string option) { sharedfile = m->getSharedFile(); if (sharedfile != "") { m->mothurOut("Using " + sharedfile + " as input file for the shared parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current sharedfile and the shared parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setSharedFile(sharedfile); } //if the user changes the output directory command factory will send this info to us in the output parameter diff --git a/treegroupscommand.cpp b/treegroupscommand.cpp index 9c56d22..902b9a2 100644 --- a/treegroupscommand.cpp +++ b/treegroupscommand.cpp @@ -179,21 +179,22 @@ TreeGroupCommand::TreeGroupCommand(string option) { phylipfile = validParameter.validFile(parameters, "phylip", true); if (phylipfile == "not open") { phylipfile = ""; abort = true; } else if (phylipfile == "not found") { phylipfile = ""; } - else { inputfile = phylipfile; format = "phylip"; } + else { inputfile = phylipfile; format = "phylip"; m->setPhylipFile(phylipfile); } columnfile = validParameter.validFile(parameters, "column", true); if (columnfile == "not open") { columnfile = ""; abort = true; } else if (columnfile == "not found") { columnfile = ""; } - else { inputfile = columnfile; format = "column"; } + else { inputfile = columnfile; format = "column"; m->setColumnFile(columnfile); } sharedfile = validParameter.validFile(parameters, "shared", true); if (sharedfile == "not open") { sharedfile = ""; abort = true; } else if (sharedfile == "not found") { sharedfile = ""; } - else { inputfile = sharedfile; format = "sharedfile"; } + else { inputfile = sharedfile; format = "sharedfile"; m->setSharedFile(sharedfile); } 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 == "") && (sharedfile == "")) { //is there are current file available for either of these? diff --git a/trimflowscommand.cpp b/trimflowscommand.cpp index 77377a4..ec04336 100644 --- a/trimflowscommand.cpp +++ b/trimflowscommand.cpp @@ -157,7 +157,7 @@ TrimFlowsCommand::TrimFlowsCommand(string option) { temp = validParameter.validFile(parameters, "oligos", true); if (temp == "not found") { oligoFileName = ""; } else if(temp == "not open") { abort = true; } - else { oligoFileName = temp; } + else { oligoFileName = temp; m->setOligosFile(oligoFileName); } temp = validParameter.validFile(parameters, "fasta", false); if (temp == "not found"){ fasta = 0; } else if(m->isTrue(temp)) { fasta = 1; } diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index 6410c8f..082bc79 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -189,6 +189,7 @@ TrimSeqsCommand::TrimSeqsCommand(string option) { if (fastaFile != "") { m->mothurOut("Using " + fastaFile + " as input file for the fasta parameter."); m->mothurOutEndLine(); } 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); } //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"){ @@ -207,7 +208,7 @@ TrimSeqsCommand::TrimSeqsCommand(string option) { temp = validParameter.validFile(parameters, "oligos", true); if (temp == "not found"){ oligoFile = ""; } else if(temp == "not open"){ abort = true; } - else { oligoFile = temp; } + else { oligoFile = temp; m->setOligosFile(oligoFile); } temp = validParameter.validFile(parameters, "maxambig", false); if (temp == "not found") { temp = "-1"; } @@ -236,12 +237,12 @@ TrimSeqsCommand::TrimSeqsCommand(string option) { temp = validParameter.validFile(parameters, "qfile", true); if (temp == "not found") { qFileName = ""; } else if(temp == "not open") { abort = true; } - else { qFileName = temp; } + else { qFileName = temp; m->setQualFile(qFileName); } temp = validParameter.validFile(parameters, "name", true); if (temp == "not found") { nameFile = ""; } else if(temp == "not open") { nameFile = ""; abort = true; } - else { nameFile = temp; } + else { nameFile = temp; m->setNameFile(nameFile); } temp = validParameter.validFile(parameters, "qthreshold", false); if (temp == "not found") { temp = "0"; } convert(temp, qThreshold); diff --git a/unifracunweightedcommand.cpp b/unifracunweightedcommand.cpp index 8ec2d06..058555e 100644 --- a/unifracunweightedcommand.cpp +++ b/unifracunweightedcommand.cpp @@ -146,16 +146,18 @@ UnifracUnweightedCommand::UnifracUnweightedCommand(string option) { treefile = m->getTreeFile(); if (treefile != "") { m->mothurOut("Using " + treefile + " as input file for the tree parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current tree file and the tree parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setTreeFile(treefile); } //check for required parameters groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } else if (groupfile == "not found") { groupfile = ""; } + else { m->setGroupFile(groupfile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = ""; } diff --git a/unifracweightedcommand.cpp b/unifracweightedcommand.cpp index 0570945..00bb5d6 100644 --- a/unifracweightedcommand.cpp +++ b/unifracweightedcommand.cpp @@ -146,16 +146,18 @@ UnifracWeightedCommand::UnifracWeightedCommand(string option) { treefile = m->getTreeFile(); if (treefile != "") { m->mothurOut("Using " + treefile + " as input file for the tree parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current tree file and the tree parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setTreeFile(treefile); } //check for required parameters groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } else if (groupfile == "not found") { groupfile = ""; } + else { m->setGroupFile(groupfile); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = ""; } diff --git a/venncommand.cpp b/venncommand.cpp index cae0417..6d4c2a0 100644 --- a/venncommand.cpp +++ b/venncommand.cpp @@ -129,12 +129,12 @@ VennCommand::VennCommand(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); } 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 = "sharedfile"; inputfile = sharedfile; m->setSharedFile(sharedfile); } if ((sharedfile == "") && (listfile == "")) { //is there are current file available for any of these?