]> git.donarmstrong.com Git - mothur.git/blobdiff - countseqscommand.cpp
added binary file operations to mothurout class. added comment to sequence class...
[mothur.git] / countseqscommand.cpp
index 6afd1f47b06591d19d274ce91793edd73d4cabc7..575ffe844ed0a1134d52ecd0d6aa30531e2fc584 100644 (file)
@@ -373,12 +373,13 @@ int CountSeqsCommand::createProcesses(GroupMap*& groupMap, string outputFileName
 
         
         //sanity check
-        if (numSeqs != groupMap->getNumSeqs()) {
-            m->mothurOut("[ERROR]: processes reported processing " + toString(numSeqs) + " sequences, but group file indicates you have " + toString(groupMap->getNumSeqs()) + " sequences.");
-            if (processors == 1) { m->mothurOut(" Could you have a file mismatch?\n"); }
-            else { m->mothurOut(" Either you have a file mismatch or a process failed to complete the task assigned to it.\n"); m->control_pressed = true; }
-        }
-               
+        if (groupfile != "") {
+            if (numSeqs != groupMap->getNumSeqs()) {
+                m->mothurOut("[ERROR]: processes reported processing " + toString(numSeqs) + " sequences, but group file indicates you have " + toString(groupMap->getNumSeqs()) + " sequences.");
+                if (processors == 1) { m->mothurOut(" Could you have a file mismatch?\n"); }
+                else { m->mothurOut(" Either you have a file mismatch or a process failed to complete the task assigned to it.\n"); m->control_pressed = true; }
+            }
+               }
                return numSeqs;
        }
        catch(exception& e) {
@@ -627,7 +628,7 @@ map<int, string> CountSeqsCommand::processNameFile(string name) {
             }
                }
                in.close();
-        out.close();
+       
                
         if (rest != "") {
             vector<string> pieces = m->splitWhiteSpace(rest);
@@ -650,6 +651,7 @@ map<int, string> CountSeqsCommand::processNameFile(string name) {
             }
 
         }
+        out.close();
         
         return indexToNames;
     }
@@ -703,7 +705,7 @@ map<int, string> CountSeqsCommand::getGroupNames(string filename, set<string>& n
             }
                }
                in.close();
-        out.close();
+        
         
         if (rest != "") {
             vector<string> pieces = m->splitWhiteSpace(rest);
@@ -725,6 +727,7 @@ map<int, string> CountSeqsCommand::getGroupNames(string filename, set<string>& n
                 }
             }
         }
+        out.close();
                
         for (it = groupIndex.begin(); it != groupIndex.end(); it++) {  indexToGroups[it->second] = it->first;  }