]> git.donarmstrong.com Git - mothur.git/blobdiff - unifracweightedcommand.cpp
changed format of output in unifrac and parsimony files
[mothur.git] / unifracweightedcommand.cpp
index 91e898f658556d840aab261995ba285c96d84f9d..6d8f75ba9dc3a4edeca6a4430937cc476b886090 100644 (file)
@@ -52,7 +52,6 @@ int UnifracWeightedCommand::execute() {
                        weightedFile = globaldata->getTreeFile()  + toString(i+1) + ".weighted";
                        weightedFileout = globaldata->getTreeFile() + "temp." + toString(i+1) + ".weighted";
                                                        
-                       cout << "Processing tree " << i+1 << endl;
                        userData = weighted->getValues(T[i]);  //userData[0] = weightedscore
                        
                        //save users score
@@ -175,8 +174,13 @@ void UnifracWeightedCommand::printWSummaryFile() {
                int count = 0;
                for (int i = 0; i < T.size(); i++) { 
                        for (int j = 0; j < numComp; j++) {
-                               outSum << setprecision(globaldata->getIters().length()) << i+1 << '\t' << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << WScoreSig[count] << endl; 
-                               cout << setprecision(globaldata->getIters().length()) << i+1 << '\t' << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << WScoreSig[count] << endl; 
+                               if (WScoreSig[count] > (1/(float)iters)) {
+                                       outSum << setprecision(globaldata->getIters().length()) << i+1 << '\t' << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << WScoreSig[count] << endl; 
+                                       cout << setprecision(globaldata->getIters().length()) << i+1 << '\t' << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << WScoreSig[count] << endl; 
+                               }else{
+                                       outSum << setprecision(globaldata->getIters().length()) << i+1 << '\t' << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << "<" << (1/float(iters)) << endl; 
+                                       cout << setprecision(globaldata->getIters().length()) << i+1 << '\t' << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << "<" << (1/float(iters)) << endl; 
+                               }
                                count++;
                        }
                }
@@ -261,7 +265,7 @@ void UnifracWeightedCommand::setGroups() {
                        numComp += i; 
                        for (int l = i+1; l < numGroups; l++) {
                                //set group comparison labels
-                               groupComb.push_back(globaldata->Groups[i]+globaldata->Groups[l]);
+                               groupComb.push_back(globaldata->Groups[i] + "-" + globaldata->Groups[l]);
                        }
                }
        }