]> git.donarmstrong.com Git - mothur.git/blobdiff - matrixoutputcommand.cpp
added mothurgetpid function. fixed bug with align.seqs related to g++ 4.8 change...
[mothur.git] / matrixoutputcommand.cpp
index 2e6943f0eb7aed1c0b881b5dd5a5d079cdd4fb87..67e54d034ecf6d1658e69acf0841c0f72115fee4 100644 (file)
@@ -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();
@@ -540,7 +540,7 @@ int MatrixOutputCommand::process(vector<SharedRAbundVector*> 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<SharedRAbundVector*> 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);