]> git.donarmstrong.com Git - mothur.git/blobdiff - summarysharedcommand.h
fixes while testing 1.33.0
[mothur.git] / summarysharedcommand.h
index fbfea7bd98fac33bb8570934b6bcd9e9d99ceaba..7a2a1909368fc9c71edbcbc90add7d3a966ac95d 100644 (file)
@@ -56,6 +56,8 @@
 #include "memchord.h"
 #include "memeuclidean.h"
 #include "mempearson.h"
+#include "sharedjsd.h"
+#include "sharedrjsd.h"
 
 class SummarySharedCommand : public Command {
 
@@ -67,7 +69,9 @@ public:
        vector<string> setParameters();
        string getCommandName()                 { return "summary.shared";                      }
        string getCommandCategory()             { return "OTU-Based Approaches";        }
+       
        string getHelpString(); 
+    string getOutputPattern(string);   
        string getCitation() { return "http://www.mothur.org/wiki/Summary.shared"; }
        string getDescription()         { return "generate a summary file containing calculator values for each line in the OTU data and for all possible comparisons between groups"; }
 
@@ -84,15 +88,16 @@ private:
        vector<Calculator*> sumCalculators;     
        InputData* input;
        
-       bool abort, allLines, mult, all, createPhylip;
+       bool abort, allLines, mult, all, createPhylip, subsample;
        set<string> labels; //holds labels to be used
-       string label, calc, groups, sharedfile;
+       string label, calc, groups, sharedfile, output;
        vector<string>  Estimators, Groups, outputNames;
        vector<SharedRAbundVector*> lookup;
        string format, outputDir;
-       int numGroups, processors;
+       int numGroups, processors, subsampleSize, iters;
        int process(vector<SharedRAbundVector*>, string, string);
        int driver(vector<SharedRAbundVector*>, int, int, string, string, vector< vector<seqDist> >&);
+    int printSims(ostream&, vector< vector<double> >&);
 
 };
 
@@ -109,6 +114,7 @@ struct summarySharedData {
        unsigned long long end;
        MothurOut* m;
        string sumFile;
+    int count;
        
        summarySharedData(){}
        summarySharedData(string sf, MothurOut* mout, unsigned long long st, unsigned long long en, vector<string> est, vector<SharedRAbundVector*> lu) {
@@ -118,6 +124,7 @@ struct summarySharedData {
                end = en;
         Estimators = est;
         thisLookup = lu;
+        count=0;
        }
 };
 /**************************************************************************************************/
@@ -211,6 +218,10 @@ static DWORD WINAPI MySummarySharedThreadFunction(LPVOID lpParam){
                     sumCalculators.push_back(new MemEuclidean());
                 }else if (pDataArray->Estimators[i] == "mempearson") { 
                     sumCalculators.push_back(new MemPearson());
+                }else if (pDataArray->Estimators[i] == "jsd") {
+                    sumCalculators.push_back(new JSD());
+                }else if (pDataArray->Estimators[i] == "rjsd") {
+                    sumCalculators.push_back(new RJSD());
                 }
             }
         }
@@ -222,7 +233,7 @@ static DWORD WINAPI MySummarySharedThreadFunction(LPVOID lpParam){
                
                vector<SharedRAbundVector*> subset;
                for (int k = pDataArray->start; k < pDataArray->end; k++) { // pass cdd each set of groups to compare
-            
+            pDataArray->count++;
                        for (int l = 0; l < k; l++) {
                                
                                outputFileHandle << pDataArray->thisLookup[0]->getLabel() << '\t';