]> git.donarmstrong.com Git - mothur.git/blobdiff - matrixoutputcommand.cpp
working on sra and get.mimarkspackage commands. added file parameter to cluster...
[mothur.git] / matrixoutputcommand.cpp
index 2e6943f0eb7aed1c0b881b5dd5a5d079cdd4fb87..5665426e537deca591a971a560f58283020eb9d3 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();
@@ -531,7 +531,7 @@ int MatrixOutputCommand::process(vector<SharedRAbundVector*> 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<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);