]> git.donarmstrong.com Git - mothur.git/blobdiff - otuassociationcommand.cpp
working on pam
[mothur.git] / otuassociationcommand.cpp
index 23cac294cad4f1b25caa0e4f4d55de40f1fb2876..705540c3a62564a14da7a7ed00262c4adb5f220b 100644 (file)
@@ -360,7 +360,7 @@ int OTUAssociationCommand::process(vector<SharedRAbundVector*>& lookup){
                     else if (method == "kendall")      {       coef = linear.calcKendall(xy[i], xy[k], sig);   }                   
                     else { m->mothurOut("[ERROR]: invalid method, choices are spearman, pearson or kendall."); m->mothurOutEndLine(); m->control_pressed = true; }
                     
-                    if (sig < cutoff) { out << m->binLabelsInFile[i] << '\t' << m->binLabelsInFile[k] << '\t' << coef << '\t' << sig << endl; }
+                    if (sig < cutoff) { out << m->currentSharedBinLabels[i] << '\t' << m->currentSharedBinLabels[k] << '\t' << coef << '\t' << sig << endl; }
                 }
             }
                }else { //compare otus to metadata
@@ -377,7 +377,7 @@ int OTUAssociationCommand::process(vector<SharedRAbundVector*>& lookup){
                     else if (method == "kendall")      {       coef = linear.calcKendall(xy[i], metadata[k], sig);     }                   
                     else { m->mothurOut("[ERROR]: invalid method, choices are spearman, pearson or kendall."); m->mothurOutEndLine(); m->control_pressed = true; }
                     
-                    if (sig < cutoff) { out << m->binLabelsInFile[i] << '\t' << metadataLabels[k] << '\t' << coef << '\t' << sig << endl; }
+                    if (sig < cutoff) { out << m->currentSharedBinLabels[i] << '\t' << metadataLabels[k] << '\t' << coef << '\t' << sig << endl; }
                 }
             }
 
@@ -523,7 +523,7 @@ int OTUAssociationCommand::process(vector<SharedRAbundFloatVector*>& lookup){
                     else if (method == "kendall")      {       coef = linear.calcKendall(xy[i], xy[k], sig);   }                   
                     else { m->mothurOut("[ERROR]: invalid method, choices are spearman, pearson or kendall."); m->mothurOutEndLine(); m->control_pressed = true; }
                     
-                    if (sig < cutoff) { out << m->binLabelsInFile[i] << '\t' << m->binLabelsInFile[k] << '\t' << coef << '\t' << sig << endl; }
+                    if (sig < cutoff) { out << m->currentSharedBinLabels[i] << '\t' << m->currentSharedBinLabels[k] << '\t' << coef << '\t' << sig << endl; }
                 }
             }
                }else { //compare otus to metadata
@@ -540,7 +540,7 @@ int OTUAssociationCommand::process(vector<SharedRAbundFloatVector*>& lookup){
                     else if (method == "kendall")      {       coef = linear.calcKendall(xy[i], metadata[k], sig);     }                   
                     else { m->mothurOut("[ERROR]: invalid method, choices are spearman, pearson or kendall."); m->mothurOutEndLine(); m->control_pressed = true; }
                     
-                    if (sig < cutoff) { out << m->binLabelsInFile[i] << '\t' << metadataLabels[k] << '\t' << coef << '\t' << sig << endl; }
+                    if (sig < cutoff) { out << m->currentSharedBinLabels[i] << '\t' << metadataLabels[k] << '\t' << coef << '\t' << sig << endl; }
                 }
             }
             
@@ -572,6 +572,7 @@ int OTUAssociationCommand::readMetadata(){
                //save names of columns you are reading
                while (!iss.eof()) {
                        iss >> columnLabel; m->gobble(iss);
+            if (m->debug) { m->mothurOut("[DEBUG]: metadata column Label = " + columnLabel + "\n"); }
                        metadataLabels.push_back(columnLabel);
                }
                int count = metadataLabels.size();
@@ -583,6 +584,7 @@ int OTUAssociationCommand::readMetadata(){
                        
                        string group = "";
                        in >> group; m->gobble(in);
+            if (m->debug) { m->mothurOut("[DEBUG]: metadata group = " + group + "\n"); }
             
                        SharedRAbundFloatVector* tempLookup = new SharedRAbundFloatVector();
                        tempLookup->setGroup(group);
@@ -590,7 +592,8 @@ int OTUAssociationCommand::readMetadata(){
                        
                        for (int i = 0; i < count; i++) {
                                float temp = 0.0;
-                               in >> temp; 
+                               in >> temp;
+                if (m->debug) { m->mothurOut("[DEBUG]: metadata value = " + toString(temp) + "\n"); }
                                tempLookup->push_back(temp, group);
                        }