]> git.donarmstrong.com Git - mothur.git/blobdiff - unifracunweightedcommand.cpp
fixed bug in unifrac commands with unrooted trees
[mothur.git] / unifracunweightedcommand.cpp
index 634bf0caff8d279e259c64fb76f28737aaaa8219..fbbc4f1de67cebeb1b9e57a4dce47f499e272f63 100644 (file)
@@ -198,6 +198,8 @@ int UnifracUnweightedCommand::execute() {
                randomData.resize(numComp,0); //data[0] = unweightedscore
                //create new tree with same num nodes and leaves as users
                
+               if (numComp < processors) { processors = numComp;  }
+               
                outSum << "Tree#" << '\t' << "Groups" << '\t'  <<  "UWScore" <<'\t' << "UWSig" <<  endl;
                m->mothurOut("Tree#\tGroups\tUWScore\tUWSig"); m->mothurOutEndLine();
                
@@ -430,7 +432,7 @@ void UnifracUnweightedCommand::createPhylipFile(int i) {
                                out << name << '\t';
                                
                                //output distances
-                               for (int l = 0; l < globaldata->Groups.size(); l++) {   out  << dists[r][l] << '\t';  }
+                               for (int l = 0; l < globaldata->Groups.size(); l++) {   out << setprecision(11) << dists[r][l] << '\t';  }
                                out << endl;
                        }else{
                                //output distances