]> git.donarmstrong.com Git - mothur.git/commitdiff
testing 1.14.0
authorwestcott <westcott>
Mon, 25 Oct 2010 13:42:22 +0000 (13:42 +0000)
committerwestcott <westcott>
Mon, 25 Oct 2010 13:42:22 +0000 (13:42 +0000)
21 files changed:
aligncommand.cpp
chimerabellerophoncommand.cpp
chimeraccodecommand.cpp
chimeracheckcommand.cpp
chimerapintailcommand.cpp
chimeraslayercommand.cpp
classifyseqscommand.cpp
degapseqscommand.cpp
filterseqscommand.cpp
getlineagecommand.cpp
makefile
makegroupcommand.cpp
metastats2.c
metastatscommand.cpp
mothur
normalizesharedcommand.cpp
pairwiseseqscommand.cpp
pipelinepdscommand.cpp
removelineagecommand.cpp
sffinfocommand.cpp
validparameter.cpp

index 7b5365afea037928019e0f94a9ce44d42cfc370a..8a229e3cade2cff57569e16b0e4b682d8dd0be65 100644 (file)
@@ -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(); 
index 6d0a116ac4d0d5d1bb2b8cf97f1ea5a1b5126fef..d3c8ea562ea314a6056409671defb41d15f3e834 100644 (file)
@@ -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;
                                                }
                                        }
index 1f6a5a56a8ee7398a8f1b0b454986c28c1483fe7..5f90a084be41767698fb2b231fca4e13deca2942 100644 (file)
@@ -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;
                                                }
                                        }
index 2591460a5ddd0bdcbe958bddc5ccf5ce9e644c7e..b3f49a4916056a3b9e9ddb881f041513507c49d2 100644 (file)
@@ -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;
                                                }
                                        }
index 2dccd498f6dd2e5fdf82a9b12665aaf7a523ad90..b355f6da6ac5839a054d4503e4dbb4f43237c23a 100644 (file)
@@ -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;
                                                }
                                }
index 2172369e70d38915ab6a3831f0ab53e4a34f759d..dbdd4a9eeca506fab01005f2cf752452beb8310a 100644 (file)
@@ -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;
                                                }
                                        }
index 9f05eda2704c179ca3eb4f120d83862aeb4eb6e4..302c4f790c0f514e80e001488bde403f941b2c1f 100644 (file)
@@ -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;
                                                }
                                        }
index 290d5dc0996a62783ab3365513f7441b1aafd717..f1190c84ad58a73b66b3423cbf2d10cee907bb93 100644 (file)
@@ -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;
                                                }
                                        }
index c463cd294d04dcdc31e1a6891db1659db45dc05e..1d9ee277a9e83802e3533a949e402e59ea4adbde 100644 (file)
@@ -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;
                                                }
                                        }
index a1d44857531ddea86b025ac1b6d0d888f21df702..91811fa4687202378585457d0087c2c5db973c52 100644 (file)
@@ -44,7 +44,7 @@ GetLineageCommand::GetLineageCommand(){
 //**********************************************************************************************************************
 vector<string> GetLineageCommand::getRequiredParameters(){     
        try {
-               string Array[] =  {"taxonomy"};
+               string Array[] =  {"taxonomy","taxon"};
                vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
                return myArray;
        }
index a5c40be3dd5df280bc6dad68eeef5eff97b54ace..4e0571804d1d88598867f89f5f55ae09167121e0 100644 (file)
--- 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}
 
index fd68b8022c610557402d03a1ab970901939c9126..611f00f8cd54a942d6646eda9cc776933d44742b 100644 (file)
@@ -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;
                                                }
                                        }
index b22938af69282857aa354c4e55ec2c30a4921d8f..bbea3ce8deacf3debe2b6f5adfc909e944862345 100644 (file)
@@ -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;
index 08c94ba3261c47c33d13368d9fbd84718cb5f3a2..f0496b2f1f49198b813247e4d10297504e426ae1 100644 (file)
@@ -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 f37975196cb7c97ddceba444a673523162a7f3fa..a609d20980d33ea8c7c66e0e3de5c294e133174c 100755 (executable)
Binary files a/mothur and b/mothur differ
index dc5ed196b4df8eff111954dbab106b1439f7a20c..8fc5d3058966d896c8dbfc861591c5bbbb72316c 100644 (file)
@@ -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");
index 560d54dc98fc198369e832fad43ee9414a646cae..733c47063bad878d8a54b061cc06e28fa2c7618c 100644 (file)
@@ -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;
                                                }
                                        }
index 22f5a97b498187b23b651695e8b3d9a1b8cef1f6..691d35d84f2040c4c10dabe37990d70e90c26e1a 100644 (file)
@@ -536,18 +536,23 @@ bool PipelineCommand::fillInMothurMade(string& options, map<string, vector<strin
                
                //fill in mothurmade filenames
                for (it = parameters.begin(); it != parameters.end(); it++) { 
+                       string paraType = it->first;
+                       
                        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<string> 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<string, vector<strin
                                                
                                                if ((num < 0) || (num > (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, map<string, vector<strin
                                                getline(cin, s);
                                                
                                        }else if (temp.size() == 0){
-                                               m->mothurOut("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";
index 557622db59b1f5480a87fda36050e98cfb9439a9..629416a5f01476442b3dd3e8db9cd3fadaca4165 100644 (file)
@@ -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;
                
index e51f7f22acda22ac6a852dfebad627275c58d073..11754469fc3543c2ac544304606c507755f7ac41 100644 (file)
@@ -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;
                                                }
                                        }
index cfe9d509112e921aef92c0cf914e10f6ca885079..4b263b491c59c0cd14abaf0d4553ffa20fdd26f6 100644 (file)
@@ -214,7 +214,7 @@ bool ValidParameters::isValidParameter(string parameter, vector<string> cParams,
 string ValidParameters::validFile(map<string, string>& container, string parameter, bool isFile) {
        try {
                int ableToOpen;
-               ifstream in;
+               
                map<string, string>::iterator it;
                
                it = container.find(parameter);
@@ -232,15 +232,18 @@ string ValidParameters::validFile(map<string, string>& 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<string, string>& 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++) {