]> git.donarmstrong.com Git - mothur.git/blobdiff - seqsummarycommand.cpp
added mothurgetpid function. fixed bug with align.seqs related to g++ 4.8 change...
[mothur.git] / seqsummarycommand.cpp
index e6b037b6bcafafa6c7ccf5aafa9731de3d7ba864..3f7565923cb57d11673d581215c74509d1ac40b8 100644 (file)
@@ -203,7 +203,7 @@ int SeqSummaryCommand::execute(){
                if (namefile != "") { nameMap = m->readNames(namefile); }
         else if (countfile != "") {
             CountTable ct;
-            ct.readTable(countfile, false);
+            ct.readTable(countfile, false, false);
             nameMap = ct.getNameMap();
         }
                
@@ -376,7 +376,7 @@ int SeqSummaryCommand::execute(){
                 
         double meanstartPosition, meanendPosition, meanseqLength, meanambigBases, meanlongHomoPolymer;
                 
-               meanstartPosition /= (double) size; meanendPosition /= (double) size; meanlongHomoPolymer /= (double) size; meanseqLength /= (double) size; meanambigBases /= (double) size;
+               meanstartPosition = meanStartPosition / (double) size; meanendPosition = meanEndPosition /(double) size; meanlongHomoPolymer = meanLongHomoPolymer / (double) size; meanseqLength = meanSeqLength / (double) size; meanambigBases = meanAmbigBases /(double) size;
                                
                int ptile0_25   = int(size * 0.025);
                int ptile25             = int(size * 0.250);
@@ -449,7 +449,8 @@ int SeqSummaryCommand::driverCreateSummary(vector<int>& startPosition, vector<in
 
                bool done = false;
                int count = 0;
-       
+        
+        
                while (!done) {
                                
                        if (m->control_pressed) { in.close(); outSummary.close(); return 1; }
@@ -479,7 +480,6 @@ int SeqSummaryCommand::driverCreateSummary(vector<int>& startPosition, vector<in
                                        ambigBases.push_back(current.getAmbigBases());
                                        longHomoPolymer.push_back(current.getLongHomoPolymer());
                                }
-                               
                                count++;
                                outSummary << current.getName() << '\t';
                                outSummary << current.getStartPos() << '\t' << current.getEndPos() << '\t';
@@ -590,11 +590,11 @@ int SeqSummaryCommand::createProcessesCreateSummary(vector<int>& startPosition,
                                processIDS.push_back(pid);  //create map from line number to pid so you can append files in correct order later
                                process++;
                        }else if (pid == 0){
-                               num = driverCreateSummary(startPosition, endPosition, seqLength, ambigBases, longHomoPolymer, fastafile, sumFile + toString(getpid()) + ".temp", lines[process]);
+                               num = driverCreateSummary(startPosition, endPosition, seqLength, ambigBases, longHomoPolymer, fastafile, sumFile + m->mothurGetpid(process) + ".temp", lines[process]);
                                
                                //pass numSeqs to parent
                                ofstream out;
-                               string tempFile = fastafile + toString(getpid()) + ".num.temp";
+                               string tempFile = fastafile + m->mothurGetpid(process) + ".num.temp";
                                m->openOutputFile(tempFile, out);
                                
                                out << num << endl;