From: westcott Date: Mon, 25 Oct 2010 13:42:22 +0000 (+0000) Subject: testing 1.14.0 X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=commitdiff_plain;h=df41d90a9611eab75d0516e2654ed8580f8df24c testing 1.14.0 --- diff --git a/aligncommand.cpp b/aligncommand.cpp index 7b5365a..8a229e3 100644 --- a/aligncommand.cpp +++ b/aligncommand.cpp @@ -153,15 +153,17 @@ AlignCommand::AlignCommand(string option) { int ableToOpen; ifstream in; - ableToOpen = m->openInputFile(candidateFileNames[i], in, "noerror"); - + in.close(); + //if you can't open it, try default location if (ableToOpen == 1) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(candidateFileNames[i]); m->mothurOut("Unable to open " + candidateFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); candidateFileNames[i] = tryPath; } } @@ -171,12 +173,14 @@ AlignCommand::AlignCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(candidateFileNames[i]); m->mothurOut("Unable to open " + candidateFileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); candidateFileNames[i] = tryPath; } } - in.close(); + if (ableToOpen == 1) { m->mothurOut("Unable to open " + candidateFileNames[i] + ". It will be disregarded."); m->mothurOutEndLine(); diff --git a/chimerabellerophoncommand.cpp b/chimerabellerophoncommand.cpp index 6d0a116..d3c8ea5 100644 --- a/chimerabellerophoncommand.cpp +++ b/chimerabellerophoncommand.cpp @@ -114,7 +114,9 @@ ChimeraBellerophonCommand::ChimeraBellerophonCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } @@ -124,7 +126,9 @@ ChimeraBellerophonCommand::ChimeraBellerophonCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } diff --git a/chimeraccodecommand.cpp b/chimeraccodecommand.cpp index 1f6a5a5..5f90a08 100644 --- a/chimeraccodecommand.cpp +++ b/chimeraccodecommand.cpp @@ -125,7 +125,9 @@ ChimeraCcodeCommand::ChimeraCcodeCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } @@ -135,7 +137,9 @@ ChimeraCcodeCommand::ChimeraCcodeCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } diff --git a/chimeracheckcommand.cpp b/chimeracheckcommand.cpp index 2591460..b3f49a4 100644 --- a/chimeracheckcommand.cpp +++ b/chimeracheckcommand.cpp @@ -119,7 +119,9 @@ ChimeraCheckCommand::ChimeraCheckCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } @@ -129,7 +131,9 @@ ChimeraCheckCommand::ChimeraCheckCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } @@ -178,7 +182,9 @@ ChimeraCheckCommand::ChimeraCheckCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(nameFileNames[i]); m->mothurOut("Unable to open " + nameFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); nameFileNames[i] = tryPath; } } @@ -188,7 +194,9 @@ ChimeraCheckCommand::ChimeraCheckCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(nameFileNames[i]); m->mothurOut("Unable to open " + nameFileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); nameFileNames[i] = tryPath; } } diff --git a/chimerapintailcommand.cpp b/chimerapintailcommand.cpp index 2dccd49..b355f6d 100644 --- a/chimerapintailcommand.cpp +++ b/chimerapintailcommand.cpp @@ -140,7 +140,9 @@ ChimeraPintailCommand::ChimeraPintailCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } @@ -149,7 +151,9 @@ ChimeraPintailCommand::ChimeraPintailCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } @@ -196,7 +200,9 @@ ChimeraPintailCommand::ChimeraPintailCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(maskfile); m->mothurOut("Unable to open " + maskfile + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); maskfile = tryPath; } } @@ -205,7 +211,9 @@ ChimeraPintailCommand::ChimeraPintailCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(maskfile); m->mothurOut("Unable to open " + maskfile + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); maskfile = tryPath; } } diff --git a/chimeraslayercommand.cpp b/chimeraslayercommand.cpp index 2172369..dbdd4a9 100644 --- a/chimeraslayercommand.cpp +++ b/chimeraslayercommand.cpp @@ -126,7 +126,9 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } @@ -135,7 +137,9 @@ ChimeraSlayerCommand::ChimeraSlayerCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } diff --git a/classifyseqscommand.cpp b/classifyseqscommand.cpp index 9f05eda..302c4f7 100644 --- a/classifyseqscommand.cpp +++ b/classifyseqscommand.cpp @@ -161,7 +161,9 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } @@ -170,7 +172,9 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } @@ -223,7 +227,9 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(namefileNames[i]); m->mothurOut("Unable to open " + namefileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); namefileNames[i] = tryPath; } } @@ -232,7 +238,9 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(namefileNames[i]); m->mothurOut("Unable to open " + namefileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); namefileNames[i] = tryPath; } } @@ -274,7 +282,9 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(groupfileNames[i]); m->mothurOut("Unable to open " + groupfileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); groupfileNames[i] = tryPath; } } @@ -283,7 +293,9 @@ ClassifySeqsCommand::ClassifySeqsCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(groupfileNames[i]); m->mothurOut("Unable to open " + groupfileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); groupfileNames[i] = tryPath; } } diff --git a/degapseqscommand.cpp b/degapseqscommand.cpp index 290d5dc..f1190c8 100644 --- a/degapseqscommand.cpp +++ b/degapseqscommand.cpp @@ -112,7 +112,9 @@ DegapSeqsCommand::DegapSeqsCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } @@ -122,7 +124,9 @@ DegapSeqsCommand::DegapSeqsCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } diff --git a/filterseqscommand.cpp b/filterseqscommand.cpp index c463cd2..1d9ee27 100644 --- a/filterseqscommand.cpp +++ b/filterseqscommand.cpp @@ -132,7 +132,9 @@ FilterSeqsCommand::FilterSeqsCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(fastafileNames[i]); m->mothurOut("Unable to open " + fastafileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastafileNames[i] = tryPath; } } @@ -142,7 +144,9 @@ FilterSeqsCommand::FilterSeqsCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(fastafileNames[i]); m->mothurOut("Unable to open " + fastafileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastafileNames[i] = tryPath; } } diff --git a/getlineagecommand.cpp b/getlineagecommand.cpp index a1d4485..91811fa 100644 --- a/getlineagecommand.cpp +++ b/getlineagecommand.cpp @@ -44,7 +44,7 @@ GetLineageCommand::GetLineageCommand(){ //********************************************************************************************************************** vector GetLineageCommand::getRequiredParameters(){ try { - string Array[] = {"taxonomy"}; + string Array[] = {"taxonomy","taxon"}; vector myArray (Array, Array+(sizeof(Array)/sizeof(string))); return myArray; } diff --git a/makefile b/makefile index a5c40be..4e05718 100644 --- a/makefile +++ b/makefile @@ -30,8 +30,8 @@ endif MOTHUR_FILES = "\"../Release\"" -RELEASE_DATE = "\"9/17/2010\"" -VERSION = "\"1.13.0\"" +RELEASE_DATE = "\"10/22/2010\"" +VERSION = "\"1.14.0\"" CXXFLAGS += -DRELEASE_DATE=${RELEASE_DATE} -DVERSION=${VERSION} diff --git a/makegroupcommand.cpp b/makegroupcommand.cpp index fd68b80..611f00f 100644 --- a/makegroupcommand.cpp +++ b/makegroupcommand.cpp @@ -115,7 +115,9 @@ MakeGroupCommand::MakeGroupCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } @@ -125,7 +127,9 @@ MakeGroupCommand::MakeGroupCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } diff --git a/metastats2.c b/metastats2.c index b22938a..bbea3ce 100644 --- a/metastats2.c +++ b/metastats2.c @@ -409,11 +409,11 @@ void permute_array(int *array, int n) { if (! seeded) { seeded = 1; - srandom(time(NULL)); + srand(time(NULL)); } for (i = 0; i < n; i++) { - int selection = random() % (n - i); + int selection = rand() % (n - i); int tmp = array[i + selection]; array[i + selection] = array[i]; array[i] = tmp; diff --git a/metastatscommand.cpp b/metastatscommand.cpp index 08c94ba..f0496b2 100644 --- a/metastatscommand.cpp +++ b/metastatscommand.cpp @@ -118,7 +118,7 @@ MetaStatsCommand::MetaStatsCommand(string option) { //make sure the user has already run the read.otu command if ((globaldata->getSharedFile() == "")) { - m->mothurOut("You must read a list and a group, or a shared file before you can use the normalize.shared command."); m->mothurOutEndLine(); abort = true; + m->mothurOut("You must read a list and a group, or a shared file before you can use the metastats command."); m->mothurOutEndLine(); abort = true; } //check for optional parameter and set defaults diff --git a/mothur b/mothur index f379751..a609d20 100755 Binary files a/mothur and b/mothur differ diff --git a/normalizesharedcommand.cpp b/normalizesharedcommand.cpp index dc5ed19..8fc5d30 100644 --- a/normalizesharedcommand.cpp +++ b/normalizesharedcommand.cpp @@ -151,7 +151,7 @@ void NormalizeSharedCommand::help(){ m->mothurOut("The method parameter allows you to select what method you would like to use to normalize. The only choice is totalgroup. We hope to add more ways to normalize in the future, suggestions are welcome!\n"); m->mothurOut("The norm parameter allows you to number you would like to normalize to. By default this is set to the number of sequences in your smallest group.\n"); m->mothurOut("The normalize.shared command should be in the following format: normalize.shared(groups=yourGroups, label=yourLabels).\n"); - m->mothurOut("Example normalize.shared(groups=A-B-C, scale=averagegroup).\n"); + m->mothurOut("Example normalize.shared(groups=A-B-C, scale=totalgroup).\n"); m->mothurOut("The default value for groups is all the groups in your groupfile, and all labels in your inputfile will be used.\n"); m->mothurOut("The normalize.shared command outputs a .norm.shared file.\n"); m->mothurOut("Note: No spaces between parameter labels (i.e. groups), '=' and parameters (i.e.yourGroups).\n\n"); diff --git a/pairwiseseqscommand.cpp b/pairwiseseqscommand.cpp index 560d54d..733c470 100644 --- a/pairwiseseqscommand.cpp +++ b/pairwiseseqscommand.cpp @@ -134,7 +134,9 @@ PairwiseSeqsCommand::PairwiseSeqsCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } @@ -144,7 +146,9 @@ PairwiseSeqsCommand::PairwiseSeqsCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(fastaFileNames[i]); m->mothurOut("Unable to open " + fastaFileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); fastaFileNames[i] = tryPath; } } diff --git a/pipelinepdscommand.cpp b/pipelinepdscommand.cpp index 22f5a97..691d35d 100644 --- a/pipelinepdscommand.cpp +++ b/pipelinepdscommand.cpp @@ -536,18 +536,23 @@ bool PipelineCommand::fillInMothurMade(string& options, mapfirst; + if (it->second == "mothurmade") { - itMade = mothurMadeFiles.find(it->first); + + if (it->first == "candidate") { paraType = "fasta"; } + + itMade = mothurMadeFiles.find(paraType); if (itMade == mothurMadeFiles.end()) { - m->mothurOut("Looking for a mothurmade " + it->first + " file, but it seems mothur has not made that file type in your current pipeline, please correct."); m->mothurOutEndLine(); + m->mothurOut("Looking for a mothurmade " + paraType + " file, but it seems mothur has not made that file type in your current pipeline, please correct."); m->mothurOutEndLine(); return true; }else{ vector temp = itMade->second; if (temp.size() > 1) { //ask user which file to use - m->mothurOut("More than one file has been created for the " + it->first + " parameter. "); m->mothurOutEndLine(); + m->mothurOut("More than one file has been created for the " + paraType + " parameter. "); m->mothurOutEndLine(); for (int i = 0; i < temp.size(); i++) { m->mothurOut(toString(i) + " - " + temp[i]); m->mothurOutEndLine(); } @@ -558,7 +563,7 @@ bool PipelineCommand::fillInMothurMade(string& options, map (temp.size()-1))) { m->mothurOut("Not a valid response, quitting."); m->mothurOutEndLine(); return true; } else { - parameters[it->first] = temp[num]; + parameters[paraType] = temp[num]; } //clears buffer so next command doesn't have error @@ -566,15 +571,15 @@ bool PipelineCommand::fillInMothurMade(string& options, mapmothurOut("Sorry, we seem to think you created a " + it->first + " file, but it seems mothur doesn't have a filename."); m->mothurOutEndLine(); + m->mothurOut("Sorry, we seem to think you created a " + paraType + " file, but it seems mothur doesn't have a filename."); m->mothurOutEndLine(); return true; }else{ - parameters[it->first] = temp[0]; + parameters[paraType] = temp[0]; } } } - options += it->first + "=" + parameters[it->first] + ", "; + options += it->first + "=" + parameters[paraType] + ", "; } //rip off extra comma @@ -594,13 +599,13 @@ void PipelineCommand::createPatsPipeline(){ //sff.info command string thisCommand = "sffinfo(sff=" + sffFile + ")"; - //commands.push_back(thisCommand); + commands.push_back(thisCommand); //trim.seqs command string fastaFile = m->getRootName(m->getSimpleName(sffFile)) + "fasta"; string qualFile = m->getRootName(m->getSimpleName(sffFile)) + "qual"; - //thisCommand = "trim.seqs(processors=" + toString(processors) + ", fasta=" + fastaFile + ", allfiles=T, maxambig=0, maxhomop=8, flip=T, bdiffs=1, pdiffs=2, qwindowaverage=35, qwindowsize=50, oligos=" + oligosFile + ", qfile=" + qualFile + ")"; - //commands.push_back(thisCommand); + thisCommand = "trim.seqs(processors=" + toString(processors) + ", fasta=" + fastaFile + ", allfiles=T, maxambig=0, maxhomop=8, flip=T, bdiffs=1, pdiffs=2, qwindowaverage=35, qwindowsize=50, oligos=" + oligosFile + ", qfile=" + qualFile + ")"; + commands.push_back(thisCommand); //unique.seqs string groupFile = m->getRootName(m->getSimpleName(fastaFile)) + "groups"; diff --git a/removelineagecommand.cpp b/removelineagecommand.cpp index 557622d..629416a 100644 --- a/removelineagecommand.cpp +++ b/removelineagecommand.cpp @@ -297,7 +297,7 @@ int RemoveLineageCommand::readFasta(){ out.close(); if (wroteSomething == false) { m->mothurOut("Your fasta file contains only sequences from " + taxons + "."); m->mothurOutEndLine(); } - outputTypes["fasta"].push_back(outputFileName); + outputNames.push_back(outputFileName); outputTypes["fasta"].push_back(outputFileName); return 0; @@ -368,7 +368,7 @@ int RemoveLineageCommand::readList(){ out.close(); if (wroteSomething == false) { m->mothurOut("Your list file contains only sequences from " + taxons + "."); m->mothurOutEndLine(); } - outputTypes["list"].push_back(outputFileName); + outputNames.push_back(outputFileName); outputTypes["list"].push_back(outputFileName); return 0; @@ -454,7 +454,7 @@ int RemoveLineageCommand::readName(){ out.close(); if (wroteSomething == false) { m->mothurOut("Your name file contains only sequences from " + taxons + "."); m->mothurOutEndLine(); } - outputTypes["name"].push_back(outputFileName); + outputNames.push_back(outputFileName); outputTypes["name"].push_back(outputFileName); return 0; } @@ -498,7 +498,7 @@ int RemoveLineageCommand::readGroup(){ out.close(); if (wroteSomething == false) { m->mothurOut("Your group file contains only sequences from " + taxons + "."); m->mothurOutEndLine(); } - outputTypes["group"].push_back(outputFileName); + outputNames.push_back(outputFileName); outputTypes["group"].push_back(outputFileName); return 0; } @@ -552,7 +552,7 @@ int RemoveLineageCommand::readTax(){ out.close(); if (!wroteSomething) { m->mothurOut("Your taxonomy file contains only sequences from " + taxons + "."); m->mothurOutEndLine(); } - outputTypes["taxonomy"].push_back(outputFileName); + outputNames.push_back(outputFileName); outputTypes["taxonomy"].push_back(outputFileName); return 0; @@ -642,7 +642,7 @@ int RemoveLineageCommand::readAlign(){ out.close(); if (wroteSomething == false) { m->mothurOut("Your align file contains only sequences from " + taxons + "."); m->mothurOutEndLine(); } - outputTypes["alignreport"].push_back(outputFileName); + outputNames.push_back(outputFileName); outputTypes["alignreport"].push_back(outputFileName); return 0; diff --git a/sffinfocommand.cpp b/sffinfocommand.cpp index e51f7f2..1175446 100644 --- a/sffinfocommand.cpp +++ b/sffinfocommand.cpp @@ -118,7 +118,9 @@ SffInfoCommand::SffInfoCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(filenames[i]); m->mothurOut("Unable to open " + filenames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); filenames[i] = tryPath; } } @@ -128,7 +130,9 @@ SffInfoCommand::SffInfoCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(filenames[i]); m->mothurOut("Unable to open " + filenames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); filenames[i] = tryPath; } } @@ -169,7 +173,9 @@ SffInfoCommand::SffInfoCommand(string option) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(accnosFileNames[i]); m->mothurOut("Unable to open " + accnosFileNames[i] + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); accnosFileNames[i] = tryPath; } } @@ -178,7 +184,9 @@ SffInfoCommand::SffInfoCommand(string option) { if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(accnosFileNames[i]); m->mothurOut("Unable to open " + accnosFileNames[i] + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); accnosFileNames[i] = tryPath; } } diff --git a/validparameter.cpp b/validparameter.cpp index cfe9d50..4b263b4 100644 --- a/validparameter.cpp +++ b/validparameter.cpp @@ -214,7 +214,7 @@ bool ValidParameters::isValidParameter(string parameter, vector cParams, string ValidParameters::validFile(map& container, string parameter, bool isFile) { try { int ableToOpen; - ifstream in; + map::iterator it; it = container.find(parameter); @@ -232,15 +232,18 @@ string ValidParameters::validFile(map& container, string paramet if (pid == 0) { #endif - + ifstream in; ableToOpen = m->openInputFile(it->second, in, "noerror"); + in.close(); //if you can't open it, try default location if (ableToOpen == 1) { if (m->getDefaultPath() != "") { //default path is set string tryPath = m->getDefaultPath() + m->getSimpleName(it->second); m->mothurOut("Unable to open " + it->second + ". Trying default " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); + in2.close(); container[parameter] = tryPath; } } @@ -250,12 +253,14 @@ string ValidParameters::validFile(map& container, string paramet if (m->getOutputDir() != "") { //default path is set string tryPath = m->getOutputDir() + m->getSimpleName(it->second); m->mothurOut("Unable to open " + it->second + ". Trying output directory " + tryPath); m->mothurOutEndLine(); - ableToOpen = m->openInputFile(tryPath, in, "noerror"); + ifstream in2; + ableToOpen = m->openInputFile(tryPath, in2, "noerror"); container[parameter] = tryPath; + in2.close(); } } - in.close(); + #ifdef USE_MPI for(int i = 1; i < processors; i++) {