]> git.donarmstrong.com Git - mothur.git/blobdiff - corraxescommand.cpp
fixed get.lienage and remove.lineage bug with confidence scores that are floats....
[mothur.git] / corraxescommand.cpp
index 4f8dccb167fc8e8e6d08597f11504d4df2b26f24..ae6ee3a92207f0ee9fe594b5208479452ed6b643 100644 (file)
@@ -645,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++;
@@ -655,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;
@@ -863,7 +860,7 @@ int CorrAxesCommand::getMetadata(){
                vector<string> groupNames;
                
                ifstream in;
-               m->openInputFile(axesfile, in);
+               m->openInputFile(metadatafile, in);
                
                string headerLine = m->getline(in); m->gobble(in);
                istringstream iss (headerLine,istringstream::in);
@@ -871,7 +868,7 @@ int CorrAxesCommand::getMetadata(){
                //read the first label, because it refers to the groups
                string columnLabel;
                iss >> columnLabel; m->gobble(iss); 
-               
+
                //save names of columns you are reading
                while (!iss.eof()) {
                        iss >> columnLabel; m->gobble(iss);