]> git.donarmstrong.com Git - mothur.git/commitdiff
fix to summary.tax for 1.28.0
authorSarah Westcott <mothur.westcott@gmail.com>
Fri, 2 Nov 2012 17:06:05 +0000 (13:06 -0400)
committerSarah Westcott <mothur.westcott@gmail.com>
Fri, 2 Nov 2012 17:06:05 +0000 (13:06 -0400)
Mothur.xcodeproj/project.pbxproj
mothurout.cpp
randomforest.hpp [changed mode: 0755->0644]
rarefactcommand.cpp
summarytaxcommand.cpp

index 1b298dfea5f58b9bd1f4ca1b09194967515a4de8..d360d2f49414c2b60fc79c32de09c7e7345ac265 100644 (file)
                                GCC_OPTIMIZATION_LEVEL = 3;
                                GCC_PREPROCESSOR_DEFINITIONS = (
                                        "MOTHUR_FILES=\"\\\"../release\\\"\"",
-                                       "VERSION=\"\\\"1.26.0\\\"\"",
-                                       "RELEASE_DATE=\"\\\"7/9/2012\\\"\"",
+                                       "VERSION=\"\\\"1.28.0\\\"\"",
+                                       "RELEASE_DATE=\"\\\"11/2/2012\\\"\"",
                                );
                                "GCC_VERSION[arch=*]" = "";
                                GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
                                GCC_MODEL_TUNING = "";
                                GCC_OPTIMIZATION_LEVEL = 3;
                                GCC_PREPROCESSOR_DEFINITIONS = (
-                                       "VERSION=\"\\\"1.27.0\\\"\"",
-                                       "RELEASE_DATE=\"\\\"8/8/2012\\\"\"",
+                                       "VERSION=\"\\\"1.28.0\\\"\"",
+                                       "RELEASE_DATE=\"\\\"11/2/2012\\\"\"",
                                );
                                GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
index 124fbb876b38def3d61f1bf425ef15f36237fa5f..468c063cb5c7e74a8d5901a1a38203f47409e2d5 100644 (file)
@@ -1608,8 +1608,17 @@ int MothurOut::readTax(string namefile, map<string, string>& taxMap) {
                 if (pairDone) { 
                     //are there confidence scores, if so remove them
                     if (secondCol.find_first_of('(') != -1) {  removeConfidences(secondCol);   }
-                    taxMap[firstCol] = secondCol;
-                    if (debug) {  mothurOut("[DEBUG]: name = '" + firstCol + "' tax = '" + secondCol + "'\n");  }
+                    map<string, string>::iterator itTax = taxMap.find(firstCol);
+                    
+                    if(itTax == taxMap.end()) {
+                        bool ignore = false;
+                        if (secondCol != "") { if (secondCol[secondCol.length()-1] != ';') { mothurOut("[ERROR]: " + firstCol + " is missing the final ';', ignoring.\n"); ignore=true; }
+                        }
+                        if (!ignore) { taxMap[firstCol] = secondCol; }
+                        if (debug) {  mothurOut("[DEBUG]: name = '" + firstCol + "' tax = '" + secondCol + "'\n");  }
+                    }else {
+                        mothurOut("[ERROR]: " + firstCol + " is already in your taxonomy file, names must be unique./n"); control_pressed = true;
+                    }
                     pairDone = false; 
                 }
             }
@@ -1626,8 +1635,18 @@ int MothurOut::readTax(string namefile, map<string, string>& taxMap) {
                 if (pairDone) { 
                     //are there confidence scores, if so remove them
                     if (secondCol.find_first_of('(') != -1) {  removeConfidences(secondCol);   }
-                    taxMap[firstCol] = secondCol;
-                    if (debug) {  mothurOut("[DEBUG]: name = '" + firstCol + "' tax = '" + secondCol + "'\n");  }
+                    map<string, string>::iterator itTax = taxMap.find(firstCol);
+                    
+                    if(itTax == taxMap.end()) {
+                        bool ignore = false;
+                        if (secondCol != "") { if (secondCol[secondCol.length()-1] != ';') { mothurOut("[ERROR]: " + firstCol + " is missing the final ';', ignoring.\n"); ignore=true; }
+                        }
+                        if (!ignore) { taxMap[firstCol] = secondCol; }
+                        if (debug) {  mothurOut("[DEBUG]: name = '" + firstCol + "' tax = '" + secondCol + "'\n");  }
+                    }else {
+                        mothurOut("[ERROR]: " + firstCol + " is already in your taxonomy file, names must be unique./n"); control_pressed = true;
+                    }
+
                     pairDone = false; 
                 }
             } 
old mode 100755 (executable)
new mode 100644 (file)
index 612e3b4d2a8d1632e1c0f44937be52ce84d28fec..c4a104b6c2d10468777fe673567de1c05544a1a9 100644 (file)
@@ -56,7 +56,7 @@ string RareFactCommand::getHelpString(){
        try {
                ValidCalculators validCalculator;
                string helpString = "";
-               helpString += "The rarefaction.single command parameters are list, sabund, rabund, shared, label, iters, freq, calc, processors and abund.  list, sabund, rabund or shared is required unless you have a valid current file. \n";
+               helpString += "The rarefaction.single command parameters are list, sabund, rabund, shared, label, iters, freq, calc, processors, groupmode and abund.  list, sabund, rabund or shared is required unless you have a valid current file. \n";
                helpString += "The freq parameter is used indicate when to output your data, by default it is set to 100. But you can set it to a percentage of the number of sequence. For example freq=0.10, means 10%. \n";
                helpString += "The processors parameter allows you to specify the number of processors to use. The default is 1.\n";
                helpString += "The rarefaction.single command should be in the following format: \n";
index e932eee49c2477de737caf62d143a5140aea4340..7f5e5e5c285199cbb12a9fec151a466090bf9d5d 100644 (file)
@@ -277,7 +277,7 @@ int SummaryTaxCommand::execute(){
                                }
                        }
                        in.close();
-               }
+               }else { numSeqs = taxaSum->summarize(taxfile);  }
                
                if (m->control_pressed) {  if (groupMap != NULL) { delete groupMap; } if (ct != NULL) { delete ct; } delete taxaSum; return 0; }