X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=commandfactory.cpp;h=2417d8dda900fe4aac1cdf0d4ebea36209c2796c;hb=f27b66ce6415eb14c434f9850019c7cf140e023e;hp=db11f8c0dc890dff846787dee0fc48ea8930384a;hpb=510b1cfc25cd79391d6973ca20c5ec25fb1bb3b2;p=mothur.git diff --git a/commandfactory.cpp b/commandfactory.cpp index db11f8c..2417d8d 100644 --- a/commandfactory.cpp +++ b/commandfactory.cpp @@ -12,7 +12,6 @@ #include "readtreecommand.h" #include "readotucommand.h" #include "clustercommand.h" -#include "parselistcommand.h" #include "collectcommand.h" #include "collectsharedcommand.h" #include "getgroupcommand.h" @@ -39,7 +38,7 @@ #include "getoturepcommand.h" #include "treegroupscommand.h" #include "bootstrapsharedcommand.h" -#include "concensuscommand.h" +//#include "consensuscommand.h" #include "distancecommand.h" #include "aligncommand.h" #include "matrixoutputcommand.h" @@ -50,11 +49,35 @@ #include "reversecommand.h" #include "trimseqscommand.h" #include "mergefilecommand.h" +#include "chimeraseqscommand.h" +#include "listseqscommand.h" +#include "getseqscommand.h" +#include "removeseqscommand.h" +#include "systemcommand.h" +#include "secondarystructurecommand.h" +#include "getsharedotucommand.h" +#include "getlistcountcommand.h" +#include "hclustercommand.h" +#include "classifyseqscommand.h" +#include "phylotypecommand.h" +#include "mgclustercommand.h" +#include "preclustercommand.h" +#include "pcacommand.h" +/*******************************************************/ + +/******************************************************/ +CommandFactory* CommandFactory::getInstance() { + if( _uniqueInstance == 0) { + _uniqueInstance = new CommandFactory(); + } + return _uniqueInstance; +} /***********************************************************/ /***********************************************************/ CommandFactory::CommandFactory(){ + _uniqueInstance = 0; string s = ""; command = new NoCommand(s); @@ -89,7 +112,7 @@ CommandFactory::CommandFactory(){ commands["get.sabund"] = "get.sabund"; commands["get.rabund"] = "get.rabund"; commands["bootstrap.shared"] = "bootstrap.shared"; - commands["concensus"] = "concensus"; + //commands["consensus"] = "consensus"; commands["help"] = "help"; commands["filter.seqs"] = "filter.seqs"; commands["align.seqs"] = "align.seqs"; @@ -97,7 +120,21 @@ CommandFactory::CommandFactory(){ commands["screen.seqs"] = "screen.seqs"; commands["reverse.seqs"] = "reverse.seqs"; commands["trim.seqs"] = "trim.seqs"; + commands["chimera.seqs"] = "chimera.seqs"; + commands["list.seqs"] = "list.seqs"; + commands["get.seqs"] = "get.seqs"; + commands["remove.seqs"] = "get.seqs"; + commands["system"] = "system"; + commands["align.check"] = "align.check"; + commands["get.sharedseqs"] = "get.sharedseqs"; + commands["get.otulist"] = "get.otulist"; commands["quit"] = "quit"; + commands["hcluster"] = "hcluster"; + commands["classify.seqs"] = "classify.seqs"; + commands["phylotype"] = "phylotype"; + commands["mgcluster"] = "mgcluster"; + commands["pre.cluster"] = "pre.cluster"; + commands["pca"] = "pca"; } /***********************************************************/ @@ -146,14 +183,28 @@ Command* CommandFactory::getCommand(string commandName, string optionString){ else if(commandName == "tree.shared") { command = new TreeGroupCommand(optionString); } else if(commandName == "dist.shared") { command = new MatrixOutputCommand(optionString); } else if(commandName == "bootstrap.shared") { command = new BootSharedCommand(optionString); } - else if(commandName == "concensus") { command = new ConcensusCommand(optionString); } + //else if(commandName == "consensus") { command = new ConcensusCommand(optionString); } else if(commandName == "dist.seqs") { command = new DistanceCommand(optionString); } else if(commandName == "align.seqs") { command = new AlignCommand(optionString); } else if(commandName == "summary.seqs") { command = new SeqSummaryCommand(optionString); } else if(commandName == "screen.seqs") { command = new ScreenSeqsCommand(optionString); } else if(commandName == "reverse.seqs") { command = new ReverseSeqsCommand(optionString); } else if(commandName == "trim.seqs") { command = new TrimSeqsCommand(optionString); } + else if(commandName == "chimera.seqs") { command = new ChimeraSeqsCommand(optionString); } + else if(commandName == "list.seqs") { command = new ListSeqsCommand(optionString); } + else if(commandName == "get.seqs") { command = new GetSeqsCommand(optionString); } + else if(commandName == "remove.seqs") { command = new RemoveSeqsCommand(optionString); } else if(commandName == "merge.files") { command = new MergeFileCommand(optionString); } + else if(commandName == "system") { command = new SystemCommand(optionString); } + else if(commandName == "align.check") { command = new AlignCheckCommand(optionString); } + else if(commandName == "get.sharedseqs") { command = new GetSharedOTUCommand(optionString); } + else if(commandName == "get.otulist") { command = new GetListCountCommand(optionString); } + else if(commandName == "hcluster") { command = new HClusterCommand(optionString); } + else if(commandName == "classify.seqs") { command = new ClassifySeqsCommand(optionString); } + else if(commandName == "phylotype") { command = new PhylotypeCommand(optionString); } + else if(commandName == "mgcluster") { command = new MGClusterCommand(optionString); } + else if(commandName == "pre.cluster") { command = new PreClusterCommand(optionString); } + else if(commandName == "pca") { command = new PCACommand(optionString); } else { command = new NoCommand(optionString); } return command; @@ -163,7 +214,22 @@ Command* CommandFactory::getCommand(string commandName, string optionString){ exit(1); } } +/***********************************************************/ +//This function is used to interrupt a command +Command* CommandFactory::getCommand(){ + try { + delete command; //delete the old command + string s = ""; + command = new NoCommand(s); + + return command; + } + catch(exception& e) { + errorOut(e, "CommandFactory", "getCommand"); + exit(1); + } +} /***********************************************************************/ bool CommandFactory::isValidCommand(string command) { try {