X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=counttable.cpp;fp=counttable.cpp;h=376bd73487b4031077f7dd26b1c58b648d9ff04d;hb=6ede3bf5c0a9eedb23f24577a97da81ab3e1f7df;hp=005ab8a2846bcd95dc40d1bf1d9b86325deb5e85;hpb=c7e8c2d15bd7cedcfdf18675cb0ea1a0dcd0e3c0;p=mothur.git diff --git a/counttable.cpp b/counttable.cpp index 005ab8a..376bd73 100644 --- a/counttable.cpp +++ b/counttable.cpp @@ -8,7 +8,23 @@ #include "counttable.h" - +/************************************************************/ +bool CountTable::testGroups(string file) { + try { + m = MothurOut::getInstance(); hasGroups = false; total = 0; + ifstream in; + m->openInputFile(file, in); + + string headers = m->getline(in); m->gobble(in); + vector columnHeaders = m->splitWhiteSpace(headers); + if (columnHeaders.size() > 2) { hasGroups = true; } + return hasGroups; + } + catch(exception& e) { + m->errorOut(e, "CountTable", "readTable"); + exit(1); + } +} /************************************************************/ int CountTable::readTable(string file) { try {