]> git.donarmstrong.com Git - mothur.git/blobdiff - corraxescommand.cpp
added mantel command
[mothur.git] / corraxescommand.cpp
index 58fb3649887afbd9e6e6b3441650c336688c0168..f47427d62c2cc7f03615149b11cbfdee5135b083 100644 (file)
 #include "corraxescommand.h"
 #include "sharedutilities.h"
 
-//********************************************************************************************************************
-//sorts highest to lowest
-inline bool compareSpearman(spearmanRank left, spearmanRank right){
-       return (left.score > right.score);      
-} 
-//********************************************************************************************************************
-//sorts lowest to highest
-inline bool compareSpearmanReverse(spearmanRank left, spearmanRank right){
-       return (left.score < right.score);      
-} 
 //**********************************************************************************************************************
 vector<string> CorrAxesCommand::getValidParameters(){  
        try {
@@ -655,7 +645,7 @@ int CorrAxesCommand::calcKendall(map<string, vector<float> >& axes, ofstream& ou
                                        int numWithLowerRank = 0;
                                        float thisrank = otus[l].score;
                                        
-                                       for (int u = l; u < scores[j].size(); u++) {
+                                       for (int u = l+1; u < scores[j].size(); u++) {
                                                if (otus[u].score > thisrank) { numWithHigherRank++; }
                                                else if (otus[u].score < thisrank) { numWithLowerRank++; }
                                                count++;
@@ -665,9 +655,6 @@ int CorrAxesCommand::calcKendall(map<string, vector<float> >& axes, ofstream& ou
                                        numDisCoor += numWithLowerRank;
                                }
                                
-                               //comparing to yourself
-                               count -= lookupFloat.size();
-                               
                                double p = (numCoor - numDisCoor) / (float) count;
 
                                out << '\t' << p;