From 220dc345e493cddc569521111ce32ac4d965ab7f Mon Sep 17 00:00:00 2001 From: westcott Date: Tue, 14 Jun 2011 14:22:10 +0000 Subject: [PATCH] working on current change --- aligncommand.cpp | 2 ++ amovacommand.cpp | 6 +++--- anosimcommand.cpp | 6 +++--- binsequencecommand.cpp | 4 ++++ bootstrapsharedcommand.cpp | 7 ++++++- catchallcommand.cpp | 2 ++ chimerabellerophoncommand.cpp | 2 ++ chimeraccodecommand.cpp | 2 ++ chimeracheckcommand.cpp | 4 ++++ chimerapintailcommand.cpp | 2 ++ chimeraslayercommand.cpp | 4 ++++ chimerauchimecommand.cpp | 4 ++++ chopseqscommand.cpp | 2 +- classifyotucommand.cpp | 4 ++++ classifyseqscommand.cpp | 6 ++++++ clearcutcommand.cpp | 4 ++-- clustercommand.cpp | 5 +++-- clusterdoturcommand.cpp | 3 ++- clusterfragmentscommand.cpp | 3 ++- clustersplitcommand.cpp | 10 ++++++---- collectcommand.cpp | 8 ++++---- collectsharedcommand.cpp | 2 +- consensusseqscommand.cpp | 6 ++++-- corraxescommand.cpp | 4 ++-- countseqscommand.cpp | 3 ++- deconvolutecommand.cpp | 3 ++- degapseqscommand.cpp | 2 +- deuniqueseqscommand.cpp | 4 ++-- deuniquetreecommand.cpp | 4 ++-- distancecommand.cpp | 2 ++ filterseqscommand.cpp | 1 + getcommandinfocommand.cpp | 8 ++++++++ getgroupcommand.cpp | 2 +- qualityscores.cpp | 15 ++++++++++----- seqerrorcommand.cpp | 23 ----------------------- seqerrorcommand.h | 2 +- sffinfocommand.cpp | 19 +++++++++++++------ systemcommand.cpp | 2 +- trimseqscommand.cpp | 4 ++-- 39 files changed, 123 insertions(+), 73 deletions(-) diff --git a/aligncommand.cpp b/aligncommand.cpp index 95604fc..5da0ee8 100644 --- a/aligncommand.cpp +++ b/aligncommand.cpp @@ -224,6 +224,8 @@ AlignCommand::AlignCommand(string option) { //erase from file list candidateFileNames.erase(candidateFileNames.begin()+i); i--; + }else { + m->setFastaFile(candidateFileNames[i]); } } } diff --git a/amovacommand.cpp b/amovacommand.cpp index ad5823b..1416733 100644 --- a/amovacommand.cpp +++ b/amovacommand.cpp @@ -122,17 +122,17 @@ AmovaCommand::AmovaCommand(string option) { phylipFileName = m->getPhylipFile(); 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); - if (designFileName == "not open") { abort = true; } + if (designFileName == "not open") { designFileName = ""; abort = true; } else if (designFileName == "not found") { //if there is a current design file, use it 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/anosimcommand.cpp b/anosimcommand.cpp index 6f9e538..c5cb4d6 100644 --- a/anosimcommand.cpp +++ b/anosimcommand.cpp @@ -124,17 +124,17 @@ AnosimCommand::AnosimCommand(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); - if (designFileName == "not open") { abort = true; } + if (designFileName == "not open") { designFileName = ""; abort = true; } else if (designFileName == "not found") { //if there is a current design file, use it 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/binsequencecommand.cpp b/binsequencecommand.cpp index c4ef741..8e8ec2b 100644 --- a/binsequencecommand.cpp +++ b/binsequencecommand.cpp @@ -138,6 +138,7 @@ BinSeqCommand::BinSeqCommand(string option) { else { m->mothurOut("You have no current fasta file and the fasta parameter is required."); m->mothurOutEndLine(); abort = true; } } else if (fastafile == "not open") { abort = true; } + else { m->setFastaFile(fastafile); } listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not found") { @@ -146,6 +147,7 @@ BinSeqCommand::BinSeqCommand(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") { listfile = ""; abort = true; } + else { m->setListFile(listfile); } //if the user changes the output directory command factory will send this info to us in the output parameter outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ @@ -167,10 +169,12 @@ BinSeqCommand::BinSeqCommand(string option) { namesfile = validParameter.validFile(parameters, "name", true); if (namesfile == "not open") { abort = true; } else if (namesfile == "not found") { namesfile = ""; } + else { m->setNameFile(namesfile); } groupfile = validParameter.validFile(parameters, "group", true); if (groupfile == "not open") { abort = true; } else if (groupfile == "not found") { groupfile = ""; } + else { m->setGroupFile(groupfile); } } } diff --git a/bootstrapsharedcommand.cpp b/bootstrapsharedcommand.cpp index f63f2f4..478821e 100644 --- a/bootstrapsharedcommand.cpp +++ b/bootstrapsharedcommand.cpp @@ -113,8 +113,13 @@ BootSharedCommand::BootSharedCommand(string option) { } sharedfile = validParameter.validFile(parameters, "shared", true); - if (sharedfile == "not found") { m->mothurOut("shared is a required parameter."); m->mothurOutEndLine(); sharedfile = ""; abort = true; } + if (sharedfile == "not found") { + 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 shared file 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/catchallcommand.cpp b/catchallcommand.cpp index 29f2220..fd51664 100644 --- a/catchallcommand.cpp +++ b/catchallcommand.cpp @@ -119,10 +119,12 @@ CatchAllCommand::CatchAllCommand(string option) { sabundfile = validParameter.validFile(parameters, "sabund", true); if (sabundfile == "not open") { sabundfile = ""; abort = true; } else if (sabundfile == "not found") { sabundfile = ""; } + else { m->setSabundFile(sabundfile); } sharedfile = validParameter.validFile(parameters, "shared", true); if (sharedfile == "not open") { sharedfile = ""; abort = true; } else if (sharedfile == "not found") { sharedfile = ""; } + else { m->setSharedFile(sharedfile); } string label = validParameter.validFile(parameters, "label", false); if (label == "not found") { label = ""; } diff --git a/chimerabellerophoncommand.cpp b/chimerabellerophoncommand.cpp index 7a62d5b..0031acb 100644 --- a/chimerabellerophoncommand.cpp +++ b/chimerabellerophoncommand.cpp @@ -171,6 +171,8 @@ ChimeraBellerophonCommand::ChimeraBellerophonCommand(string option) { //erase from file list fastaFileNames.erase(fastaFileNames.begin()+i); i--; + }else { + m->setFastaFile(fastaFileNames[i]); } } } diff --git a/chimeraccodecommand.cpp b/chimeraccodecommand.cpp index df4e67d..bc96e05 100644 --- a/chimeraccodecommand.cpp +++ b/chimeraccodecommand.cpp @@ -185,6 +185,8 @@ ChimeraCcodeCommand::ChimeraCcodeCommand(string option) { //erase from file list fastaFileNames.erase(fastaFileNames.begin()+i); i--; + }else { + m->setFastaFile(fastaFileNames[i]); } } } diff --git a/chimeracheckcommand.cpp b/chimeracheckcommand.cpp index d82a84a..5b249d7 100644 --- a/chimeracheckcommand.cpp +++ b/chimeracheckcommand.cpp @@ -183,6 +183,8 @@ ChimeraCheckCommand::ChimeraCheckCommand(string option) { //erase from file list fastaFileNames.erase(fastaFileNames.begin()+i); i--; + }else { + m->setFastaFile(fastaFileNames[i]); } } } @@ -262,6 +264,8 @@ ChimeraCheckCommand::ChimeraCheckCommand(string option) { //erase from file list nameFileNames.erase(nameFileNames.begin()+i); i--; + }else { + m->setNameFile(nameFileNames[i]); } } } diff --git a/chimerapintailcommand.cpp b/chimerapintailcommand.cpp index 94c2bf5..482bf7b 100644 --- a/chimerapintailcommand.cpp +++ b/chimerapintailcommand.cpp @@ -205,6 +205,8 @@ ChimeraPintailCommand::ChimeraPintailCommand(string option) { //erase from file list fastaFileNames.erase(fastaFileNames.begin()+i); i--; + }else { + m->setFastaFile(fastaFileNames[i]); } } } diff --git a/chimeraslayercommand.cpp b/chimeraslayercommand.cpp index fed3613..636e175 100644 --- a/chimeraslayercommand.cpp +++ b/chimeraslayercommand.cpp @@ -205,6 +205,8 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option) { //erase from file list fastaFileNames.erase(fastaFileNames.begin()+i); i--; + }else { + m->setFastaFile(fastaFileNames[i]); } } } @@ -279,6 +281,8 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option) { //erase from file list nameFileNames.erase(nameFileNames.begin()+i); i--; + }else { + m->setNameFile(nameFileNames[i]); } } } diff --git a/chimerauchimecommand.cpp b/chimerauchimecommand.cpp index 33b48bd..375964c 100644 --- a/chimerauchimecommand.cpp +++ b/chimerauchimecommand.cpp @@ -209,6 +209,8 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(string option) { //erase from file list fastaFileNames.erase(fastaFileNames.begin()+i); i--; + }else { + m->setFastaFile(fastaFileNames[i]); } } } @@ -283,6 +285,8 @@ ChimeraUchimeCommand::ChimeraUchimeCommand(string option) { //erase from file list nameFileNames.erase(nameFileNames.begin()+i); i--; + }else { + m->setNameFile(nameFileNames[i]); } } } diff --git a/chopseqscommand.cpp b/chopseqscommand.cpp index 0e500d4..fc4327f 100644 --- a/chopseqscommand.cpp +++ b/chopseqscommand.cpp @@ -115,7 +115,7 @@ ChopSeqsCommand::ChopSeqsCommand(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); } //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/classifyotucommand.cpp b/classifyotucommand.cpp index eaf8cc2..d065b3a 100644 --- a/classifyotucommand.cpp +++ b/classifyotucommand.cpp @@ -166,6 +166,7 @@ ClassifyOtuCommand::ClassifyOtuCommand(string option) { else { m->mothurOut("You have no current listfile and the list parameter is required."); m->mothurOutEndLine(); abort = true; } } else if (listfile == "not open") { abort = true; } + else { m->setListFile(listfile); } taxfile = validParameter.validFile(parameters, "taxonomy", true); if (taxfile == "not found") { //if there is a current list file, use it @@ -174,6 +175,7 @@ ClassifyOtuCommand::ClassifyOtuCommand(string option) { else { m->mothurOut("You have no current taxonomy file and the taxonomy parameter is required."); m->mothurOutEndLine(); abort = true; } } else if (taxfile == "not open") { abort = true; } + else { m->setTaxonomyFile(taxfile); } refTaxonomy = validParameter.validFile(parameters, "reftaxonomy", true); if (refTaxonomy == "not found") { refTaxonomy = ""; m->mothurOut("reftaxonomy is not required, but if given will keep the rankIDs in the summary file static."); m->mothurOutEndLine(); } @@ -182,10 +184,12 @@ ClassifyOtuCommand::ClassifyOtuCommand(string option) { 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); } //check for optional parameter and set defaults // ...at some point should added some additional type checking... diff --git a/classifyseqscommand.cpp b/classifyseqscommand.cpp index 0d5ef61..72ca1d0 100644 --- a/classifyseqscommand.cpp +++ b/classifyseqscommand.cpp @@ -239,6 +239,8 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option) { //erase from file list fastaFileNames.erase(fastaFileNames.begin()+i); i--; + }else { + m->setFastaFile(fastaFileNames[i]); } } @@ -319,6 +321,8 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option) { //erase from file list namefileNames.erase(namefileNames.begin()+i); i--; + }else { + m->setNameFile(namefileNames[i]); } } } @@ -375,6 +379,8 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option) { //erase from file list groupfileNames.erase(groupfileNames.begin()+i); i--; + }else { + m->setGroupFile(groupfileNames[i]); } } } diff --git a/clearcutcommand.cpp b/clearcutcommand.cpp index 04dbc79..29a5d72 100644 --- a/clearcutcommand.cpp +++ b/clearcutcommand.cpp @@ -155,12 +155,12 @@ ClearcutCommand::ClearcutCommand(string option) { fastafile = validParameter.validFile(parameters, "fasta", true); if (fastafile == "not open") { fastafile = ""; abort = true; } else if (fastafile == "not found") { fastafile = ""; } - else { inputFile = fastafile; } + else { inputFile = fastafile; m->setFastaFile(fastafile); } phylipfile = validParameter.validFile(parameters, "phylip", true); if (phylipfile == "not open") { phylipfile = ""; abort = true; } else if (phylipfile == "not found") { phylipfile = ""; } - else { inputFile = phylipfile; } + else { inputFile = phylipfile; m->setPhylipFile(phylipfile); } if ((phylipfile == "") && (fastafile == "")) { //is there are current file available for either of these? diff --git a/clustercommand.cpp b/clustercommand.cpp index 16348c8..fd1f841 100644 --- a/clustercommand.cpp +++ b/clustercommand.cpp @@ -135,16 +135,17 @@ ClusterCommand::ClusterCommand(string option) { phylipfile = validParameter.validFile(parameters, "phylip", true); if (phylipfile == "not open") { phylipfile = ""; 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") { columnfile = ""; 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/clusterdoturcommand.cpp b/clusterdoturcommand.cpp index 9f51a8c..3f629dc 100644 --- a/clusterdoturcommand.cpp +++ b/clusterdoturcommand.cpp @@ -132,13 +132,14 @@ ClusterDoturCommand::ClusterDoturCommand(string option) { m->mothurOut("You need to provide a phylip file with the cluster.classic command."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setPhylipFile(phylipfile); } //check for optional parameter and set defaults namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } string temp; temp = validParameter.validFile(parameters, "precision", false); diff --git a/clusterfragmentscommand.cpp b/clusterfragmentscommand.cpp index 2e37e7c..71ce5ee 100644 --- a/clusterfragmentscommand.cpp +++ b/clusterfragmentscommand.cpp @@ -138,6 +138,7 @@ ClusterFragmentsCommand::ClusterFragmentsCommand(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") { fastafile = ""; 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"){ outputDir = m->hasPath(fastafile); } @@ -147,7 +148,7 @@ ClusterFragmentsCommand::ClusterFragmentsCommand(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; temp = validParameter.validFile(parameters, "diffs", false); if (temp == "not found"){ temp = "0"; } diff --git a/clustersplitcommand.cpp b/clustersplitcommand.cpp index bdc8075..9999eb0 100644 --- a/clustersplitcommand.cpp +++ b/clustersplitcommand.cpp @@ -183,25 +183,27 @@ ClusterSplitCommand::ClusterSplitCommand(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 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? diff --git a/collectcommand.cpp b/collectcommand.cpp index 7b8364b..5bd9fd7 100644 --- a/collectcommand.cpp +++ b/collectcommand.cpp @@ -211,22 +211,22 @@ CollectCommand::CollectCommand(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 the user changes the output directory command factory will send this info to us in the output parameter diff --git a/collectsharedcommand.cpp b/collectsharedcommand.cpp index d72dd71..202883e 100644 --- a/collectsharedcommand.cpp +++ b/collectsharedcommand.cpp @@ -238,7 +238,7 @@ CollectSharedCommand::CollectSharedCommand(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/consensusseqscommand.cpp b/consensusseqscommand.cpp index 9d817a2..9172819 100644 --- a/consensusseqscommand.cpp +++ b/consensusseqscommand.cpp @@ -139,15 +139,17 @@ ConsensusSeqsCommand::ConsensusSeqsCommand(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") { abort = true; } - else if (namefile == "not found") { namefile = ""; } + else if (namefile == "not found") { namefile = ""; } + else { m->setNameFile(namefile); } listfile = validParameter.validFile(parameters, "list", true); if (listfile == "not open") { abort = true; } else if (listfile == "not found") { listfile = ""; } + else { m->setListFile(listfile); } label = validParameter.validFile(parameters, "label", false); if (label == "not found") { label = ""; } diff --git a/corraxescommand.cpp b/corraxescommand.cpp index 791ec49..cd188b8 100644 --- a/corraxescommand.cpp +++ b/corraxescommand.cpp @@ -140,12 +140,12 @@ CorrAxesCommand::CorrAxesCommand(string option) { 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); } metadatafile = validParameter.validFile(parameters, "metadata", true); if (metadatafile == "not open") { abort = true; } diff --git a/countseqscommand.cpp b/countseqscommand.cpp index a446469..a9bffc6 100644 --- a/countseqscommand.cpp +++ b/countseqscommand.cpp @@ -117,11 +117,12 @@ CountSeqsCommand::CountSeqsCommand(string option) { namefile = m->getNameFile(); if (namefile != "") { m->mothurOut("Using " + namefile + " as input file for the name parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current namefile and the name parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }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); } groups = validParameter.validFile(parameters, "groups", false); if (groups == "not found") { groups = "all"; } diff --git a/deconvolutecommand.cpp b/deconvolutecommand.cpp index 6f7657f..5888fee 100644 --- a/deconvolutecommand.cpp +++ b/deconvolutecommand.cpp @@ -116,7 +116,7 @@ DeconvoluteCommand::DeconvoluteCommand(string option) { inFastaName = m->getFastaFile(); if (inFastaName != "") { m->mothurOut("Using " + inFastaName + " 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(inFastaName); } //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"){ @@ -127,6 +127,7 @@ DeconvoluteCommand::DeconvoluteCommand(string option) { oldNameMapFName = validParameter.validFile(parameters, "name", true); if (oldNameMapFName == "not open") { abort = true; } else if (oldNameMapFName == "not found"){ oldNameMapFName = ""; } + else { m->setNameFile(oldNameMapFName); } } } diff --git a/degapseqscommand.cpp b/degapseqscommand.cpp index 940672c..f590d8b 100644 --- a/degapseqscommand.cpp +++ b/degapseqscommand.cpp @@ -156,7 +156,7 @@ DegapSeqsCommand::DegapSeqsCommand(string option) { //erase from file list fastaFileNames.erase(fastaFileNames.begin()+i); i--; - } + }else { m->setFastaFile(fastaFileNames[i]); } } } diff --git a/deuniqueseqscommand.cpp b/deuniqueseqscommand.cpp index aed5303..2ba6f3d 100644 --- a/deuniqueseqscommand.cpp +++ b/deuniqueseqscommand.cpp @@ -114,7 +114,7 @@ DeUniqueSeqsCommand::DeUniqueSeqsCommand(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); } //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"){ @@ -128,7 +128,7 @@ DeUniqueSeqsCommand::DeUniqueSeqsCommand(string option) { nameFile = m->getNameFile(); if (nameFile != "") { m->mothurOut("Using " + nameFile + " as input file for the name parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current namefile and the name parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setNameFile(nameFile); } } } diff --git a/deuniquetreecommand.cpp b/deuniquetreecommand.cpp index 7f33ad6..f39a182 100644 --- a/deuniquetreecommand.cpp +++ b/deuniquetreecommand.cpp @@ -116,7 +116,7 @@ DeuniqueTreeCommand::DeuniqueTreeCommand(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); } namefile = validParameter.validFile(parameters, "name", true); if (namefile == "not open") { abort = true; } @@ -124,7 +124,7 @@ DeuniqueTreeCommand::DeuniqueTreeCommand(string option) { namefile = m->getNameFile(); if (namefile != "") { m->mothurOut("Using " + namefile + " as input file for the name parameter."); m->mothurOutEndLine(); } else { m->mothurOut("You have no current name file and the name parameter is required."); m->mothurOutEndLine(); abort = true; } - } + }else { m->setNameFile(namefile); } outputDir = validParameter.validFile(parameters, "outputdir", false); if (outputDir == "not found"){ outputDir = m->hasPath(treefile); } } diff --git a/distancecommand.cpp b/distancecommand.cpp index b73cd7c..4bdeaae 100644 --- a/distancecommand.cpp +++ b/distancecommand.cpp @@ -152,6 +152,7 @@ DistanceCommand::DistanceCommand(string option) { m->openInputFile(fastafile, inFASTA); alignDB = SequenceDB(inFASTA); inFASTA.close(); + m->setFastaFile(fastafile); } oldfastafile = validParameter.validFile(parameters, "oldfasta", true); @@ -161,6 +162,7 @@ DistanceCommand::DistanceCommand(string option) { column = validParameter.validFile(parameters, "column", true); if (column == "not found") { column = ""; } else if (column == "not open") { abort = true; } + else { m->setColumnFile(column); } //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/filterseqscommand.cpp b/filterseqscommand.cpp index 167dd3c..1204663 100644 --- a/filterseqscommand.cpp +++ b/filterseqscommand.cpp @@ -190,6 +190,7 @@ FilterSeqsCommand::FilterSeqsCommand(string option) { }else{ string simpleName = m->getSimpleName(fastafileNames[i]); filterFileName += simpleName.substr(0, simpleName.find_first_of('.')); + m->setFastaFile(fastafileNames[i]); } in.close(); } diff --git a/getcommandinfocommand.cpp b/getcommandinfocommand.cpp index 283cd40..52559b3 100644 --- a/getcommandinfocommand.cpp +++ b/getcommandinfocommand.cpp @@ -113,6 +113,14 @@ int GetCommandInfoCommand::execute(){ } out << "help=" << newHelpString << endl; + //remove /n from citation string since gui reads line by line + string mycitationString = thisCommand->getCitation(); + string newCitationString = ""; + for (int i = 0; i < mycitationString.length(); i++) { + if (mycitationString[i] != '\n') { newCitationString += mycitationString[i]; } + } + out << "citation=" << newCitationString << endl; + //outputTypes - makes something like outputTypes=fasta-name-qfile map > thisOutputTypes = thisCommand->getOutputFiles(); map >::iterator itTypes; diff --git a/getgroupcommand.cpp b/getgroupcommand.cpp index b39fb64..1190f49 100644 --- a/getgroupcommand.cpp +++ b/getgroupcommand.cpp @@ -103,7 +103,7 @@ GetgroupCommand::GetgroupCommand(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/qualityscores.cpp b/qualityscores.cpp index c9c6504..520d0bb 100644 --- a/qualityscores.cpp +++ b/qualityscores.cpp @@ -44,20 +44,22 @@ QualityScores::QualityScores(ifstream& qFile){ else{ seqName = seqName.substr(1); } + string qScoreString = m->getline(qFile); while(qFile.peek() != '>' && qFile.peek() != EOF){ - qScoreString += ' ' + m->getline(qFile); + qScoreString += ' ' + m->getline(qFile); } istringstream qScoreStringStream(qScoreString); int count = 0; while(!qScoreStringStream.eof()){ if (m->control_pressed) { break; } - qScoreStringStream >> score; + qScoreStringStream >> score; m->gobble(qScoreStringStream); + qScores.push_back(score); count++; } - qScores.pop_back(); + //qScores.pop_back(); // string scores = ""; // @@ -102,7 +104,7 @@ QualityScores::QualityScores(ifstream& qFile){ // qScores.pop_back(); seqLength = qScores.size(); - + //cout << "seqlenght = " << seqLength << '\t' << count << endl; } catch(exception& e) { @@ -151,7 +153,10 @@ void QualityScores::printQScores(ofstream& qFile){ void QualityScores::trimQScores(int start, int end){ try { vector hold; - + + + //cout << seqName << '\t' << start << '\t' << end << '\t' << qScores.size() << endl; + //for (int i = 0; i < qScores.size(); i++) { cout << qScores[i] << end; } if(end == -1){ hold = vector(qScores.begin()+start, qScores.end()); qScores = hold; diff --git a/seqerrorcommand.cpp b/seqerrorcommand.cpp index 5efb1ce..6ce944e 100644 --- a/seqerrorcommand.cpp +++ b/seqerrorcommand.cpp @@ -24,7 +24,6 @@ vector SeqErrorCommand::setParameters(){ CommandParameter pignorechimeras("ignorechimeras", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pignorechimeras); CommandParameter pthreshold("threshold", "Number", "", "1.0", "", "", "",false,false); parameters.push_back(pthreshold); CommandParameter pprocessors("processors", "Number", "", "1", "", "", "",false,false); parameters.push_back(pprocessors); - CommandParameter pfilter("filter", "Boolean", "", "T", "", "", "",false,false); parameters.push_back(pfilter); CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir); CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir); @@ -204,9 +203,6 @@ SeqErrorCommand::SeqErrorCommand(string option) { temp = validParameter.validFile(parameters, "ignorechimeras", false); if (temp == "not found") { temp = "T"; } ignoreChimeras = m->isTrue(temp); - temp = validParameter.validFile(parameters, "filter", false); if (temp == "not found") { temp = "T"; } - filter = m->isTrue(temp); - temp = validParameter.validFile(parameters, "processors", false); if (temp == "not found"){ temp = m->getProcessors(); } m->setProcessors(temp); convert(temp, processors); @@ -230,25 +226,6 @@ int SeqErrorCommand::execute(){ maxLength = 2000; totalBases = 0; totalMatches = 0; - - //run vertical filter on query and reference files. - if (filter) { - string inputString = "fasta=" + queryFileName + "-" + referenceFileName; - m->mothurOut("/******************************************/"); m->mothurOutEndLine(); - m->mothurOut("Running command: filter.seqs(" + inputString + ") to improve processing time."); m->mothurOutEndLine(); - - Command* filterCommand = new FilterSeqsCommand(inputString); - filterCommand->execute(); - - map > filenames = filterCommand->getOutputFiles(); - - delete filterCommand; - - m->mothurOut("/******************************************/"); m->mothurOutEndLine(); - - queryFileName = filenames["fasta"][0]; - referenceFileName = filenames["fasta"][1]; - } string errorSummaryFileName = queryFileName.substr(0,queryFileName.find_last_of('.')) + ".error.summary"; outputNames.push_back(errorSummaryFileName); outputTypes["error.summary"].push_back(errorSummaryFileName); diff --git a/seqerrorcommand.h b/seqerrorcommand.h index cb715ce..3fdd669 100644 --- a/seqerrorcommand.h +++ b/seqerrorcommand.h @@ -84,7 +84,7 @@ private: string queryFileName, referenceFileName, qualFileName, reportFileName, namesFileName, outputDir; double threshold; - bool ignoreChimeras, filter; + bool ignoreChimeras; int numRefs, processors; int maxLength, totalBases, totalMatches; //ofstream errorSummaryFile, errorSeqFile; diff --git a/sffinfocommand.cpp b/sffinfocommand.cpp index 765dc78..77af9e6 100644 --- a/sffinfocommand.cpp +++ b/sffinfocommand.cpp @@ -283,7 +283,7 @@ SffInfoCommand::SffInfoCommand(string option) { } if ((sfftxtFilename == "") && (filenames.size() == 0)) { - //if there is a current fasta file, use it + //if there is a current sff file, use it string filename = m->getSFFFile(); if (filename != "") { filenames.push_back(filename); m->mothurOut("Using " + filename + " as input file for the sff parameter."); m->mothurOutEndLine(); } else { m->mothurOut("[ERROR]: you must provide a valid sff or sfftxt file."); m->mothurOutEndLine(); abort=true; } @@ -901,13 +901,20 @@ int SffInfoCommand::parseSffTxt() { //output file names ofstream outFasta, outQual, outFlow; string outFastaFileName, outQualFileName; - string outFlowFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "flow"; + string fileRoot = m->getRootName(m->getSimpleName(sfftxtFilename)); + if (fileRoot.length() > 0) { + //rip off last . + fileRoot = fileRoot.substr(0, fileRoot.length()-1); + fileRoot = m->getRootName(fileRoot); + } + + string outFlowFileName = outputDir + fileRoot + "flow"; if (trim) { - outFastaFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "fasta"; - outQualFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "qual"; + outFastaFileName = outputDir + fileRoot + "fasta"; + outQualFileName = outputDir + fileRoot + "qual"; }else{ - outFastaFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "raw.fasta"; - outQualFileName = outputDir + m->getRootName(m->getSimpleName(sfftxtFilename)) + "raw.qual"; + outFastaFileName = outputDir + fileRoot + "raw.fasta"; + outQualFileName = outputDir + fileRoot + "raw.qual"; } if (fasta) { m->openOutputFile(outFastaFileName, outFasta); outputNames.push_back(outFastaFileName); outputTypes["fasta"].push_back(outFastaFileName); } diff --git a/systemcommand.cpp b/systemcommand.cpp index 5ace75e..ab9674f 100644 --- a/systemcommand.cpp +++ b/systemcommand.cpp @@ -96,7 +96,7 @@ int SystemCommand::execute(){ ifstream in; string filename = "./commandScreen.output"; - m->openInputFile(filename, in); + m->openInputFile(filename, in, "no error"); string output = ""; while(char c = in.get()){ diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index 4d6b45d..6410c8f 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -559,7 +559,7 @@ int TrimSeqsCommand::driverCreateTrim(string filename, string qFileName, string if(qFileName != ""){ currQual = QualityScores(qFile); m->gobble(qFile); } - + //cout << currSeq.getName() << '\t' << currSeq.getUnaligned().length() << endl; string origSeq = currSeq.getUnaligned(); if (origSeq != "") { @@ -1316,7 +1316,7 @@ int TrimSeqsCommand::stripBarcode(Sequence& seq, QualityScores& qual, int& group if (alignment != NULL) { delete alignment; } } - + return success; } -- 2.39.2