X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=unifracunweightedcommand.cpp;h=dd1a3f9c236f9a86b022c99a3e6dd2d2109b1dfa;hb=9651e8e7172d86707b34af15e95ec60ad4c3c3f9;hp=6e217c8a71d37f22c3401a2dccc10aa23000fb26;hpb=5589a967aab6b83d826508f4c37a789fb6a2a26e;p=mothur.git diff --git a/unifracunweightedcommand.cpp b/unifracunweightedcommand.cpp index 6e217c8..dd1a3f9 100644 --- a/unifracunweightedcommand.cpp +++ b/unifracunweightedcommand.cpp @@ -48,10 +48,10 @@ int UnifracUnweightedCommand::execute() { unweightedFileout = globaldata->getTreeFile() + "temp." + toString(i+1) + ".unweighted"; //column headers - outSum << "Tree# " << i+1 << endl; - outSum << "Comb" << '\t' << "UWScore" << '\t' << '\t' << "UWSig" << endl; - cout << "Tree# " << i+1 << endl; - cout << "Comb" << '\t' << "UWScore" << '\t' << '\t' << "UWSig" << endl; +// 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; //get unweighted for users tree @@ -163,15 +163,16 @@ void UnifracUnweightedCommand::printUWSummaryFile() { //format output outSum.setf(ios::fixed, ios::floatfield); outSum.setf(ios::showpoint); - + //print each line + for(int a = 0; a < numComp; a++) { if (UWScoreSig[a][0] > (1/(float)iters)) { - outSum << setprecision(globaldata->getIters().length()) << groupComb[a] << '\t' << '\t' << utreeScores[a][0] << '\t' << UWScoreSig[a][0] << endl; - cout << setprecision(globaldata->getIters().length()) << groupComb[a] << '\t' << '\t' << utreeScores[a][0] << '\t' << UWScoreSig[a][0] << endl; + 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; }else { - outSum << setprecision(globaldata->getIters().length()) << groupComb[a] << '\t' << '\t' << utreeScores[a][0] << '\t' << "<" << (1/float(iters)) << endl; - cout << setprecision(globaldata->getIters().length()) << groupComb[a] << '\t' << '\t' << utreeScores[a][0] << '\t' << "<" << (1/float(iters)) << endl; + 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; } } @@ -273,7 +274,7 @@ void UnifracUnweightedCommand::initFile(string label){ string inputBuffer; getline(inFile, inputBuffer); - out << inputBuffer << '\t' << label + "Score" << '\t' << label + "RandFreq" << '\t' << label + "RandCumul" << endl; + out << inputBuffer << '\t' << label + "RandFreq" << '\t' << label + "RandCumul" << endl; }else{ openOutputFile(unweightedFileout, out); out << label + "Score" << '\t' << label + "RandFreq" << '\t' << label + "RandCumul" << endl; @@ -299,11 +300,12 @@ void UnifracUnweightedCommand::output(vector data){ if(counter != 0){ string inputBuffer; getline(inFile, inputBuffer); +// out << inputBuffer << setprecision(6) << '\t' << data[0] << setprecision(globaldata->getIters().length()) << '\t' << data[1] << '\t' << data[2] << endl; - out << inputBuffer << setprecision(globaldata->getIters().length()) << '\t' << data[0] << '\t' << data[1] << '\t' << data[2] << endl; + out << inputBuffer << '\t' << setprecision(6) << data[0] << setprecision(globaldata->getIters().length()) << '\t' << data[1] << '\t' << data[2] << endl; } else{ - out << setprecision(globaldata->getIters().length()) << data[0] << '\t' << data[1] << '\t' << data[2] << endl; + out << setprecision(6) << data[0] << setprecision(globaldata->getIters().length()) << '\t' << data[1] << '\t' << data[2] << endl; } }