X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=unifracunweightedcommand.cpp;h=75ab99682974b3152d3c5020130855788ef5f151;hb=485c02be0cdcd06ce08dd58d551a525b6a1b47c5;hp=dd1a3f9c236f9a86b022c99a3e6dd2d2109b1dfa;hpb=9651e8e7172d86707b34af15e95ec60ad4c3c3f9;p=mothur.git diff --git a/unifracunweightedcommand.cpp b/unifracunweightedcommand.cpp index dd1a3f9..75ab996 100644 --- a/unifracunweightedcommand.cpp +++ b/unifracunweightedcommand.cpp @@ -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; } }