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);
vector<spearmanRank*> 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();
vector<spearmanRank> 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();