]> git.donarmstrong.com Git - mothur.git/blobdiff - unifracunweightedcommand.cpp
added nseqs and sharednseqs calculators, removed excess tabs in output files.
[mothur.git] / unifracunweightedcommand.cpp
index dd1a3f9c236f9a86b022c99a3e6dd2d2109b1dfa..75ab99682974b3152d3c5020130855788ef5f151 100644 (file)
@@ -40,20 +40,19 @@ int UnifracUnweightedCommand::execute() {
                userData.resize(numComp,0);  //data[0] = unweightedscore 
                randomData.resize(numComp,0); //data[0] = unweightedscore
                //create new tree with same num nodes and leaves as users
-                               
+               
+               outSum << "Tree#" << '\t' << "Groups" << '\t'  <<  "UWScore" <<'\t' << "UWSig" <<  endl;
+               cout << "Tree#" << '\t' << "Groups" << '\t'  <<  "UWScore" << '\t' << "UWSig" <<  endl;
+               
                //get pscores for users trees
                for (int i = 0; i < T.size(); i++) {
                        counter = 0;
                        unweightedFile = globaldata->getTreeFile()  + toString(i+1) + ".unweighted";
                        unweightedFileout = globaldata->getTreeFile() + "temp." + toString(i+1) + ".unweighted";
                        
-                       //column headers
-//                     outSum << "Tree# " << i+1 << endl;
-                       outSum << "Tree#" << '\t' << "Groups" << '\t'  <<  "UWScore" <<'\t' << "UWSig" <<  endl;
-//                     cout << "Tree# " << i+1 << endl;
-                       cout << "Tree#" << '\t' << "Groups" << '\t'  <<  "UWScore" << '\t' << "UWSig" <<  endl;
-
-
+                       outSum << i+1 << '\t';
+                       cout << i+1 << '\t';
+                       
                        //get unweighted for users tree
                        rscoreFreq.resize(numComp);  
                        rCumul.resize(numComp);  
@@ -66,6 +65,7 @@ int UnifracUnweightedCommand::execute() {
                        for(int k = 0; k < numComp; k++) {
                                //saves users score
                                utreeScores[k].push_back(userData[k]);
+
                        }
                        
                        //get unweighted scores for random trees
@@ -168,11 +168,11 @@ void UnifracUnweightedCommand::printUWSummaryFile() {
 
                for(int a = 0; a < numComp; a++) {
                        if (UWScoreSig[a][0] > (1/(float)iters)) {
-                               outSum << setprecision(6) << groupComb[a] << '\t' << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << UWScoreSig[a][0] << endl;
-                               cout << setprecision(6)  << groupComb[a] << '\t' << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << UWScoreSig[a][0] << endl; 
+                               outSum << setprecision(6) << groupComb[a]  << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << UWScoreSig[a][0] << endl;
+                               cout << setprecision(6)  << groupComb[a]  << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << UWScoreSig[a][0] << endl; 
                        }else {
-                               outSum << setprecision(6) << groupComb[a] << '\t' << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << "<" << (1/float(iters)) << endl;
-                               cout << setprecision(6)  << groupComb[a] << '\t' << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << "<" << (1/float(iters)) << endl; 
+                               outSum << setprecision(6) << groupComb[a]  << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << "<" << (1/float(iters)) << endl;
+                               cout << setprecision(6)  << groupComb[a]  << '\t' << utreeScores[a][0] << '\t' << setprecision(globaldata->getIters().length()) << "<" << (1/float(iters)) << endl; 
                        }
                }