X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=matrixoutputcommand.cpp;h=5665426e537deca591a971a560f58283020eb9d3;hb=aca78ed4a47dff8672ea8fd93cef0dfbaf0f7495;hp=2e6943f0eb7aed1c0b881b5dd5a5d079cdd4fb87;hpb=0c5f99d1282405e20458e2822aa1a54774d2fa83;p=mothur.git diff --git a/matrixoutputcommand.cpp b/matrixoutputcommand.cpp index 2e6943f..5665426 100644 --- a/matrixoutputcommand.cpp +++ b/matrixoutputcommand.cpp @@ -432,7 +432,7 @@ int MatrixOutputCommand::execute(){ string current = ""; itTypes = outputTypes.find("phylip"); if (itTypes != outputTypes.end()) { - if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; m->setPhylipFile(current); } + if ((itTypes->second).size() != 0) { current = (itTypes->second)[0]; if (!subsample) { m->setPhylipFile(current); } } } m->mothurOutEndLine(); @@ -531,7 +531,7 @@ int MatrixOutputCommand::process(vector thisLookup){ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) //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); @@ -540,7 +540,7 @@ int MatrixOutputCommand::process(vector thisLookup){ driver(thisItersLookup, lines[process].start, lines[process].end, calcDists); - string tempdistFileName = m->getRootName(m->getSimpleName(sharedfile)) + toString(getpid()) + ".dist"; + string tempdistFileName = m->getRootName(m->getSimpleName(sharedfile)) + m->mothurGetpid(process) + ".dist"; ofstream outtemp; m->openOutputFile(tempdistFileName, outtemp); @@ -739,6 +739,8 @@ int MatrixOutputCommand::process(vector thisLookup){ variables["[calc]"] = matrixCalculators[i]->getName(); string distFileName = getOutputFileName("phylip",variables); outputNames.push_back(distFileName); outputTypes["phylip"].push_back(distFileName); + //set current phylip file to average distance matrix + m->setPhylipFile(distFileName); ofstream outAve; m->openOutputFile(distFileName, outAve); outAve.setf(ios::fixed, ios::floatfield); outAve.setf(ios::showpoint);