]> git.donarmstrong.com Git - mothur.git/commitdiff
fixed catchall hangup if it can't find the exe
authorwestcott <westcott>
Fri, 4 Feb 2011 12:54:38 +0000 (12:54 +0000)
committerwestcott <westcott>
Fri, 4 Feb 2011 12:54:38 +0000 (12:54 +0000)
catchallcommand.cpp
corraxescommand.cpp

index 69b9f04becdbb492fc69209837be5a0581123b99..b0e5eff6652a9defaa887eb7d21bb9bfe9e372a6 100644 (file)
@@ -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);
index b6c1a705a39a891072f147997f942708fcc52272..3da6b82d940fc8257a5564fc1c5b9a419343f604 100644 (file)
@@ -608,10 +608,10 @@ int CorrAxesCommand::calcKendall(map<string, vector<float> >& axes, ofstream& ou
                        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();
@@ -648,10 +648,10 @@ int CorrAxesCommand::calcKendall(map<string, vector<float> >& axes, ofstream& ou
                        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();