X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=seqsummarycommand.cpp;h=88478a10ec86f97802a1b5b152fcf434c7e6dc14;hb=a89c6295ae9a35fcaaab7fa50dcb68360dd543b0;hp=e6b037b6bcafafa6c7ccf5aafa9731de3d7ba864;hpb=4283eb0248ca6e7e3e3344647f16166da0e14147;p=mothur.git diff --git a/seqsummarycommand.cpp b/seqsummarycommand.cpp index e6b037b..88478a1 100644 --- a/seqsummarycommand.cpp +++ b/seqsummarycommand.cpp @@ -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& startPosition, vectorcontrol_pressed) { in.close(); outSummary.close(); return 1; } @@ -479,7 +480,6 @@ int SeqSummaryCommand::driverCreateSummary(vector& startPosition, vector& startPosition, //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 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;