]> git.donarmstrong.com Git - mothur.git/blobdiff - summaryqualcommand.cpp
update .gitignore
[mothur.git] / summaryqualcommand.cpp
index ae5b652a3cbfa0e43aa74e495bb28eb16775d9d3..6396f8ff6f5944fc167d49895a44c5248b5f0523 100644 (file)
@@ -196,7 +196,7 @@ int SummaryQualCommand::execute(){
                if (namefile != "") { nameMap = m->readNames(namefile); }
                else if (countfile != "") {
             CountTable ct;
-            ct.readTable(countfile);
+            ct.readTable(countfile, false, false);
             nameMap = ct.getNameMap();
         }
         
@@ -337,7 +337,7 @@ int SummaryQualCommand::createProcessesCreateSummary(vector<int>& position, vect
                
                //loop through and create all the processes you want
                while (process != processors) {
-                       int pid = fork();
+                       pid_t pid = fork();
                        
                        if (pid > 0) {
                                processIDS.push_back(pid);  //create map from line number to pid so you can append files in correct order later
@@ -347,7 +347,7 @@ int SummaryQualCommand::createProcessesCreateSummary(vector<int>& position, vect
                                
                                //pass numSeqs to parent
                                ofstream out;
-                               string tempFile = qualfile + toString(getpid()) + ".num.temp";
+                               string tempFile = qualfile + m->mothurGetpid(process) + ".num.temp";
                                m->openOutputFile(tempFile, out);
                                
                                out << numSeqs << endl;
@@ -441,7 +441,10 @@ int SummaryQualCommand::createProcessesCreateSummary(vector<int>& position, vect
                
                //Close all thread handles and free memory allocations.
                for(int i=0; i < pDataArray.size(); i++){
-                       numSeqs += pDataArray[i]->count;
+                       numSeqs += pDataArray[i]->numSeqs;
+            if (pDataArray[i]->count != pDataArray[i]->end) {
+                m->mothurOut("[ERROR]: process " + toString(i) + " only processed " + toString(pDataArray[i]->count) + " of " + toString(pDataArray[i]->end) + " sequences assigned to it, quitting. \n"); m->control_pressed = true; 
+            }
             int tempNum = pDataArray[i]->position.size();
             if (position.size() < tempNum) { position.resize(tempNum, 0); }
                        if (averageQ.size() < tempNum) { averageQ.resize(tempNum, 0); }