X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=counttable.cpp;h=d5720acd386c36cf8cd713dcbc6d1bd5e507609b;hp=6eca8ee2a4b5354da54412b9eb6986b6ba244657;hb=b206f634aae1b4ce13978d203247fb64757d5482;hpb=af0a94ea8f02421b2b73e77e68753a2b4c37768e diff --git a/counttable.cpp b/counttable.cpp index 6eca8ee..d5720ac 100644 --- a/counttable.cpp +++ b/counttable.cpp @@ -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 groupCounts; groupCounts.resize(numGroups, 0); if (columnHeaders.size() > 2) { //file contains groups