]> git.donarmstrong.com Git - mothur.git/blobdiff - counttable.cpp
fixes while testing 1.33.0
[mothur.git] / counttable.cpp
index 6eca8ee2a4b5354da54412b9eb6986b6ba244657..d5720acd386c36cf8cd713dcbc6d1bd5e507609b 100644 (file)
@@ -211,7 +211,7 @@ int CountTable::createTable(string namefile, string groupfile, bool createGroup)
        }
 }
 /************************************************************/
-int CountTable::readTable(string file, bool readGroups) {
+int CountTable::readTable(string file, bool readGroups, bool mothurRunning) {
     try {
         filename = file;
         ifstream in;
@@ -246,6 +246,9 @@ int CountTable::readTable(string file, bool readGroups) {
             in >> name; m->gobble(in); in >> thisTotal; m->gobble(in);
             if (m->debug) { m->mothurOut("[DEBUG]: " + name + '\t' + toString(thisTotal) + "\n"); }
             
+            if ((thisTotal == 0) && !mothurRunning) { error=true; m->mothurOut("[ERROR]: Your count table contains a sequence named " + name + " with a total=0. Please correct."); m->mothurOutEndLine();
+            }
+            
             //if group info, then read it
             vector<int> groupCounts; groupCounts.resize(numGroups, 0);
             if (columnHeaders.size() > 2) { //file contains groups