]> git.donarmstrong.com Git - mothur.git/blobdiff - metastatscommand.cpp
added pcr.seqs command. fixed bug in rarefacftion.single that caused parsing error...
[mothur.git] / metastatscommand.cpp
index a0e6ed5d9bfe95b0fa6724aa05c8a06c4350762e..4744424d426d61243894d4779fa60dcd20781be3 100644 (file)
@@ -8,7 +8,6 @@
  */
 
 #include "metastatscommand.h"
-#include "metastats.h"
 #include "sharedutilities.h"
 
 
@@ -483,16 +482,26 @@ int MetaStatsCommand::driver(int start, int num, vector<SharedRAbundVector*>& th
                                m->mothurOut("Missing shared info for " + setA + " or " + setB + ". Skipping comparison."); m->mothurOutEndLine(); 
                                outputNames.pop_back();
                        }else {
+                
+                ofstream outTemp;
+                string tempOut = outputDir + "data." + setA + "-" + setB + ".matrix";
+                m->openOutputFile(tempOut, outTemp);
+                for (int i = 0; i < subset.size(); i++) { outTemp << '\t' << subset[i]->getGroup(); }
+                outTemp << endl;
+                
+                
                                //fill data
                                for (int j = 0; j < thisLookUp[0]->getNumBins(); j++) {
                                        //data[j] = new double[subset.size()];
                                        data2[j].resize(subset.size(), 0.0);
+                    outTemp << "OTU" << (j+1);
                                        for (int i = 0; i < subset.size(); i++) {
-                                               //data[j][i] = (subset[i]->getAbundance(j));
                                                data2[j][i] = (subset[i]->getAbundance(j));
+                        outTemp << '\t' << subset[i]->getAbundance(j);
                                        }
+                    outTemp << endl;
                                }
-                               
+                               outTemp.close();
                                m->mothurOut("Comparing " + setA + " and " + setB + "..."); m->mothurOutEndLine(); 
                                //metastat_main(output, thisLookUp[0]->getNumBins(), subset.size(), threshold, iters, data, setACount);
                                
@@ -500,7 +509,6 @@ int MetaStatsCommand::driver(int start, int num, vector<SharedRAbundVector*>& th
                                MothurMetastats mothurMeta(threshold, iters);
                                mothurMeta.runMetastats(outputFileName , data2, setACount);
                                m->mothurOutEndLine();
-                               
                                m->mothurOutEndLine(); 
                        }