X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=otuassociationcommand.cpp;fp=otuassociationcommand.cpp;h=eeefb41ffa9781aacad02a594cd4d61859631cb0;hb=82723a54e6109e2d46d84c10e87727cebd5a18ea;hp=b520ca69ceb898c9321cf8b7b6cf565588377079;hpb=e41b86a600fe30f5df9507d7e55027e7b8bd7dd6;p=mothur.git diff --git a/otuassociationcommand.cpp b/otuassociationcommand.cpp index b520ca6..eeefb41 100644 --- a/otuassociationcommand.cpp +++ b/otuassociationcommand.cpp @@ -308,7 +308,8 @@ int OTUAssociationCommand::process(vector& lookup){ else if (method == "kendall") { coef = linear.calcKendall(xy[i], xy[k], sig); } else { m->mothurOut("[ERROR]: invalid method, choices are spearman, pearson or kendall."); m->mothurOutEndLine(); m->control_pressed = true; } - out << m->binLabelsInFile[i] << '\t' << m->binLabelsInFile[k] << '\t' << coef << '\t' << sig << endl; + if (m->binLabelsInFile.size() != 0) { out << m->binLabelsInFile[i] << '\t' << m->binLabelsInFile[k] << '\t' << coef << '\t' << sig << endl; } + else { out << i+1 << '\t' << k+1 << '\t' << coef << '\t' << sig << endl; } } } @@ -436,7 +437,8 @@ int OTUAssociationCommand::process(vector& lookup){ else if (method == "kendall") { coef = linear.calcKendall(xy[i], xy[k], sig); } else { m->mothurOut("[ERROR]: invalid method, choices are spearman, pearson or kendall."); m->mothurOutEndLine(); m->control_pressed = true; } - out << m->binLabelsInFile[i] << '\t' << m->binLabelsInFile[k] << coef << '\t' << sig << endl; + if (m->binLabelsInFile.size() != 0) { out << m->binLabelsInFile[i] << '\t' << m->binLabelsInFile[k] << '\t' << coef << '\t' << sig << endl; } + else { out << i+1 << '\t' << k+1 << '\t' << coef << '\t' << sig << endl; } } }