From 995238e9aa4455e3b59053e3dfe497b89caed79e Mon Sep 17 00:00:00 2001 From: westcott Date: Fri, 4 Feb 2011 12:54:38 +0000 Subject: [PATCH] fixed catchall hangup if it can't find the exe --- catchallcommand.cpp | 4 +++- corraxescommand.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/catchallcommand.cpp b/catchallcommand.cpp index 69b9f04..b0e5eff 100644 --- a/catchallcommand.cpp +++ b/catchallcommand.cpp @@ -500,8 +500,10 @@ int CatchAllCommand::createSummaryFile(string file1, string label, ofstream& out try { ifstream in; - m->openInputFile(file1, in); + int able = m->openInputFile(file1, in, "noerror"); + if (able == 1) { m->mothurOut("[ERROR]: the catchall program did not run properly. Please check to make sure it is located in the same folder as your mothur executable.");m->mothurOutEndLine(); m->control_pressed = true; return 0; } + if (!in.eof()) { string header = m->getline(in); m->gobble(in); diff --git a/corraxescommand.cpp b/corraxescommand.cpp index b6c1a70..3da6b82 100644 --- a/corraxescommand.cpp +++ b/corraxescommand.cpp @@ -608,10 +608,10 @@ int CorrAxesCommand::calcKendall(map >& axes, ofstream& ou vector ties; int rankTotal = 0; for (int j = 0; j < scores[i].size(); j++) { - rankTotal += j; + rankTotal += (j+1); ties.push_back(&(scores[i][j])); - if (j != scores.size()-1) { // you are not the last so you can look ahead + if (j != scores[i].size()-1) { // you are not the last so you can look ahead if (scores[i][j].score != scores[i][j+1].score) { // you are done with ties, rank them and continue for (int k = 0; k < ties.size(); k++) { float thisrank = rankTotal / (float) ties.size(); @@ -648,10 +648,10 @@ int CorrAxesCommand::calcKendall(map >& axes, ofstream& ou vector ties; int rankTotal = 0; for (int j = 0; j < otuScores.size(); j++) { - rankTotal += j; + rankTotal += (j+1); ties.push_back(otuScores[j]); - if (j != scores.size()-1) { // you are not the last so you can look ahead + if (j != otuScores.size()-1) { // you are not the last so you can look ahead if (otuScores[j].score != otuScores[j+1].score) { // you are done with ties, rank them and continue for (int k = 0; k < ties.size(); k++) { float thisrank = rankTotal / (float) ties.size(); -- 2.39.2