From 80eb270cc07e78155b82264e16cbb6bc8ade55ce Mon Sep 17 00:00:00 2001 From: westcott Date: Wed, 27 Jan 2010 21:08:49 +0000 Subject: [PATCH] fixed some bugs found while testing 1.8 --- ccode.cpp | 4 ++-- ccode.h | 2 +- chimeraseqscommand.cpp | 2 +- classifyseqscommand.cpp | 1 - commandfactory.cpp | 11 ++++++++--- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ccode.cpp b/ccode.cpp index a86e0fd..c474d7a 100644 --- a/ccode.cpp +++ b/ccode.cpp @@ -13,7 +13,7 @@ //*************************************************************************************************************** -Ccode::Ccode(string filename, string temp) { fastafile = filename; templateFile = temp; } +Ccode::Ccode(string filename, string temp, string o) { fastafile = filename; templateFile = temp; outputDir = o; } //*************************************************************************************************************** Ccode::~Ccode() { @@ -32,7 +32,7 @@ void Ccode::print(ostream& out) { mothurOutEndLine(); - string mapInfo = getRootName(fastafile) + "mapinfo"; + string mapInfo = outputDir + getRootName(getSimpleName(fastafile)) + "mapinfo"; ofstream out2; openOutputFile(mapInfo, out2); diff --git a/ccode.h b/ccode.h index 0ea2753..52592f9 100644 --- a/ccode.h +++ b/ccode.h @@ -24,7 +24,7 @@ class Ccode : public Chimera { public: - Ccode(string, string); + Ccode(string, string, string); ~Ccode(); int getChimeras(); diff --git a/chimeraseqscommand.cpp b/chimeraseqscommand.cpp index 63d02f5..4941488 100644 --- a/chimeraseqscommand.cpp +++ b/chimeraseqscommand.cpp @@ -254,7 +254,7 @@ int ChimeraSeqsCommand::execute(){ if (method == "bellerophon") { chimera = new Bellerophon(fastafile, outputDir); } else if (method == "pintail") { chimera = new Pintail(fastafile, templatefile, outputDir); } - else if (method == "ccode") { chimera = new Ccode(fastafile, templatefile); } + else if (method == "ccode") { chimera = new Ccode(fastafile, templatefile, outputDir); } else if (method == "chimeracheck") { chimera = new ChimeraCheckRDP(fastafile, templatefile, outputDir); } else if (method == "chimeraslayer") { chimera = new ChimeraSlayer(fastafile, templatefile); } else { mothurOut("Not a valid method."); mothurOutEndLine(); return 0; } diff --git a/classifyseqscommand.cpp b/classifyseqscommand.cpp index e6eb560..51578e3 100644 --- a/classifyseqscommand.cpp +++ b/classifyseqscommand.cpp @@ -528,7 +528,6 @@ int ClassifySeqsCommand::driver(linePair* line, string taxFName, string tempTFNa outTax << candidateSeq->getName() << '\t' << taxonomy << endl; }else{ outTax << candidateSeq->getName() << '\t' << classify->getSimpleTax() << endl; - cout << classify->getSimpleTax() << endl; } outTaxSimple << candidateSeq->getName() << '\t' << classify->getSimpleTax() << endl; diff --git a/commandfactory.cpp b/commandfactory.cpp index ddb7029..5eb4ff5 100644 --- a/commandfactory.cpp +++ b/commandfactory.cpp @@ -155,11 +155,16 @@ Command* CommandFactory::getCommand(string commandName, string optionString){ delete command; //delete the old command //user has opted to redirect output from dir where input files are located to some other place - if (outputDir != "") { optionString += ", outputdir=" + outputDir; } + if (outputDir != "") { + if (optionString != "") { optionString += ", outputdir=" + outputDir; } + else { optionString += "outputdir=" + outputDir; } + } //user has opted to redirect input from dir where mothur.exe is located to some other place - if (inputDir != "") { optionString += ", inputdir=" + inputDir; } - + if (inputDir != "") { + if (optionString != "") { optionString += ", inputdir=" + inputDir; } + else { optionString += "inputdir=" + inputDir; } + } if(commandName == "read.dist") { command = new ReadDistCommand(optionString); } else if(commandName == "read.otu") { command = new ReadOtuCommand(optionString); } -- 2.39.2