From c69e2e9749626cfbf1d6cb0125ae94f869e00b18 Mon Sep 17 00:00:00 2001 From: westcott Date: Tue, 8 Feb 2011 17:56:37 +0000 Subject: [PATCH] added [ERROR] flag if command aborts --- aligncommand.cpp | 9 ++++----- aligncommand.h | 3 ++- amovacommand.cpp | 9 ++++----- binsequencecommand.cpp | 9 ++++----- bootstrapsharedcommand.cpp | 9 ++++----- catchallcommand.cpp | 7 ++++--- chimerabellerophoncommand.cpp | 9 ++++----- chimeraccodecommand.cpp | 7 ++++--- chimeracheckcommand.cpp | 7 ++++--- chimerapintailcommand.cpp | 7 ++++--- chimeraslayercommand.cpp | 7 ++++--- chopseqscommand.cpp | 9 ++++----- classifyotucommand.cpp | 9 ++++----- classifyseqscommand.cpp | 9 ++++----- clearcutcommand.cpp | 9 ++++----- clustercommand.cpp | 9 ++++----- clusterdoturcommand.cpp | 9 ++++----- clusterfragmentscommand.cpp | 9 ++++----- clustersplitcommand.cpp | 9 ++++----- collectcommand.cpp | 7 +++---- collectsharedcommand.cpp | 9 ++++----- command.hpp | 1 + consensuscommand.cpp | 7 +++---- consensusseqscommand.cpp | 9 ++++----- corraxescommand.cpp | 9 ++++----- deconvolutecommand.cpp | 9 ++++----- degapseqscommand.cpp | 9 ++++----- deuniqueseqscommand.cpp | 9 ++++----- distancecommand.cpp | 9 ++++----- engine.cpp | 16 ++++++++++++++-- filterseqscommand.cpp | 9 ++++----- getgroupcommand.cpp | 9 ++++----- getgroupscommand.cpp | 9 ++++----- getlabelcommand.cpp | 6 +++--- getlineagecommand.cpp | 9 ++++----- getlistcountcommand.cpp | 9 ++++----- getoturepcommand.cpp | 9 ++++----- getotuscommand.cpp | 9 ++++----- getrabundcommand.cpp | 9 ++++----- getrelabundcommand.cpp | 9 ++++----- getsabundcommand.cpp | 9 ++++----- getseqscommand.cpp | 9 ++++----- getsharedotucommand.cpp | 9 ++++----- hclustercommand.cpp | 9 ++++----- heatmapcommand.cpp | 9 ++++----- heatmapsimcommand.cpp | 9 ++++----- homovacommand.cpp | 9 ++++----- indicatorcommand.cpp | 9 ++++----- libshuffcommand.cpp | 9 ++++----- listseqscommand.cpp | 9 ++++----- makegroupcommand.cpp | 9 ++++----- matrixoutputcommand.cpp | 9 ++++----- mergefilecommand.cpp | 9 ++++----- mergegroupscommand.cpp | 9 ++++----- metastatscommand.cpp | 9 ++++----- mgclustercommand.cpp | 9 ++++----- nmdscommand.cpp | 9 ++++----- normalizesharedcommand.cpp | 9 ++++----- otuhierarchycommand.cpp | 9 ++++----- pairwiseseqscommand.cpp | 9 ++++----- parsefastaqcommand.cpp | 9 ++++----- parselistscommand.cpp | 9 ++++----- parsimonycommand.cpp | 9 ++++----- pcacommand.cpp | 9 ++++----- pcoacommand.cpp | 9 ++++----- phylodiversitycommand.cpp | 9 ++++----- phylotypecommand.cpp | 9 ++++----- pipelinepdscommand.cpp | 6 +++--- pipelinepdscommand.h | 2 +- preclustercommand.cpp | 9 ++++----- quitcommand.cpp | 4 ++-- rarefactcommand.cpp | 9 ++++----- rarefactsharedcommand.cpp | 9 ++++----- readdistcommand.cpp | 6 +++--- readdistcommand.h | 2 +- readotucommand.cpp | 9 ++++----- readtreecommand.cpp | 6 +++--- readtreecommand.h | 2 +- removegroupscommand.cpp | 9 ++++----- removelineagecommand.cpp | 9 ++++----- removeotuscommand.cpp | 9 ++++----- removerarecommand.cpp | 9 ++++----- removeseqscommand.cpp | 9 ++++----- reversecommand.cpp | 9 ++++----- screenseqscommand.cpp | 9 ++++----- secondarystructurecommand.cpp | 9 ++++----- sensspeccommand.cpp | 9 ++++----- seqerrorcommand.cpp | 9 ++++----- seqsummarycommand.cpp | 9 ++++----- setdircommand.cpp | 6 +++--- setdircommand.h | 2 +- setlogfilecommand.cpp | 6 +++--- setlogfilecommand.h | 2 +- sffinfocommand.cpp | 9 ++++----- sharedcommand.cpp | 2 +- shhhercommand.cpp | 8 +++++--- splitabundcommand.cpp | 9 ++++----- splitgroupscommand.cpp | 9 ++++----- subsamplecommand.cpp | 9 ++++----- summarycommand.cpp | 9 ++++----- summarysharedcommand.cpp | 9 ++++----- systemcommand.cpp | 6 +++--- systemcommand.h | 2 +- treegroupscommand.cpp | 8 ++++---- trimflowscommand.cpp | 9 ++++----- trimseqscommand.cpp | 9 ++++----- unifracunweightedcommand.cpp | 9 ++++----- unifracweightedcommand.cpp | 9 ++++----- venncommand.cpp | 9 ++++----- 109 files changed, 410 insertions(+), 473 deletions(-) diff --git a/aligncommand.cpp b/aligncommand.cpp index db4e34a..3048481 100644 --- a/aligncommand.cpp +++ b/aligncommand.cpp @@ -64,8 +64,7 @@ vector AlignCommand::getRequiredFiles(){ //********************************************************************************************************************** AlignCommand::AlignCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["alignreport"] = tempOutNames; @@ -79,10 +78,10 @@ AlignCommand::AlignCommand(){ //********************************************************************************************************************** AlignCommand::AlignCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true;} else { @@ -279,7 +278,7 @@ void AlignCommand::help(){ int AlignCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } templateDB = new AlignmentDB(templateFileName, search, kmerSize, gapOpen, gapExtend, match, misMatch); int longestBase = templateDB->getLongestBase(); diff --git a/aligncommand.h b/aligncommand.h index 1410626..169b435 100644 --- a/aligncommand.h +++ b/aligncommand.h @@ -58,7 +58,8 @@ private: vector candidateFileNames; vector outputNames; - bool abort, flip; + bool abort, flip, calledHelp; + }; #endif diff --git a/amovacommand.cpp b/amovacommand.cpp index c0b9aec..0a9b53b 100644 --- a/amovacommand.cpp +++ b/amovacommand.cpp @@ -66,8 +66,7 @@ vector AmovaCommand::getValidParameters(){ //********************************************************************************************************************** AmovaCommand::AmovaCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["amova"] = tempOutNames; } @@ -105,12 +104,12 @@ vector AmovaCommand::getRequiredFiles(){ AmovaCommand::AmovaCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -349,7 +348,7 @@ AmovaCommand::~AmovaCommand(){} int AmovaCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //read design file designMap = new GroupMap(designfile); diff --git a/binsequencecommand.cpp b/binsequencecommand.cpp index bf14d6b..81c24a3 100644 --- a/binsequencecommand.cpp +++ b/binsequencecommand.cpp @@ -48,8 +48,7 @@ vector BinSeqCommand::getRequiredFiles(){ //********************************************************************************************************************** BinSeqCommand::BinSeqCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; } @@ -62,12 +61,12 @@ BinSeqCommand::BinSeqCommand(){ BinSeqCommand::BinSeqCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -218,7 +217,7 @@ BinSeqCommand::~BinSeqCommand(){ int BinSeqCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } int error = 0; diff --git a/bootstrapsharedcommand.cpp b/bootstrapsharedcommand.cpp index b7d6c45..66a4397 100644 --- a/bootstrapsharedcommand.cpp +++ b/bootstrapsharedcommand.cpp @@ -34,8 +34,7 @@ vector BootSharedCommand::getValidParameters(){ //********************************************************************************************************************** BootSharedCommand::BootSharedCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["tree"] = tempOutNames; } @@ -71,14 +70,14 @@ vector BootSharedCommand::getRequiredFiles(){ BootSharedCommand::BootSharedCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); Groups.clear(); Estimators.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -235,7 +234,7 @@ BootSharedCommand::~BootSharedCommand(){ int BootSharedCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } util = new SharedUtil(); diff --git a/catchallcommand.cpp b/catchallcommand.cpp index b0e5eff..a462bc7 100644 --- a/catchallcommand.cpp +++ b/catchallcommand.cpp @@ -25,6 +25,7 @@ vector CatchAllCommand::getValidParameters(){ //********************************************************************************************************************** CatchAllCommand::CatchAllCommand(){ try { + abort = true; calledHelp = true; //initialize outputTypes vector tempOutNames; outputTypes["csv"] = tempOutNames; @@ -62,11 +63,11 @@ vector CatchAllCommand::getRequiredFiles(){ CatchAllCommand::CatchAllCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -173,7 +174,7 @@ void CatchAllCommand::help(){ int CatchAllCommand::execute() { try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //prepare full output directory outputDir = m->getFullPathName(outputDir); diff --git a/chimerabellerophoncommand.cpp b/chimerabellerophoncommand.cpp index 5d7d6d4..22e4fe2 100644 --- a/chimerabellerophoncommand.cpp +++ b/chimerabellerophoncommand.cpp @@ -48,8 +48,7 @@ vector ChimeraBellerophonCommand::getRequiredFiles(){ //********************************************************************************************************************** ChimeraBellerophonCommand::ChimeraBellerophonCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["chimera"] = tempOutNames; outputTypes["accnos"] = tempOutNames; @@ -63,10 +62,10 @@ ChimeraBellerophonCommand::ChimeraBellerophonCommand(){ //*************************************************************************************************************** ChimeraBellerophonCommand::ChimeraBellerophonCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -210,7 +209,7 @@ ChimeraBellerophonCommand::~ChimeraBellerophonCommand(){ /* do nothing */ } int ChimeraBellerophonCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } for (int i = 0; i < fastaFileNames.size(); i++) { diff --git a/chimeraccodecommand.cpp b/chimeraccodecommand.cpp index 223ddb2..8a4ccde 100644 --- a/chimeraccodecommand.cpp +++ b/chimeraccodecommand.cpp @@ -25,6 +25,7 @@ vector ChimeraCcodeCommand::getValidParameters(){ //********************************************************************************************************************** ChimeraCcodeCommand::ChimeraCcodeCommand(){ try { + abort = true; calledHelp = true; vector tempOutNames; outputTypes["chimera"] = tempOutNames; outputTypes["mapinfo"] = tempOutNames; @@ -61,10 +62,10 @@ vector ChimeraCcodeCommand::getRequiredFiles(){ //*************************************************************************************************************** ChimeraCcodeCommand::ChimeraCcodeCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -239,7 +240,7 @@ ChimeraCcodeCommand::~ChimeraCcodeCommand(){ /* do nothing */ } int ChimeraCcodeCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } for (int s = 0; s < fastaFileNames.size(); s++) { diff --git a/chimeracheckcommand.cpp b/chimeracheckcommand.cpp index 3104fac..c766b9a 100644 --- a/chimeracheckcommand.cpp +++ b/chimeracheckcommand.cpp @@ -47,6 +47,7 @@ vector ChimeraCheckCommand::getRequiredFiles(){ //********************************************************************************************************************** ChimeraCheckCommand::ChimeraCheckCommand(){ try { + abort = true; calledHelp = true; vector tempOutNames; outputTypes["chimera"] = tempOutNames; } @@ -58,10 +59,10 @@ ChimeraCheckCommand::ChimeraCheckCommand(){ //*************************************************************************************************************** ChimeraCheckCommand::ChimeraCheckCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -280,7 +281,7 @@ ChimeraCheckCommand::~ChimeraCheckCommand(){ /* do nothing */ } int ChimeraCheckCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } for (int i = 0; i < fastaFileNames.size(); i++) { diff --git a/chimerapintailcommand.cpp b/chimerapintailcommand.cpp index c5e579e..a8d2d65 100644 --- a/chimerapintailcommand.cpp +++ b/chimerapintailcommand.cpp @@ -25,6 +25,7 @@ vector ChimeraPintailCommand::getValidParameters(){ //********************************************************************************************************************** ChimeraPintailCommand::ChimeraPintailCommand(){ try { + abort = true; calledHelp = true; vector tempOutNames; outputTypes["chimera"] = tempOutNames; outputTypes["accnos"] = tempOutNames; @@ -60,10 +61,10 @@ vector ChimeraPintailCommand::getRequiredFiles(){ //*************************************************************************************************************** ChimeraPintailCommand::ChimeraPintailCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -309,7 +310,7 @@ ChimeraPintailCommand::~ChimeraPintailCommand(){ /* do nothing */ } int ChimeraPintailCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } for (int s = 0; s < fastaFileNames.size(); s++) { diff --git a/chimeraslayercommand.cpp b/chimeraslayercommand.cpp index a7ed94f..67b70f2 100644 --- a/chimeraslayercommand.cpp +++ b/chimeraslayercommand.cpp @@ -27,6 +27,7 @@ vector ChimeraSlayerCommand::getValidParameters(){ //********************************************************************************************************************** ChimeraSlayerCommand::ChimeraSlayerCommand(){ try { + abort = true; calledHelp = true; vector tempOutNames; outputTypes["chimera"] = tempOutNames; outputTypes["accnos"] = tempOutNames; @@ -63,10 +64,10 @@ vector ChimeraSlayerCommand::getRequiredFiles(){ //*************************************************************************************************************** ChimeraSlayerCommand::ChimeraSlayerCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -343,7 +344,7 @@ ChimeraSlayerCommand::~ChimeraSlayerCommand(){ /* do nothing */ } int ChimeraSlayerCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } for (int s = 0; s < fastaFileNames.size(); s++) { diff --git a/chopseqscommand.cpp b/chopseqscommand.cpp index 31fe64f..1ebb1f4 100644 --- a/chopseqscommand.cpp +++ b/chopseqscommand.cpp @@ -25,8 +25,7 @@ vector ChopSeqsCommand::getValidParameters(){ //********************************************************************************************************************** ChopSeqsCommand::ChopSeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["accnos"] = tempOutNames; @@ -62,10 +61,10 @@ vector ChopSeqsCommand::getRequiredFiles(){ //********************************************************************************************************************** ChopSeqsCommand::ChopSeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -156,7 +155,7 @@ void ChopSeqsCommand::help(){ int ChopSeqsCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } string outputFileName = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "chop.fasta"; string outputFileNameAccnos = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "chop.accnos"; diff --git a/classifyotucommand.cpp b/classifyotucommand.cpp index d3d574e..8d9f177 100644 --- a/classifyotucommand.cpp +++ b/classifyotucommand.cpp @@ -26,8 +26,7 @@ vector ClassifyOtuCommand::getValidParameters(){ //********************************************************************************************************************** ClassifyOtuCommand::ClassifyOtuCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["constaxonomy"] = tempOutNames; outputTypes["taxsummary"] = tempOutNames; @@ -63,13 +62,13 @@ vector ClassifyOtuCommand::getRequiredFiles(){ //********************************************************************************************************************** ClassifyOtuCommand::ClassifyOtuCommand(string option) { try{ - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help if (option == "help") { - help(); abort = true; + help(); abort = true; calledHelp = true; } else { //valid paramters for this command string Array[] = {"list","label","name","taxonomy","cutoff","probs","basis","reftaxonomy","group","outputdir","inputdir"}; @@ -229,7 +228,7 @@ ClassifyOtuCommand::~ClassifyOtuCommand(){} int ClassifyOtuCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //if user gave a namesfile then use it if (namefile != "") { readNamesFile(); } diff --git a/classifyseqscommand.cpp b/classifyseqscommand.cpp index 0a1ef88..2dfe05a 100644 --- a/classifyseqscommand.cpp +++ b/classifyseqscommand.cpp @@ -30,8 +30,7 @@ vector ClassifySeqsCommand::getValidParameters(){ //********************************************************************************************************************** ClassifySeqsCommand::ClassifySeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["taxonomy"] = tempOutNames; outputTypes["taxsummary"] = tempOutNames; @@ -68,10 +67,10 @@ vector ClassifySeqsCommand::getRequiredFiles(){ //********************************************************************************************************************** ClassifySeqsCommand::ClassifySeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { @@ -421,7 +420,7 @@ void ClassifySeqsCommand::help(){ int ClassifySeqsCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } if(method == "bayesian"){ classify = new Bayesian(taxonomyFileName, templateFileName, search, kmerSize, cutoff, iters); } else if(method == "knn"){ classify = new Knn(taxonomyFileName, templateFileName, search, kmerSize, gapOpen, gapExtend, match, misMatch, numWanted); } diff --git a/clearcutcommand.cpp b/clearcutcommand.cpp index a2d0aaa..767981d 100644 --- a/clearcutcommand.cpp +++ b/clearcutcommand.cpp @@ -31,8 +31,7 @@ vector ClearcutCommand::getValidParameters(){ //********************************************************************************************************************** ClearcutCommand::ClearcutCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["tree"] = tempOutNames; outputTypes["matrixout"] = tempOutNames; @@ -67,10 +66,10 @@ vector ClearcutCommand::getRequiredFiles(){ /**************************************************************************************/ ClearcutCommand::ClearcutCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -231,7 +230,7 @@ void ClearcutCommand::help(){ int ClearcutCommand::execute() { try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //prepare filename string outputName = outputDir + m->getRootName(m->getSimpleName(inputFile)) + "tre"; diff --git a/clustercommand.cpp b/clustercommand.cpp index 6043d39..5d9225b 100644 --- a/clustercommand.cpp +++ b/clustercommand.cpp @@ -24,8 +24,7 @@ vector ClusterCommand::getValidParameters(){ //********************************************************************************************************************** ClusterCommand::ClusterCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["list"] = tempOutNames; outputTypes["rabund"] = tempOutNames; @@ -65,10 +64,10 @@ ClusterCommand::ClusterCommand(string option) { try{ globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -199,7 +198,7 @@ ClusterCommand::~ClusterCommand(){ int ClusterCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } time_t estart = time(NULL); //int ndist = matrix->getNNodes(); diff --git a/clusterdoturcommand.cpp b/clusterdoturcommand.cpp index 56fbd5c..b2b31ed 100644 --- a/clusterdoturcommand.cpp +++ b/clusterdoturcommand.cpp @@ -25,8 +25,7 @@ vector ClusterDoturCommand::getValidParameters(){ //********************************************************************************************************************** ClusterDoturCommand::ClusterDoturCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["list"] = tempOutNames; outputTypes["rabund"] = tempOutNames; @@ -65,10 +64,10 @@ vector ClusterDoturCommand::getRequiredFiles(){ ClusterDoturCommand::ClusterDoturCommand(string option) { try{ - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -189,7 +188,7 @@ ClusterDoturCommand::~ClusterDoturCommand(){} int ClusterDoturCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } if(namefile != ""){ nameMap = new NameAssignment(namefile); diff --git a/clusterfragmentscommand.cpp b/clusterfragmentscommand.cpp index 24070d2..a8277ff 100644 --- a/clusterfragmentscommand.cpp +++ b/clusterfragmentscommand.cpp @@ -40,8 +40,7 @@ vector ClusterFragmentsCommand::getValidParameters(){ //********************************************************************************************************************** ClusterFragmentsCommand::ClusterFragmentsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["name"] = tempOutNames; @@ -77,10 +76,10 @@ vector ClusterFragmentsCommand::getRequiredFiles(){ //********************************************************************************************************************** ClusterFragmentsCommand::ClusterFragmentsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -182,7 +181,7 @@ void ClusterFragmentsCommand::help(){ int ClusterFragmentsCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } int start = time(NULL); diff --git a/clustersplitcommand.cpp b/clustersplitcommand.cpp index c36e280..cb3fc40 100644 --- a/clustersplitcommand.cpp +++ b/clustersplitcommand.cpp @@ -31,8 +31,7 @@ vector ClusterSplitCommand::getValidParameters(){ //********************************************************************************************************************** ClusterSplitCommand::ClusterSplitCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["list"] = tempOutNames; outputTypes["rabund"] = tempOutNames; @@ -72,11 +71,11 @@ vector ClusterSplitCommand::getRequiredFiles(){ ClusterSplitCommand::ClusterSplitCommand(string option) { try{ globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; format = ""; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -290,7 +289,7 @@ ClusterSplitCommand::~ClusterSplitCommand(){} int ClusterSplitCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } time_t estart; vector listFileNames; diff --git a/collectcommand.cpp b/collectcommand.cpp index 9ea55b2..4b59296 100644 --- a/collectcommand.cpp +++ b/collectcommand.cpp @@ -72,8 +72,7 @@ vector CollectCommand::getRequiredFiles(){ //********************************************************************************************************************** CollectCommand::CollectCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["sobs"] = tempOutNames; outputTypes["chao"] = tempOutNames; @@ -110,7 +109,7 @@ CollectCommand::CollectCommand(){ CollectCommand::CollectCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); Estimators.clear(); @@ -237,7 +236,7 @@ CollectCommand::~CollectCommand(){} int CollectCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } string hadShared = ""; if ((globaldata->getFormat() != "sharedfile")) { inputFileNames.push_back(globaldata->inputFileName); } diff --git a/collectsharedcommand.cpp b/collectsharedcommand.cpp index 7ab15df..21695e3 100644 --- a/collectsharedcommand.cpp +++ b/collectsharedcommand.cpp @@ -88,8 +88,7 @@ vector CollectSharedCommand::getRequiredFiles(){ //********************************************************************************************************************** CollectSharedCommand::CollectSharedCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["sharedchao"] = tempOutNames; outputTypes["sharedsobs"] = tempOutNames; @@ -141,14 +140,14 @@ CollectSharedCommand::CollectSharedCommand(){ CollectSharedCommand::CollectSharedCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); Estimators.clear(); Groups.clear(); //allow user to run help - if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; } + if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -439,7 +438,7 @@ CollectSharedCommand::~CollectSharedCommand(){ int CollectSharedCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //if the users entered no valid calculators don't execute command if (cDisplays.size() == 0) { return 0; } diff --git a/command.hpp b/command.hpp index 97701aa..ddb7763 100644 --- a/command.hpp +++ b/command.hpp @@ -31,6 +31,7 @@ class Command { virtual ~Command() { } protected: MothurOut* m; + bool calledHelp; }; #endif diff --git a/consensuscommand.cpp b/consensuscommand.cpp index 9b72638..9880b8d 100644 --- a/consensuscommand.cpp +++ b/consensuscommand.cpp @@ -46,8 +46,7 @@ vector ConcensusCommand::getRequiredFiles(){ //********************************************************************************************************************** ConcensusCommand::ConcensusCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["tree"] = tempOutNames; outputTypes["nodepairs"] = tempOutNames; @@ -62,7 +61,7 @@ ConcensusCommand::ConcensusCommand(){ ConcensusCommand::ConcensusCommand(string fileroot) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; //initialize outputTypes vector tempOutNames; @@ -108,7 +107,7 @@ ConcensusCommand::~ConcensusCommand(){} int ConcensusCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } else { numNodes = t[0]->getNumNodes(); numLeaves = t[0]->getNumLeaves(); diff --git a/consensusseqscommand.cpp b/consensusseqscommand.cpp index 513566f..482bac5 100644 --- a/consensusseqscommand.cpp +++ b/consensusseqscommand.cpp @@ -26,8 +26,7 @@ vector ConsensusSeqsCommand::getValidParameters(){ //********************************************************************************************************************** ConsensusSeqsCommand::ConsensusSeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["name"] = tempOutNames; @@ -64,11 +63,11 @@ vector ConsensusSeqsCommand::getRequiredFiles(){ //*************************************************************************************************************** ConsensusSeqsCommand::ConsensusSeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; allLines = 1; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -184,7 +183,7 @@ ConsensusSeqsCommand::~ConsensusSeqsCommand(){ /* do nothing */ } int ConsensusSeqsCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } readFasta(); diff --git a/corraxescommand.cpp b/corraxescommand.cpp index 26cdcda..58fb364 100644 --- a/corraxescommand.cpp +++ b/corraxescommand.cpp @@ -47,8 +47,7 @@ vector CorrAxesCommand::getRequiredParameters(){ //********************************************************************************************************************** CorrAxesCommand::CorrAxesCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["corr.axes"] = tempOutNames; } @@ -72,11 +71,11 @@ vector CorrAxesCommand::getRequiredFiles(){ //********************************************************************************************************************** CorrAxesCommand::CorrAxesCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; globaldata = GlobalData::getInstance(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -221,7 +220,7 @@ CorrAxesCommand::~CorrAxesCommand(){} int CorrAxesCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } /*************************************************************************************/ // use smart distancing to get right sharedRabund and convert to relabund if needed // diff --git a/deconvolutecommand.cpp b/deconvolutecommand.cpp index dd05afd..6c04c12 100644 --- a/deconvolutecommand.cpp +++ b/deconvolutecommand.cpp @@ -24,8 +24,7 @@ vector DeconvoluteCommand::getValidParameters(){ //********************************************************************************************************************** DeconvoluteCommand::DeconvoluteCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["name"] = tempOutNames; @@ -61,10 +60,10 @@ vector DeconvoluteCommand::getRequiredFiles(){ /**************************************************************************************/ DeconvoluteCommand::DeconvoluteCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -153,7 +152,7 @@ void DeconvoluteCommand::help(){ int DeconvoluteCommand::execute() { try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //prepare filenames and open files string outNameFile = outputDir + m->getRootName(m->getSimpleName(inFastaName)) + "names"; diff --git a/degapseqscommand.cpp b/degapseqscommand.cpp index 2514ae1..5df6188 100644 --- a/degapseqscommand.cpp +++ b/degapseqscommand.cpp @@ -25,8 +25,7 @@ vector DegapSeqsCommand::getValidParameters(){ //********************************************************************************************************************** DegapSeqsCommand::DegapSeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; } @@ -61,10 +60,10 @@ vector DegapSeqsCommand::getRequiredFiles(){ //*************************************************************************************************************** DegapSeqsCommand::DegapSeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -189,7 +188,7 @@ DegapSeqsCommand::~DegapSeqsCommand(){ /* do nothing */ } int DegapSeqsCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } for (int s = 0; s < fastaFileNames.size(); s++) { diff --git a/deuniqueseqscommand.cpp b/deuniqueseqscommand.cpp index f6b32e6..214359e 100644 --- a/deuniqueseqscommand.cpp +++ b/deuniqueseqscommand.cpp @@ -25,8 +25,7 @@ vector DeUniqueSeqsCommand::getValidParameters(){ //********************************************************************************************************************** DeUniqueSeqsCommand::DeUniqueSeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; } @@ -61,10 +60,10 @@ vector DeUniqueSeqsCommand::getRequiredFiles(){ /**************************************************************************************/ DeUniqueSeqsCommand::DeUniqueSeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -153,7 +152,7 @@ void DeUniqueSeqsCommand::help(){ int DeUniqueSeqsCommand::execute() { try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //prepare filenames and open files ofstream out; diff --git a/distancecommand.cpp b/distancecommand.cpp index a3cebe2..3d66722 100644 --- a/distancecommand.cpp +++ b/distancecommand.cpp @@ -30,8 +30,7 @@ vector DistanceCommand::getValidParameters(){ //********************************************************************************************************************** DistanceCommand::DistanceCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["phylip"] = tempOutNames; outputTypes["column"] = tempOutNames; @@ -67,11 +66,11 @@ vector DistanceCommand::getRequiredFiles(){ //********************************************************************************************************************** DistanceCommand::DistanceCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; Estimators.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -242,7 +241,7 @@ void DistanceCommand::help(){ int DistanceCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } int startTime = time(NULL); diff --git a/engine.cpp b/engine.cpp index ad7a7ad..dd61de6 100644 --- a/engine.cpp +++ b/engine.cpp @@ -152,6 +152,10 @@ bool InteractEngine::getInput(){ //executes valid command Command* command = cFactory->getCommand(commandName, options); quitCommandCalled = command->execute(); + + //if we aborted command + if (quitCommandCalled == 2) { mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); } + mout->control_pressed = 0; mout->executing = false; @@ -291,7 +295,7 @@ bool BatchEngine::getInput(){ //CommandFactory cFactory; int quitCommandCalled = 0; int count = 0; - while(quitCommandCalled == 0){ + while(quitCommandCalled != 1){ #ifdef USE_MPI int pid, processors; @@ -358,6 +362,10 @@ bool BatchEngine::getInput(){ //executes valid command Command* command = cFactory->getCommand(commandName, options); quitCommandCalled = command->execute(); + + //if we aborted command + if (quitCommandCalled == 2) { mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); } + mout->control_pressed = 0; mout->executing = false; @@ -474,7 +482,7 @@ bool ScriptEngine::getInput(){ //CommandFactory cFactory; int quitCommandCalled = 0; - while(quitCommandCalled == 0){ + while(quitCommandCalled != 1){ #ifdef USE_MPI int pid, processors; @@ -542,6 +550,10 @@ bool ScriptEngine::getInput(){ //executes valid command Command* command = cFactory->getCommand(commandName, options); quitCommandCalled = command->execute(); + + //if we aborted command + if (quitCommandCalled == 2) { mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); } + mout->control_pressed = 0; mout->executing = false; diff --git a/filterseqscommand.cpp b/filterseqscommand.cpp index f5c7bd6..6fd4e04 100644 --- a/filterseqscommand.cpp +++ b/filterseqscommand.cpp @@ -25,8 +25,7 @@ vector FilterSeqsCommand::getValidParameters(){ //********************************************************************************************************************** FilterSeqsCommand::FilterSeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["filter"] = tempOutNames; @@ -62,11 +61,11 @@ vector FilterSeqsCommand::getRequiredFiles(){ /**************************************************************************************/ FilterSeqsCommand::FilterSeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; filterFileName = ""; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -240,7 +239,7 @@ void FilterSeqsCommand::help(){ int FilterSeqsCommand::execute() { try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } ifstream inFASTA; m->openInputFile(fastafileNames[0], inFASTA); diff --git a/getgroupcommand.cpp b/getgroupcommand.cpp index 2847db1..ab3ccfa 100644 --- a/getgroupcommand.cpp +++ b/getgroupcommand.cpp @@ -24,8 +24,7 @@ vector GetgroupCommand::getValidParameters(){ //********************************************************************************************************************** GetgroupCommand::GetgroupCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["bootgroup"] = tempOutNames; } @@ -61,10 +60,10 @@ vector GetgroupCommand::getRequiredFiles(){ GetgroupCommand::GetgroupCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -135,7 +134,7 @@ GetgroupCommand::~GetgroupCommand(){ int GetgroupCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } int num, inputData, count; count = 0; diff --git a/getgroupscommand.cpp b/getgroupscommand.cpp index 1832f96..635f68f 100644 --- a/getgroupscommand.cpp +++ b/getgroupscommand.cpp @@ -27,8 +27,7 @@ vector GetGroupsCommand::getValidParameters(){ //********************************************************************************************************************** GetGroupsCommand::GetGroupsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["taxonomy"] = tempOutNames; @@ -67,10 +66,10 @@ vector GetGroupsCommand::getRequiredFiles(){ //********************************************************************************************************************** GetGroupsCommand::GetGroupsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -222,7 +221,7 @@ void GetGroupsCommand::help(){ int GetGroupsCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } groupMap = new GroupMap(groupfile); groupMap->readMap(); diff --git a/getlabelcommand.cpp b/getlabelcommand.cpp index fe4387a..3191d5d 100644 --- a/getlabelcommand.cpp +++ b/getlabelcommand.cpp @@ -49,10 +49,10 @@ vector GetlabelCommand::getRequiredFiles(){ GetlabelCommand::GetlabelCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { if ((globaldata->getListFile() == "") && (globaldata->getRabundFile() == "") && (globaldata->getSabundFile() == "")) { m->mothurOut("You must read a list, sabund or rabund before you can use the get.label command."); m->mothurOutEndLine(); abort = true; } @@ -90,7 +90,7 @@ GetlabelCommand::~GetlabelCommand(){ int GetlabelCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } filename = globaldata->inputFileName; ifstream in; diff --git a/getlineagecommand.cpp b/getlineagecommand.cpp index 8a6f47c..eee0cca 100644 --- a/getlineagecommand.cpp +++ b/getlineagecommand.cpp @@ -27,8 +27,7 @@ vector GetLineageCommand::getValidParameters(){ //********************************************************************************************************************** GetLineageCommand::GetLineageCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["taxonomy"] = tempOutNames; @@ -68,10 +67,10 @@ vector GetLineageCommand::getRequiredFiles(){ //********************************************************************************************************************** GetLineageCommand::GetLineageCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -238,7 +237,7 @@ void GetLineageCommand::help(){ int GetLineageCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } if (m->control_pressed) { return 0; } diff --git a/getlistcountcommand.cpp b/getlistcountcommand.cpp index 1ecef65..78f2604 100644 --- a/getlistcountcommand.cpp +++ b/getlistcountcommand.cpp @@ -24,8 +24,7 @@ vector GetListCountCommand::getValidParameters(){ //********************************************************************************************************************** GetListCountCommand::GetListCountCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["otu"] = tempOutNames; } @@ -61,12 +60,12 @@ vector GetListCountCommand::getRequiredFiles(){ GetListCountCommand::GetListCountCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -168,7 +167,7 @@ GetListCountCommand::~GetListCountCommand(){} int GetListCountCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } globaldata->setFormat("list"); diff --git a/getoturepcommand.cpp b/getoturepcommand.cpp index 9cc9973..84d3871 100644 --- a/getoturepcommand.cpp +++ b/getoturepcommand.cpp @@ -38,8 +38,7 @@ inline bool compareGroup(repStruct left, repStruct right){ //********************************************************************************************************************** GetOTURepCommand::GetOTURepCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["name"] = tempOutNames; @@ -88,13 +87,13 @@ vector GetOTURepCommand::getRequiredFiles(){ GetOTURepCommand::GetOTURepCommand(string option) { try{ globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help if (option == "help") { - help(); abort = true; + help(); abort = true; calledHelp = true; } else { //valid paramters for this command string Array[] = {"fasta","list","label","name","weighted", "group", "sorted", "phylip","column","large","cutoff","precision","groups","outputdir","inputdir"}; @@ -299,7 +298,7 @@ GetOTURepCommand::~GetOTURepCommand(){} int GetOTURepCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } int error; if (!large) { diff --git a/getotuscommand.cpp b/getotuscommand.cpp index fd7c8d1..b075cb4 100644 --- a/getotuscommand.cpp +++ b/getotuscommand.cpp @@ -27,8 +27,7 @@ vector GetOtusCommand::getValidParameters(){ //********************************************************************************************************************** GetOtusCommand::GetOtusCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["group"] = tempOutNames; outputTypes["list"] = tempOutNames; @@ -64,10 +63,10 @@ vector GetOtusCommand::getRequiredFiles(){ //********************************************************************************************************************** GetOtusCommand::GetOtusCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -182,7 +181,7 @@ void GetOtusCommand::help(){ int GetOtusCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } groupMap = new GroupMap(groupfile); groupMap->readMap(); diff --git a/getrabundcommand.cpp b/getrabundcommand.cpp index 60f4ece..0b2d4ee 100644 --- a/getrabundcommand.cpp +++ b/getrabundcommand.cpp @@ -24,8 +24,7 @@ vector GetRAbundCommand::getValidParameters(){ //********************************************************************************************************************** GetRAbundCommand::GetRAbundCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["rabund"] = tempOutNames; } @@ -62,12 +61,12 @@ vector GetRAbundCommand::getRequiredFiles(){ GetRAbundCommand::GetRAbundCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -158,7 +157,7 @@ GetRAbundCommand::~GetRAbundCommand(){} int GetRAbundCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //read first line read = new ReadOTUFile(globaldata->inputFileName); diff --git a/getrelabundcommand.cpp b/getrelabundcommand.cpp index 08e9228..5e48203 100644 --- a/getrelabundcommand.cpp +++ b/getrelabundcommand.cpp @@ -24,8 +24,7 @@ vector GetRelAbundCommand::getValidParameters(){ //********************************************************************************************************************** GetRelAbundCommand::GetRelAbundCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["relabund"] = tempOutNames; } @@ -61,12 +60,12 @@ vector GetRelAbundCommand::getRequiredFiles(){ GetRelAbundCommand::GetRelAbundCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -167,7 +166,7 @@ GetRelAbundCommand::~GetRelAbundCommand(){ int GetRelAbundCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } string outputFileName = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + "relabund"; ofstream out; diff --git a/getsabundcommand.cpp b/getsabundcommand.cpp index 3637d29..2ae807c 100644 --- a/getsabundcommand.cpp +++ b/getsabundcommand.cpp @@ -24,8 +24,7 @@ vector GetSAbundCommand::getValidParameters(){ //********************************************************************************************************************** GetSAbundCommand::GetSAbundCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["sabund"] = tempOutNames; } @@ -61,12 +60,12 @@ vector GetSAbundCommand::getRequiredFiles(){ GetSAbundCommand::GetSAbundCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -152,7 +151,7 @@ GetSAbundCommand::~GetSAbundCommand(){ int GetSAbundCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //using order vector so you don't have to distinguish between the list and rabund files read = new ReadOTUFile(globaldata->inputFileName); diff --git a/getseqscommand.cpp b/getseqscommand.cpp index 9f2b506..902cc07 100644 --- a/getseqscommand.cpp +++ b/getseqscommand.cpp @@ -26,8 +26,7 @@ vector GetSeqsCommand::getValidParameters(){ //********************************************************************************************************************** GetSeqsCommand::GetSeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["taxonomy"] = tempOutNames; @@ -69,10 +68,10 @@ vector GetSeqsCommand::getRequiredFiles(){ //********************************************************************************************************************** GetSeqsCommand::GetSeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -257,7 +256,7 @@ void GetSeqsCommand::help(){ int GetSeqsCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //get names you want to keep readAccnos(); diff --git a/getsharedotucommand.cpp b/getsharedotucommand.cpp index 699581f..6ca4ee2 100644 --- a/getsharedotucommand.cpp +++ b/getsharedotucommand.cpp @@ -25,8 +25,7 @@ vector GetSharedOTUCommand::getValidParameters(){ //********************************************************************************************************************** GetSharedOTUCommand::GetSharedOTUCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["accnos"] = tempOutNames; @@ -65,13 +64,13 @@ GetSharedOTUCommand::GetSharedOTUCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; unique = true; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -218,7 +217,7 @@ GetSharedOTUCommand::~GetSharedOTUCommand(){} int GetSharedOTUCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } groupMap = new GroupMap(groupfile); int error = groupMap->readMap(); diff --git a/hclustercommand.cpp b/hclustercommand.cpp index 69dbef6..94082df 100644 --- a/hclustercommand.cpp +++ b/hclustercommand.cpp @@ -24,8 +24,7 @@ vector HClusterCommand::getValidParameters(){ //********************************************************************************************************************** HClusterCommand::HClusterCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["list"] = tempOutNames; outputTypes["rabund"] = tempOutNames; @@ -64,10 +63,10 @@ vector HClusterCommand::getRequiredFiles(){ HClusterCommand::HClusterCommand(string option) { try{ globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -237,7 +236,7 @@ HClusterCommand::~HClusterCommand(){} int HClusterCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } if(namefile != ""){ globaldata->nameMap = new NameAssignment(namefile); diff --git a/heatmapcommand.cpp b/heatmapcommand.cpp index 8920108..19a320a 100644 --- a/heatmapcommand.cpp +++ b/heatmapcommand.cpp @@ -24,8 +24,7 @@ vector HeatMapCommand::getValidParameters(){ //********************************************************************************************************************** HeatMapCommand::HeatMapCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["svg"] = tempOutNames; } @@ -62,12 +61,12 @@ vector HeatMapCommand::getRequiredFiles(){ HeatMapCommand::HeatMapCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -183,7 +182,7 @@ HeatMapCommand::~HeatMapCommand(){ int HeatMapCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } heatmap = new HeatMap(sorted, scale, numOTU, fontSize, outputDir); format = globaldata->getFormat(); diff --git a/heatmapsimcommand.cpp b/heatmapsimcommand.cpp index 7ab178c..28b0221 100644 --- a/heatmapsimcommand.cpp +++ b/heatmapsimcommand.cpp @@ -34,8 +34,7 @@ vector HeatMapSimCommand::getValidParameters(){ //********************************************************************************************************************** HeatMapSimCommand::HeatMapSimCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["svg"] = tempOutNames; } @@ -71,14 +70,14 @@ vector HeatMapSimCommand::getRequiredFiles(){ HeatMapSimCommand::HeatMapSimCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); Groups.clear(); Estimators.clear(); //allow user to run help - if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; } + if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -273,7 +272,7 @@ HeatMapSimCommand::~HeatMapSimCommand(){} int HeatMapSimCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } heatmap = new HeatMapSim(outputDir); diff --git a/homovacommand.cpp b/homovacommand.cpp index 86a900a..32a7765 100644 --- a/homovacommand.cpp +++ b/homovacommand.cpp @@ -66,8 +66,7 @@ vector HomovaCommand::getValidParameters(){ //********************************************************************************************************************** HomovaCommand::HomovaCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["homova"] = tempOutNames; } @@ -105,12 +104,12 @@ vector HomovaCommand::getRequiredFiles(){ HomovaCommand::HomovaCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -349,7 +348,7 @@ HomovaCommand::~HomovaCommand(){} int HomovaCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //read design file designMap = new GroupMap(designfile); diff --git a/indicatorcommand.cpp b/indicatorcommand.cpp index 143135f..239a4bc 100644 --- a/indicatorcommand.cpp +++ b/indicatorcommand.cpp @@ -37,8 +37,7 @@ vector IndicatorCommand::getRequiredParameters(){ //********************************************************************************************************************** IndicatorCommand::IndicatorCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["tree"] = tempOutNames; outputTypes["summary"] = tempOutNames; @@ -64,10 +63,10 @@ vector IndicatorCommand::getRequiredFiles(){ IndicatorCommand::IndicatorCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -199,7 +198,7 @@ IndicatorCommand::~IndicatorCommand(){} int IndicatorCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //read designfile if given and set up globaldatas groups for read of sharedfiles if (designfile != "") { diff --git a/libshuffcommand.cpp b/libshuffcommand.cpp index e7fb357..129c970 100644 --- a/libshuffcommand.cpp +++ b/libshuffcommand.cpp @@ -33,8 +33,7 @@ vector LibShuffCommand::getValidParameters(){ //********************************************************************************************************************** LibShuffCommand::LibShuffCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["coverage"] = tempOutNames; outputTypes["libshuffsummary"] = tempOutNames; @@ -72,11 +71,11 @@ vector LibShuffCommand::getRequiredFiles(){ LibShuffCommand::LibShuffCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; Groups.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -189,7 +188,7 @@ void LibShuffCommand::help(){ int LibShuffCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } savedDXYValues = form->evaluateAll(); savedMinValues = form->getSavedMins(); diff --git a/listseqscommand.cpp b/listseqscommand.cpp index 1488cda..360e195 100644 --- a/listseqscommand.cpp +++ b/listseqscommand.cpp @@ -26,8 +26,7 @@ vector ListSeqsCommand::getValidParameters(){ //********************************************************************************************************************** ListSeqsCommand::ListSeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["accnos"] = tempOutNames; } @@ -63,10 +62,10 @@ vector ListSeqsCommand::getRequiredFiles(){ ListSeqsCommand::ListSeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -206,7 +205,7 @@ void ListSeqsCommand::help(){ int ListSeqsCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //read functions fill names vector if (fastafile != "") { inputFileName = fastafile; readFasta(); } diff --git a/makegroupcommand.cpp b/makegroupcommand.cpp index 12be826..1c04fec 100644 --- a/makegroupcommand.cpp +++ b/makegroupcommand.cpp @@ -25,8 +25,7 @@ vector MakeGroupCommand::getValidParameters(){ //********************************************************************************************************************** MakeGroupCommand::MakeGroupCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["group"] = tempOutNames; } @@ -63,10 +62,10 @@ vector MakeGroupCommand::getRequiredFiles(){ MakeGroupCommand::MakeGroupCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { @@ -198,7 +197,7 @@ void MakeGroupCommand::help(){ int MakeGroupCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } if (outputDir == "") { outputDir = m->hasPath(fastaFileNames[0]); } diff --git a/matrixoutputcommand.cpp b/matrixoutputcommand.cpp index 02b30e3..baf449e 100644 --- a/matrixoutputcommand.cpp +++ b/matrixoutputcommand.cpp @@ -64,8 +64,7 @@ vector MatrixOutputCommand::getValidParameters(){ //********************************************************************************************************************** MatrixOutputCommand::MatrixOutputCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["phylip"] = tempOutNames; } @@ -102,14 +101,14 @@ vector MatrixOutputCommand::getRequiredFiles(){ MatrixOutputCommand::MatrixOutputCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); Groups.clear(); Estimators.clear(); //allow user to run help - if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; } + if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -312,7 +311,7 @@ MatrixOutputCommand::~MatrixOutputCommand(){ int MatrixOutputCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //if the users entered no valid calculators don't execute command if (matrixCalculators.size() == 0) { m->mothurOut("No valid calculators."); m->mothurOutEndLine(); return 0; } diff --git a/mergefilecommand.cpp b/mergefilecommand.cpp index c7e5b65..2b34a00 100644 --- a/mergefilecommand.cpp +++ b/mergefilecommand.cpp @@ -24,8 +24,7 @@ vector MergeFileCommand::getValidParameters(){ //********************************************************************************************************************** MergeFileCommand::MergeFileCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["merge"] = tempOutNames; } @@ -61,11 +60,11 @@ vector MergeFileCommand::getRequiredFiles(){ MergeFileCommand::MergeFileCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; if(option == "help") { help(); - abort = true; + abort = true; calledHelp = true; } else { //valid paramters for this command @@ -137,7 +136,7 @@ MergeFileCommand::~MergeFileCommand() { /* do nothing */ } int MergeFileCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } ofstream outputFile; m->openOutputFile(outputFileName, outputFile); diff --git a/mergegroupscommand.cpp b/mergegroupscommand.cpp index 4738389..c54cd1c 100644 --- a/mergegroupscommand.cpp +++ b/mergegroupscommand.cpp @@ -25,8 +25,7 @@ vector MergeGroupsCommand::getValidParameters(){ //********************************************************************************************************************** MergeGroupsCommand::MergeGroupsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["shared"] = tempOutNames; } @@ -64,12 +63,12 @@ vector MergeGroupsCommand::getRequiredFiles(){ MergeGroupsCommand::MergeGroupsCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -180,7 +179,7 @@ MergeGroupsCommand::~MergeGroupsCommand(){} int MergeGroupsCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } if (outputDir == "") { outputDir += m->hasPath(sharedfile); } string outputFileName = outputDir + m->getRootName(m->getSimpleName(sharedfile)) + "merge" + m->getExtension(sharedfile); diff --git a/metastatscommand.cpp b/metastatscommand.cpp index 81715e0..e13e37c 100644 --- a/metastatscommand.cpp +++ b/metastatscommand.cpp @@ -26,8 +26,7 @@ vector MetaStatsCommand::getValidParameters(){ //********************************************************************************************************************** MetaStatsCommand::MetaStatsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["metastats"] = tempOutNames; } @@ -65,12 +64,12 @@ vector MetaStatsCommand::getRequiredFiles(){ MetaStatsCommand::MetaStatsCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -206,7 +205,7 @@ MetaStatsCommand::~MetaStatsCommand(){} int MetaStatsCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } designMap = new GroupMap(designfile); designMap->readDesignMap(); diff --git a/mgclustercommand.cpp b/mgclustercommand.cpp index 3ed9bf2..4809964 100644 --- a/mgclustercommand.cpp +++ b/mgclustercommand.cpp @@ -25,8 +25,7 @@ vector MGClusterCommand::getValidParameters(){ //********************************************************************************************************************** MGClusterCommand::MGClusterCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["list"] = tempOutNames; outputTypes["rabund"] = tempOutNames; @@ -64,10 +63,10 @@ vector MGClusterCommand::getRequiredFiles(){ MGClusterCommand::MGClusterCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -202,7 +201,7 @@ MGClusterCommand::~MGClusterCommand(){} int MGClusterCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //read names file if (namefile != "") { diff --git a/nmdscommand.cpp b/nmdscommand.cpp index 28bf397..6596859 100644 --- a/nmdscommand.cpp +++ b/nmdscommand.cpp @@ -25,8 +25,7 @@ vector NMDSCommand::getValidParameters(){ //********************************************************************************************************************** NMDSCommand::NMDSCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["nmds"] = tempOutNames; outputTypes["stress"] = tempOutNames; @@ -64,10 +63,10 @@ vector NMDSCommand::getRequiredFiles(){ NMDSCommand::NMDSCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -178,7 +177,7 @@ NMDSCommand::~NMDSCommand(){} int NMDSCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } cout.setf(ios::fixed, ios::floatfield); cout.setf(ios::showpoint); diff --git a/normalizesharedcommand.cpp b/normalizesharedcommand.cpp index 8526501..c0e7c1f 100644 --- a/normalizesharedcommand.cpp +++ b/normalizesharedcommand.cpp @@ -24,8 +24,7 @@ vector NormalizeSharedCommand::getValidParameters(){ //********************************************************************************************************************** NormalizeSharedCommand::NormalizeSharedCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["shared"] = tempOutNames; } @@ -62,12 +61,12 @@ vector NormalizeSharedCommand::getRequiredFiles(){ NormalizeSharedCommand::NormalizeSharedCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -185,7 +184,7 @@ NormalizeSharedCommand::~NormalizeSharedCommand(){} int NormalizeSharedCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } string outputFileName = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + "norm.shared"; ofstream out; diff --git a/otuhierarchycommand.cpp b/otuhierarchycommand.cpp index 14138de..b49af32 100644 --- a/otuhierarchycommand.cpp +++ b/otuhierarchycommand.cpp @@ -24,8 +24,7 @@ vector OtuHierarchyCommand::getValidParameters(){ //********************************************************************************************************************** OtuHierarchyCommand::OtuHierarchyCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["otuheirarchy"] = tempOutNames; } @@ -60,10 +59,10 @@ vector OtuHierarchyCommand::getRequiredFiles(){ //********************************************************************************************************************** OtuHierarchyCommand::OtuHierarchyCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -157,7 +156,7 @@ OtuHierarchyCommand::~OtuHierarchyCommand(){} int OtuHierarchyCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //get listvectors that correspond to labels requested, (or use smart distancing to get closest listvector) vector lists = getListVectors(); diff --git a/pairwiseseqscommand.cpp b/pairwiseseqscommand.cpp index 7a1ba4d..0a4edea 100644 --- a/pairwiseseqscommand.cpp +++ b/pairwiseseqscommand.cpp @@ -61,8 +61,7 @@ vector PairwiseSeqsCommand::getRequiredFiles(){ //********************************************************************************************************************** PairwiseSeqsCommand::PairwiseSeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["phylip"] = tempOutNames; outputTypes["column"] = tempOutNames; @@ -75,10 +74,10 @@ PairwiseSeqsCommand::PairwiseSeqsCommand(){ //********************************************************************************************************************** PairwiseSeqsCommand::PairwiseSeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { @@ -268,7 +267,7 @@ void PairwiseSeqsCommand::help(){ int PairwiseSeqsCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } int longestBase = 2000; //will need to update this in driver if we find sequences with more bases. hardcoded so we don't have the pre-read user fasta file. diff --git a/parsefastaqcommand.cpp b/parsefastaqcommand.cpp index f0a7abc..7f4fbba 100644 --- a/parsefastaqcommand.cpp +++ b/parsefastaqcommand.cpp @@ -25,8 +25,7 @@ vector ParseFastaQCommand::getValidParameters(){ //********************************************************************************************************************** ParseFastaQCommand::ParseFastaQCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["qual"] = tempOutNames; @@ -62,9 +61,9 @@ vector ParseFastaQCommand::getRequiredFiles(){ //********************************************************************************************************************** ParseFastaQCommand::ParseFastaQCommand(string option){ try { - abort = false; + abort = false; calledHelp = false; - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -140,7 +139,7 @@ ParseFastaQCommand::~ParseFastaQCommand() { /* do nothing */ } int ParseFastaQCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //open Output Files string fastaFile = outputDir + m->getRootName(m->getSimpleName(fastaQFile)) + "fasta"; diff --git a/parselistscommand.cpp b/parselistscommand.cpp index 9cf5a73..fdacc3a 100644 --- a/parselistscommand.cpp +++ b/parselistscommand.cpp @@ -25,8 +25,7 @@ vector ParseListCommand::getValidParameters(){ //********************************************************************************************************************** ParseListCommand::ParseListCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["list"] = tempOutNames; } @@ -61,11 +60,11 @@ vector ParseListCommand::getRequiredFiles(){ //********************************************************************************************************************** ParseListCommand::ParseListCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; allLines = 1; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -170,7 +169,7 @@ ParseListCommand::~ParseListCommand(){} int ParseListCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //set fileroot string fileroot = outputDir + m->getRootName(m->getSimpleName(listfile)); diff --git a/parsimonycommand.cpp b/parsimonycommand.cpp index c97e92e..c0de504 100644 --- a/parsimonycommand.cpp +++ b/parsimonycommand.cpp @@ -24,8 +24,7 @@ vector ParsimonyCommand::getValidParameters(){ //********************************************************************************************************************** ParsimonyCommand::ParsimonyCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["parsimony"] = tempOutNames; outputTypes["psummary"] = tempOutNames; @@ -61,11 +60,11 @@ vector ParsimonyCommand::getRequiredFiles(){ ParsimonyCommand::ParsimonyCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; Groups.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -186,7 +185,7 @@ void ParsimonyCommand::help(){ int ParsimonyCommand::execute() { try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } Progress* reading; reading = new Progress("Comparing to random:", iters); diff --git a/pcacommand.cpp b/pcacommand.cpp index 8fb4121..2e8f132 100644 --- a/pcacommand.cpp +++ b/pcacommand.cpp @@ -25,8 +25,7 @@ vector PCACommand::getValidParameters(){ //********************************************************************************************************************** PCACommand::PCACommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["pca"] = tempOutNames; outputTypes["loadings"] = tempOutNames; @@ -63,12 +62,12 @@ vector PCACommand::getRequiredFiles(){ PCACommand::PCACommand(string option) { try { - abort = false; + abort = false; calledHelp = false; globaldata = GlobalData::getInstance(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -150,7 +149,7 @@ PCACommand::~PCACommand(){} int PCACommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } cout.setf(ios::fixed, ios::floatfield); cout.setf(ios::showpoint); diff --git a/pcoacommand.cpp b/pcoacommand.cpp index fbcb7e0..d8efb25 100644 --- a/pcoacommand.cpp +++ b/pcoacommand.cpp @@ -26,8 +26,7 @@ vector PCOACommand::getValidParameters(){ //********************************************************************************************************************** PCOACommand::PCOACommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["pcoa"] = tempOutNames; outputTypes["loadings"] = tempOutNames; @@ -64,10 +63,10 @@ vector PCOACommand::getRequiredFiles(){ PCOACommand::PCOACommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -149,7 +148,7 @@ PCOACommand::~PCOACommand(){} int PCOACommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } cout.setf(ios::fixed, ios::floatfield); cout.setf(ios::showpoint); diff --git a/phylodiversitycommand.cpp b/phylodiversitycommand.cpp index 4eb652c..a987594 100644 --- a/phylodiversitycommand.cpp +++ b/phylodiversitycommand.cpp @@ -24,8 +24,7 @@ vector PhyloDiversityCommand::getValidParameters(){ //********************************************************************************************************************** PhyloDiversityCommand::PhyloDiversityCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["phylodiv"] = tempOutNames; outputTypes["rarefy"] = tempOutNames; @@ -63,10 +62,10 @@ vector PhyloDiversityCommand::getRequiredFiles(){ PhyloDiversityCommand::PhyloDiversityCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -169,7 +168,7 @@ PhyloDiversityCommand::~PhyloDiversityCommand(){} int PhyloDiversityCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //incase the user had some mismatches between the tree and group files we don't want group xxx to be analyzed for (int i = 0; i < globaldata->Groups.size(); i++) { if (globaldata->Groups[i] == "xxx") { globaldata->Groups.erase(globaldata->Groups.begin()+i); break; } } diff --git a/phylotypecommand.cpp b/phylotypecommand.cpp index 2018170..4b524dd 100644 --- a/phylotypecommand.cpp +++ b/phylotypecommand.cpp @@ -28,8 +28,7 @@ vector PhylotypeCommand::getValidParameters(){ //********************************************************************************************************************** PhylotypeCommand::PhylotypeCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["list"] = tempOutNames; outputTypes["sabund"] = tempOutNames; @@ -66,10 +65,10 @@ vector PhylotypeCommand::getRequiredFiles(){ /**********************************************************************************************************************/ PhylotypeCommand::PhylotypeCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { @@ -181,7 +180,7 @@ PhylotypeCommand::~PhylotypeCommand(){} int PhylotypeCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //reads in taxonomy file and makes all the taxonomies the same length //by appending the last taxon to a given taxonomy as many times as needed to diff --git a/pipelinepdscommand.cpp b/pipelinepdscommand.cpp index f95b928..84282dc 100644 --- a/pipelinepdscommand.cpp +++ b/pipelinepdscommand.cpp @@ -49,10 +49,10 @@ vector PipelineCommand::getRequiredFiles(){ PipelineCommand::PipelineCommand(string option) { try { cFactory = CommandFactory::getInstance(); - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { @@ -235,7 +235,7 @@ PipelineCommand::~PipelineCommand(){} int PipelineCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } int start = time(NULL); diff --git a/pipelinepdscommand.h b/pipelinepdscommand.h index a506159..289a909 100644 --- a/pipelinepdscommand.h +++ b/pipelinepdscommand.h @@ -20,7 +20,7 @@ class PipelineCommand : public Command { public: PipelineCommand(string); - PipelineCommand() {} + PipelineCommand() { abort = true; calledHelp = true; } ~PipelineCommand(); vector getRequiredParameters(); vector getValidParameters(); diff --git a/preclustercommand.cpp b/preclustercommand.cpp index 3a3aafc..14409f5 100644 --- a/preclustercommand.cpp +++ b/preclustercommand.cpp @@ -26,8 +26,7 @@ vector PreClusterCommand::getValidParameters(){ //********************************************************************************************************************** PreClusterCommand::PreClusterCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["name"] = tempOutNames; @@ -64,10 +63,10 @@ vector PreClusterCommand::getRequiredFiles(){ PreClusterCommand::PreClusterCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -167,7 +166,7 @@ void PreClusterCommand::help(){ int PreClusterCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } int start = time(NULL); diff --git a/quitcommand.cpp b/quitcommand.cpp index 0dd2dec..462fe8f 100644 --- a/quitcommand.cpp +++ b/quitcommand.cpp @@ -45,10 +45,10 @@ vector QuitCommand::getRequiredFiles(){ //********************************************************************************************************************** QuitCommand::QuitCommand(string option) { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } } //********************************************************************************************************************** diff --git a/rarefactcommand.cpp b/rarefactcommand.cpp index cb37727..4ab81ea 100644 --- a/rarefactcommand.cpp +++ b/rarefactcommand.cpp @@ -62,8 +62,7 @@ vector RareFactCommand::getRequiredFiles(){ //********************************************************************************************************************** RareFactCommand::RareFactCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["rarefaction"] = tempOutNames; outputTypes["r_chao"] = tempOutNames; @@ -90,13 +89,13 @@ RareFactCommand::RareFactCommand(){ RareFactCommand::RareFactCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); Estimators.clear(); //allow user to run help - if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; } + if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; calledHelp = true; } else { //valid paramters for this command @@ -214,7 +213,7 @@ RareFactCommand::~RareFactCommand(){} int RareFactCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } string hadShared = ""; if ((globaldata->getFormat() != "sharedfile")) { inputFileNames.push_back(globaldata->inputFileName); } diff --git a/rarefactsharedcommand.cpp b/rarefactsharedcommand.cpp index 8cf1f2f..ea460c0 100644 --- a/rarefactsharedcommand.cpp +++ b/rarefactsharedcommand.cpp @@ -26,8 +26,7 @@ vector RareFactSharedCommand::getValidParameters(){ //********************************************************************************************************************** RareFactSharedCommand::RareFactSharedCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["sharedrarefaction"] = tempOutNames; outputTypes["sharedr_nseqs"] = tempOutNames; @@ -66,14 +65,14 @@ RareFactSharedCommand::RareFactSharedCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); Estimators.clear(); Groups.clear(); //allow user to run help - if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; } + if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -217,7 +216,7 @@ RareFactSharedCommand::~RareFactSharedCommand(){ int RareFactSharedCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //if the users entered no valid calculators don't execute command if (rDisplays.size() == 0) { return 0; } diff --git a/readdistcommand.cpp b/readdistcommand.cpp index c600eb8..630f649 100644 --- a/readdistcommand.cpp +++ b/readdistcommand.cpp @@ -51,10 +51,10 @@ vector ReadDistCommand::getRequiredFiles(){ ReadDistCommand::ReadDistCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -239,7 +239,7 @@ ReadDistCommand::~ReadDistCommand(){ int ReadDistCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } time_t start = time(NULL); size_t numDists = 0; diff --git a/readdistcommand.h b/readdistcommand.h index 984b4a7..2f05ddb 100644 --- a/readdistcommand.h +++ b/readdistcommand.h @@ -27,7 +27,7 @@ class GlobalData; class ReadDistCommand : public Command { public: ReadDistCommand(string); - ReadDistCommand() {} + ReadDistCommand() { abort = true; calledHelp = true; } ~ReadDistCommand(); vector getRequiredParameters(); vector getValidParameters(); diff --git a/readotucommand.cpp b/readotucommand.cpp index 8683fc3..6757556 100644 --- a/readotucommand.cpp +++ b/readotucommand.cpp @@ -24,8 +24,7 @@ vector ReadOtuCommand::getValidParameters(){ //********************************************************************************************************************** ReadOtuCommand::ReadOtuCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["rabund"] = tempOutNames; outputTypes["shared"] = tempOutNames; @@ -62,11 +61,11 @@ vector ReadOtuCommand::getRequiredFiles(){ ReadOtuCommand::ReadOtuCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -290,7 +289,7 @@ ReadOtuCommand::~ReadOtuCommand(){} int ReadOtuCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } if (globaldata->getFormat() == "shared") { diff --git a/readtreecommand.cpp b/readtreecommand.cpp index edfdf3b..05a65b7 100644 --- a/readtreecommand.cpp +++ b/readtreecommand.cpp @@ -48,10 +48,10 @@ vector ReadTreeCommand::getRequiredFiles(){ ReadTreeCommand::ReadTreeCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -178,7 +178,7 @@ ReadTreeCommand::~ReadTreeCommand(){ int ReadTreeCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } int readOk; diff --git a/readtreecommand.h b/readtreecommand.h index 97391d0..464a825 100644 --- a/readtreecommand.h +++ b/readtreecommand.h @@ -19,7 +19,7 @@ class GlobalData; class ReadTreeCommand : public Command { public: ReadTreeCommand(string); - ReadTreeCommand() {} + ReadTreeCommand() { abort = true; calledHelp = true; } ~ReadTreeCommand(); vector getRequiredParameters(); vector getValidParameters(); diff --git a/removegroupscommand.cpp b/removegroupscommand.cpp index 2c98e81..4462b52 100644 --- a/removegroupscommand.cpp +++ b/removegroupscommand.cpp @@ -27,8 +27,7 @@ vector RemoveGroupsCommand::getValidParameters(){ //********************************************************************************************************************** RemoveGroupsCommand::RemoveGroupsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["taxonomy"] = tempOutNames; @@ -67,10 +66,10 @@ vector RemoveGroupsCommand::getRequiredFiles(){ //********************************************************************************************************************** RemoveGroupsCommand::RemoveGroupsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -222,7 +221,7 @@ void RemoveGroupsCommand::help(){ int RemoveGroupsCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } groupMap = new GroupMap(groupfile); groupMap->readMap(); diff --git a/removelineagecommand.cpp b/removelineagecommand.cpp index 0a5c5c7..6e43b10 100644 --- a/removelineagecommand.cpp +++ b/removelineagecommand.cpp @@ -26,8 +26,7 @@ vector RemoveLineageCommand::getValidParameters(){ //********************************************************************************************************************** RemoveLineageCommand::RemoveLineageCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["taxonomy"] = tempOutNames; @@ -67,10 +66,10 @@ vector RemoveLineageCommand::getRequiredFiles(){ //********************************************************************************************************************** RemoveLineageCommand::RemoveLineageCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -237,7 +236,7 @@ void RemoveLineageCommand::help(){ int RemoveLineageCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } if (m->control_pressed) { return 0; } diff --git a/removeotuscommand.cpp b/removeotuscommand.cpp index 1a7d3bd..347bb08 100644 --- a/removeotuscommand.cpp +++ b/removeotuscommand.cpp @@ -27,8 +27,7 @@ vector RemoveOtusCommand::getValidParameters(){ //********************************************************************************************************************** RemoveOtusCommand::RemoveOtusCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["group"] = tempOutNames; outputTypes["list"] = tempOutNames; @@ -64,10 +63,10 @@ vector RemoveOtusCommand::getRequiredFiles(){ //********************************************************************************************************************** RemoveOtusCommand::RemoveOtusCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -182,7 +181,7 @@ void RemoveOtusCommand::help(){ int RemoveOtusCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } groupMap = new GroupMap(groupfile); groupMap->readMap(); diff --git a/removerarecommand.cpp b/removerarecommand.cpp index 0ba90f3..0c656a0 100644 --- a/removerarecommand.cpp +++ b/removerarecommand.cpp @@ -28,8 +28,7 @@ vector RemoveRareCommand::getValidParameters(){ //********************************************************************************************************************** RemoveRareCommand::RemoveRareCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["rabund"] = tempOutNames; outputTypes["sabund"] = tempOutNames; @@ -69,11 +68,11 @@ vector RemoveRareCommand::getRequiredFiles(){ RemoveRareCommand::RemoveRareCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -227,7 +226,7 @@ void RemoveRareCommand::help(){ int RemoveRareCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } if (m->control_pressed) { return 0; } diff --git a/removeseqscommand.cpp b/removeseqscommand.cpp index 17de5a8..81c42f6 100644 --- a/removeseqscommand.cpp +++ b/removeseqscommand.cpp @@ -26,8 +26,7 @@ vector RemoveSeqsCommand::getValidParameters(){ //********************************************************************************************************************** RemoveSeqsCommand::RemoveSeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["taxonomy"] = tempOutNames; @@ -68,10 +67,10 @@ vector RemoveSeqsCommand::getRequiredFiles(){ //********************************************************************************************************************** RemoveSeqsCommand::RemoveSeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -249,7 +248,7 @@ void RemoveSeqsCommand::help(){ int RemoveSeqsCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //get names you want to keep readAccnos(); diff --git a/reversecommand.cpp b/reversecommand.cpp index 7b58162..d20f4af 100644 --- a/reversecommand.cpp +++ b/reversecommand.cpp @@ -25,8 +25,7 @@ vector ReverseSeqsCommand::getValidParameters(){ //********************************************************************************************************************** ReverseSeqsCommand::ReverseSeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; } @@ -62,10 +61,10 @@ vector ReverseSeqsCommand::getRequiredFiles(){ ReverseSeqsCommand::ReverseSeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -144,7 +143,7 @@ ReverseSeqsCommand::~ReverseSeqsCommand(){ /* do nothing */ } int ReverseSeqsCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } ifstream inFASTA; m->openInputFile(fasta, inFASTA); diff --git a/screenseqscommand.cpp b/screenseqscommand.cpp index 65b5956..150a27e 100644 --- a/screenseqscommand.cpp +++ b/screenseqscommand.cpp @@ -26,8 +26,7 @@ vector ScreenSeqsCommand::getValidParameters(){ //********************************************************************************************************************** ScreenSeqsCommand::ScreenSeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["name"] = tempOutNames; @@ -67,10 +66,10 @@ vector ScreenSeqsCommand::getRequiredFiles(){ ScreenSeqsCommand::ScreenSeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -247,7 +246,7 @@ ScreenSeqsCommand::~ScreenSeqsCommand(){ /* do nothing */ } int ScreenSeqsCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //if the user want to optimize we need to no the 90% mark vector positions; diff --git a/secondarystructurecommand.cpp b/secondarystructurecommand.cpp index 26bd354..c9002ca 100644 --- a/secondarystructurecommand.cpp +++ b/secondarystructurecommand.cpp @@ -25,8 +25,7 @@ vector AlignCheckCommand::getValidParameters(){ //********************************************************************************************************************** AlignCheckCommand::AlignCheckCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["aligncheck"] = tempOutNames; } @@ -62,11 +61,11 @@ vector AlignCheckCommand::getRequiredFiles(){ AlignCheckCommand::AlignCheckCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; haderror = 0; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -155,7 +154,7 @@ void AlignCheckCommand::help(){ int AlignCheckCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } //get secondary structure info. readMap(); diff --git a/sensspeccommand.cpp b/sensspeccommand.cpp index 045736d..6a22fd6 100644 --- a/sensspeccommand.cpp +++ b/sensspeccommand.cpp @@ -24,8 +24,7 @@ vector SensSpecCommand::getValidParameters(){ //********************************************************************************************************************** SensSpecCommand::SensSpecCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["sensspec"] = tempOutNames; } @@ -62,10 +61,10 @@ vector SensSpecCommand::getRequiredFiles(){ SensSpecCommand::SensSpecCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { string temp; @@ -208,7 +207,7 @@ SensSpecCommand::~SensSpecCommand(){ /* do nothing */ } int SensSpecCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } setUpOutput(); outputNames.push_back(sensSpecFileName); outputTypes["sensspec"].push_back(sensSpecFileName); diff --git a/seqerrorcommand.cpp b/seqerrorcommand.cpp index d2c0fcb..00f7862 100644 --- a/seqerrorcommand.cpp +++ b/seqerrorcommand.cpp @@ -27,8 +27,7 @@ vector SeqErrorCommand::getValidParameters(){ //********************************************************************************************************************** SeqErrorCommand::SeqErrorCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["error.summary"] = tempOutNames; outputTypes["error.seq"] = tempOutNames; @@ -73,10 +72,10 @@ vector SeqErrorCommand::getRequiredFiles(){ SeqErrorCommand::SeqErrorCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { string temp; @@ -231,7 +230,7 @@ SeqErrorCommand::~SeqErrorCommand(){ int SeqErrorCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } string errorSummaryFileName = queryFileName.substr(0,queryFileName.find_last_of('.')) + ".error.summary"; m->openOutputFile(errorSummaryFileName, errorSummaryFile); diff --git a/seqsummarycommand.cpp b/seqsummarycommand.cpp index 7edb717..7da424c 100644 --- a/seqsummarycommand.cpp +++ b/seqsummarycommand.cpp @@ -25,8 +25,7 @@ vector SeqSummaryCommand::getValidParameters(){ //********************************************************************************************************************** SeqSummaryCommand::SeqSummaryCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["summary"] = tempOutNames; } @@ -62,10 +61,10 @@ vector SeqSummaryCommand::getRequiredFiles(){ SeqSummaryCommand::SeqSummaryCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -148,7 +147,7 @@ SeqSummaryCommand::~SeqSummaryCommand(){ /* do nothing */ } int SeqSummaryCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } string summaryFile = outputDir + m->getSimpleName(fastafile) + ".summary"; diff --git a/setdircommand.cpp b/setdircommand.cpp index 214bd17..a76db24 100644 --- a/setdircommand.cpp +++ b/setdircommand.cpp @@ -47,10 +47,10 @@ vector SetDirectoryCommand::getRequiredFiles(){ SetDirectoryCommand::SetDirectoryCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -117,7 +117,7 @@ SetDirectoryCommand::~SetDirectoryCommand(){} int SetDirectoryCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } commandFactory = CommandFactory::getInstance(); diff --git a/setdircommand.h b/setdircommand.h index 1afab07..6263c5e 100644 --- a/setdircommand.h +++ b/setdircommand.h @@ -20,7 +20,7 @@ class SetDirectoryCommand : public Command { public: SetDirectoryCommand(string); - SetDirectoryCommand() {} + SetDirectoryCommand() { abort = true; calledHelp = true; } ~SetDirectoryCommand(); vector getRequiredParameters(); vector getValidParameters(); diff --git a/setlogfilecommand.cpp b/setlogfilecommand.cpp index b99b833..f57dfaf 100644 --- a/setlogfilecommand.cpp +++ b/setlogfilecommand.cpp @@ -48,10 +48,10 @@ vector SetLogFileCommand::getRequiredFiles(){ SetLogFileCommand::SetLogFileCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -103,7 +103,7 @@ SetLogFileCommand::~SetLogFileCommand(){} int SetLogFileCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } commandFactory = CommandFactory::getInstance(); diff --git a/setlogfilecommand.h b/setlogfilecommand.h index d2b5c3d..e0555d0 100644 --- a/setlogfilecommand.h +++ b/setlogfilecommand.h @@ -19,7 +19,7 @@ class SetLogFileCommand : public Command { public: SetLogFileCommand(string); - SetLogFileCommand() {} + SetLogFileCommand() { abort = true; calledHelp = true; } ~SetLogFileCommand(); vector getRequiredParameters(); vector getValidParameters(); diff --git a/sffinfocommand.cpp b/sffinfocommand.cpp index c9bc469..4a9271c 100644 --- a/sffinfocommand.cpp +++ b/sffinfocommand.cpp @@ -25,8 +25,7 @@ vector SffInfoCommand::getValidParameters(){ //********************************************************************************************************************** SffInfoCommand::SffInfoCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["flow"] = tempOutNames; @@ -65,11 +64,11 @@ vector SffInfoCommand::getRequiredFiles(){ SffInfoCommand::SffInfoCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; hasAccnos = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -279,7 +278,7 @@ SffInfoCommand::~SffInfoCommand(){} int SffInfoCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } for (int s = 0; s < filenames.size(); s++) { diff --git a/sharedcommand.cpp b/sharedcommand.cpp index c252b4f..ec6b1d3 100644 --- a/sharedcommand.cpp +++ b/sharedcommand.cpp @@ -27,7 +27,7 @@ vector SharedCommand::getValidParameters(){ //********************************************************************************************************************** SharedCommand::SharedCommand(){ try { - + //initialize outputTypes vector tempOutNames; outputTypes["rabund"] = tempOutNames; diff --git a/shhhercommand.cpp b/shhhercommand.cpp index ffddb8c..e2f2636 100644 --- a/shhhercommand.cpp +++ b/shhhercommand.cpp @@ -48,7 +48,7 @@ vector ShhherCommand::getValidParameters(){ ShhherCommand::ShhherCommand(){ try { - abort = true; + abort = true; calledHelp = true; //initialize outputTypes vector tempOutNames; @@ -101,11 +101,11 @@ ShhherCommand::ShhherCommand(string option) { #endif - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { @@ -237,6 +237,8 @@ void ShhherCommand::help(){ #ifdef USE_MPI int ShhherCommand::execute(){ try { + if (abort == true) { if (calledHelp) { return 0; } return 2; } + int tag = 1976; MPI_Status status; diff --git a/splitabundcommand.cpp b/splitabundcommand.cpp index a8ca812..d0f925e 100644 --- a/splitabundcommand.cpp +++ b/splitabundcommand.cpp @@ -24,8 +24,7 @@ vector SplitAbundCommand::getValidParameters(){ //********************************************************************************************************************** SplitAbundCommand::SplitAbundCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["list"] = tempOutNames; outputTypes["name"] = tempOutNames; @@ -64,11 +63,11 @@ vector SplitAbundCommand::getRequiredFiles(){ //********************************************************************************************************************** SplitAbundCommand::SplitAbundCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; allLines = 1; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -233,7 +232,7 @@ SplitAbundCommand::~SplitAbundCommand(){ int SplitAbundCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } if (listfile != "") { //you are using a listfile to determine abundance if (outputDir == "") { outputDir = m->hasPath(listfile); } diff --git a/splitgroupscommand.cpp b/splitgroupscommand.cpp index 3fa7d04..d389d89 100644 --- a/splitgroupscommand.cpp +++ b/splitgroupscommand.cpp @@ -48,8 +48,7 @@ vector SplitGroupCommand::getRequiredFiles(){ //********************************************************************************************************************** SplitGroupCommand::SplitGroupCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["name"] = tempOutNames; @@ -62,10 +61,10 @@ SplitGroupCommand::SplitGroupCommand(){ //********************************************************************************************************************** SplitGroupCommand::SplitGroupCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -171,7 +170,7 @@ SplitGroupCommand::~SplitGroupCommand(){ } int SplitGroupCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } groupMap = new GroupMap(groupfile); groupMap->readMap(); diff --git a/subsamplecommand.cpp b/subsamplecommand.cpp index 2a3d138..6b0e4f9 100644 --- a/subsamplecommand.cpp +++ b/subsamplecommand.cpp @@ -25,8 +25,7 @@ vector SubSampleCommand::getValidParameters(){ //********************************************************************************************************************** SubSampleCommand::SubSampleCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["shared"] = tempOutNames; outputTypes["list"] = tempOutNames; @@ -68,12 +67,12 @@ vector SubSampleCommand::getRequiredFiles(){ SubSampleCommand::SubSampleCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -279,7 +278,7 @@ SubSampleCommand::~SubSampleCommand(){} int SubSampleCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } if (sharedfile != "") { getSubSampleShared(); } if (m->control_pressed) { for (int i = 0; i < outputNames.size(); i++) { remove(outputNames[i].c_str()); return 0; } } diff --git a/summarycommand.cpp b/summarycommand.cpp index e67659f..fbe7964 100644 --- a/summarycommand.cpp +++ b/summarycommand.cpp @@ -49,8 +49,7 @@ vector SummaryCommand::getValidParameters(){ //********************************************************************************************************************** SummaryCommand::SummaryCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["summary"] = tempOutNames; } @@ -87,13 +86,13 @@ vector SummaryCommand::getRequiredFiles(){ SummaryCommand::SummaryCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); Estimators.clear(); //allow user to run help - if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; } + if(option == "help") { validCalculator = new ValidCalculators(); help(); delete validCalculator; abort = true; calledHelp = true; } else { //valid paramters for this command @@ -194,7 +193,7 @@ SummaryCommand::~SummaryCommand(){} int SummaryCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } string hadShared = ""; if ((globaldata->getFormat() != "sharedfile")) { inputFileNames.push_back(globaldata->inputFileName); } diff --git a/summarysharedcommand.cpp b/summarysharedcommand.cpp index 1211ea9..b521444 100644 --- a/summarysharedcommand.cpp +++ b/summarysharedcommand.cpp @@ -65,8 +65,7 @@ vector SummarySharedCommand::getValidParameters(){ //********************************************************************************************************************** SummarySharedCommand::SummarySharedCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["summary"] = tempOutNames; } @@ -103,13 +102,13 @@ vector SummarySharedCommand::getRequiredFiles(){ SummarySharedCommand::SummarySharedCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); Estimators.clear(); //allow user to run help - if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; } + if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -317,7 +316,7 @@ SummarySharedCommand::~SummarySharedCommand(){ int SummarySharedCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } ofstream outputFileHandle, outAll; string outputFileName = outputDir + m->getRootName(m->getSimpleName(globaldata->inputFileName)) + "shared.summary"; diff --git a/systemcommand.cpp b/systemcommand.cpp index fb250d7..abc07d0 100644 --- a/systemcommand.cpp +++ b/systemcommand.cpp @@ -46,10 +46,10 @@ vector SystemCommand::getRequiredFiles(){ SystemCommand::SystemCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { if (option == "") { m->mothurOut("You must enter a command to run."); m->mothurOutEndLine(); abort = true; } @@ -92,7 +92,7 @@ void SystemCommand::help(){ int SystemCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } system(command.c_str()); diff --git a/systemcommand.h b/systemcommand.h index 3b48642..55b772b 100644 --- a/systemcommand.h +++ b/systemcommand.h @@ -18,7 +18,7 @@ class SystemCommand : public Command { public: SystemCommand(string); - SystemCommand() {} + SystemCommand() { abort = true; calledHelp = true; } ~SystemCommand(){} vector getRequiredParameters(); vector getValidParameters(); diff --git a/treegroupscommand.cpp b/treegroupscommand.cpp index adf140a..a31c151 100644 --- a/treegroupscommand.cpp +++ b/treegroupscommand.cpp @@ -65,7 +65,7 @@ vector TreeGroupCommand::getValidParameters(){ //********************************************************************************************************************** TreeGroupCommand::TreeGroupCommand(){ try { - abort = true; + abort = true; calledHelp = true; globaldata = GlobalData::getInstance(); //initialize outputTypes vector tempOutNames; @@ -104,14 +104,14 @@ vector TreeGroupCommand::getRequiredFiles(){ TreeGroupCommand::TreeGroupCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); Groups.clear(); Estimators.clear(); //allow user to run help - if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; } + if(option == "help") { validCalculator = new ValidCalculators(); help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -380,7 +380,7 @@ TreeGroupCommand::~TreeGroupCommand(){ int TreeGroupCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } if (format == "sharedfile") { //if the users entered no valid calculators don't execute command diff --git a/trimflowscommand.cpp b/trimflowscommand.cpp index e4d0165..5c5d28b 100644 --- a/trimflowscommand.cpp +++ b/trimflowscommand.cpp @@ -65,8 +65,7 @@ vector TrimFlowsCommand::getRequiredFiles(){ TrimFlowsCommand::TrimFlowsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["flow"] = tempOutNames; outputTypes["fasta"] = tempOutNames; @@ -101,11 +100,11 @@ void TrimFlowsCommand::help(){ TrimFlowsCommand::TrimFlowsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; comboStarts = 0; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -250,7 +249,7 @@ TrimFlowsCommand::TrimFlowsCommand(string option) { int TrimFlowsCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } string trimFlowFileName = outputDir + m->getRootName(m->getSimpleName(flowFileName)) + "trim.flow"; outputNames.push_back(trimFlowFileName); outputTypes["flow"].push_back(trimFlowFileName); diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index 7267b91..45de8d6 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -31,8 +31,7 @@ vector TrimSeqsCommand::getValidParameters(){ TrimSeqsCommand::TrimSeqsCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["qual"] = tempOutNames; @@ -76,11 +75,11 @@ vector TrimSeqsCommand::getRequiredFiles(){ TrimSeqsCommand::TrimSeqsCommand(string option) { try { - abort = false; + abort = false; calledHelp = false; comboStarts = 0; //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -316,7 +315,7 @@ TrimSeqsCommand::~TrimSeqsCommand(){ /* do nothing */ } int TrimSeqsCommand::execute(){ try{ - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } numFPrimers = 0; //this needs to be initialized numRPrimers = 0; diff --git a/unifracunweightedcommand.cpp b/unifracunweightedcommand.cpp index 79ee042..ccd5aa4 100644 --- a/unifracunweightedcommand.cpp +++ b/unifracunweightedcommand.cpp @@ -25,8 +25,7 @@ vector UnifracUnweightedCommand::getValidParameters(){ UnifracUnweightedCommand::UnifracUnweightedCommand(){ try { globaldata = GlobalData::getInstance(); - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["unweighted"] = tempOutNames; outputTypes["uwsummary"] = tempOutNames; @@ -66,11 +65,11 @@ vector UnifracUnweightedCommand::getRequiredFiles(){ UnifracUnweightedCommand::UnifracUnweightedCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; Groups.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -191,7 +190,7 @@ void UnifracUnweightedCommand::help(){ int UnifracUnweightedCommand::execute() { try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } int start = time(NULL); diff --git a/unifracweightedcommand.cpp b/unifracweightedcommand.cpp index bee10cb..8745a89 100644 --- a/unifracweightedcommand.cpp +++ b/unifracweightedcommand.cpp @@ -24,8 +24,7 @@ vector UnifracWeightedCommand::getValidParameters(){ //********************************************************************************************************************** UnifracWeightedCommand::UnifracWeightedCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["weighted"] = tempOutNames; outputTypes["wsummary"] = tempOutNames; @@ -65,11 +64,11 @@ vector UnifracWeightedCommand::getRequiredFiles(){ UnifracWeightedCommand::UnifracWeightedCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; Groups.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -181,7 +180,7 @@ void UnifracWeightedCommand::help(){ int UnifracWeightedCommand::execute() { try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } int start = time(NULL); diff --git a/venncommand.cpp b/venncommand.cpp index 7601ed8..5cc0fea 100644 --- a/venncommand.cpp +++ b/venncommand.cpp @@ -33,8 +33,7 @@ vector VennCommand::getValidParameters(){ //********************************************************************************************************************** VennCommand::VennCommand(){ try { - abort = true; - //initialize outputTypes + abort = true; calledHelp = true; vector tempOutNames; outputTypes["svg"] = tempOutNames; } @@ -71,12 +70,12 @@ vector VennCommand::getRequiredFiles(){ VennCommand::VennCommand(string option) { try { globaldata = GlobalData::getInstance(); - abort = false; + abort = false; calledHelp = false; allLines = 1; labels.clear(); //allow user to run help - if(option == "help") { help(); abort = true; } + if(option == "help") { help(); abort = true; calledHelp = true; } else { //valid paramters for this command @@ -243,7 +242,7 @@ VennCommand::~VennCommand(){ int VennCommand::execute(){ try { - if (abort == true) { return 0; } + if (abort == true) { if (calledHelp) { return 0; } return 2; } string lastLabel; -- 2.39.2