From c651c46022761aef61644f78462365d8f767ff0b Mon Sep 17 00:00:00 2001 From: westcott Date: Fri, 29 Jul 2011 12:34:24 +0000 Subject: [PATCH] removed UWSig and WSig from output if user does not set random=T --- indicatorcommand.cpp | 2 +- unifracunweightedcommand.cpp | 12 +++++++----- unifracweightedcommand.cpp | 12 +++++++----- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/indicatorcommand.cpp b/indicatorcommand.cpp index 905076b..797f62c 100644 --- a/indicatorcommand.cpp +++ b/indicatorcommand.cpp @@ -42,7 +42,7 @@ string IndicatorCommand::getHelpString(){ helpString += "The indicator command outputs a .indicator.summary file and a .indicator.tre if a tree is given. \n"; helpString += "The new tree contains labels at each internal node. The label is the node number so you can relate the tree to the summary file.\n"; helpString += "The summary file lists the indicator value for each OTU for each node.\n"; - helpString += "The indicator command parameters are tree, groups, shared, relabund, design and label. The tree parameter is required as well as either shared or relabund.\n"; + helpString += "The indicator command parameters are tree, groups, shared, relabund, design and label. \n"; helpString += "The design parameter allows you to relate the tree to the shared or relabund file, if your tree contains the grouping names, or if no tree is provided to group your groups into groupings.\n"; helpString += "The groups parameter allows you to specify which of the groups in your shared or relabund you would like analyzed, or if you provide a design file the groups in your design file. The groups may be entered separated by dashes.\n"; helpString += "The label parameter indicates at what distance your tree relates to the shared or relabund.\n"; diff --git a/unifracunweightedcommand.cpp b/unifracunweightedcommand.cpp index 501e612..1c2db53 100644 --- a/unifracunweightedcommand.cpp +++ b/unifracunweightedcommand.cpp @@ -298,8 +298,10 @@ int UnifracUnweightedCommand::execute() { if (numComp < processors) { processors = numComp; } - outSum << "Tree#" << '\t' << "Groups" << '\t' << "UWScore" <<'\t' << "UWSig" << endl; - m->mothurOut("Tree#\tGroups\tUWScore\tUWSig"); m->mothurOutEndLine(); + outSum << "Tree#" << '\t' << "Groups" << '\t' << "UWScore" <<'\t'; + m->mothurOut("Tree#\tGroups\tUWScore\t"); + if (random) { outSum << "UWSig"; m->mothurOut("UWSig"); } + outSum << endl; m->mothurOutEndLine(); //get pscores for users trees for (int i = 0; i < T.size(); i++) { @@ -485,9 +487,9 @@ void UnifracUnweightedCommand::printUWSummaryFile(int i) { m->mothurOutJustToLog(groupComb[a] + "\t" + toString(utreeScores[a][0]) + "\t<" + toString((1/float(iters))) + "\n"); } }else{ - outSum << setprecision(6) << groupComb[a] << '\t' << utreeScores[a][0] << '\t' << "0.00" << endl; - cout << setprecision(6) << groupComb[a] << '\t' << utreeScores[a][0] << '\t' << "0.00" << endl; - m->mothurOutJustToLog(groupComb[a] + "\t" + toString(utreeScores[a][0]) + "\t0.00\n"); + outSum << setprecision(6) << groupComb[a] << '\t' << utreeScores[a][0] << endl; + cout << setprecision(6) << groupComb[a] << '\t' << utreeScores[a][0] << endl; + m->mothurOutJustToLog(groupComb[a] + "\t" + toString(utreeScores[a][0]) + "\n"); } } diff --git a/unifracweightedcommand.cpp b/unifracweightedcommand.cpp index d6431a0..994f09b 100644 --- a/unifracweightedcommand.cpp +++ b/unifracweightedcommand.cpp @@ -581,8 +581,10 @@ void UnifracWeightedCommand::printWeightedFile() { void UnifracWeightedCommand::printWSummaryFile() { try { //column headers - outSum << "Tree#" << '\t' << "Groups" << '\t' << "WScore" << '\t' << "WSig" << endl; - m->mothurOut("Tree#\tGroups\tWScore\tWSig"); m->mothurOutEndLine(); + outSum << "Tree#" << '\t' << "Groups" << '\t' << "WScore" << '\t'; + m->mothurOut("Tree#\tGroups\tWScore\t"); + if (random) { outSum << "WSig"; m->mothurOut("WSig"); } + outSum << endl; m->mothurOutEndLine(); //format output outSum.setf(ios::fixed, ios::floatfield); outSum.setf(ios::showpoint); @@ -602,9 +604,9 @@ void UnifracWeightedCommand::printWSummaryFile() { m->mothurOutJustToLog(toString(i+1) +"\t" + groupComb[j] +"\t" + toString(utreeScores[count]) +"\t<" + toString((1/float(iters))) + "\n"); } }else{ - outSum << setprecision(6) << i+1 << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << "0.00" << endl; - cout << setprecision(6) << i+1 << '\t' << groupComb[j] << '\t' << utreeScores[count] << '\t' << "0.00" << endl; - m->mothurOutJustToLog(toString(i+1) +"\t" + groupComb[j] +"\t" + toString(utreeScores[count]) +"\t0.00\n"); + outSum << setprecision(6) << i+1 << '\t' << groupComb[j] << '\t' << utreeScores[count] << endl; + cout << setprecision(6) << i+1 << '\t' << groupComb[j] << '\t' << utreeScores[count] << endl; + m->mothurOutJustToLog(toString(i+1) +"\t" + groupComb[j] +"\t" + toString(utreeScores[count]) +"\n"); } count++; } -- 2.39.2