X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=matrixoutputcommand.h;h=5ddfb2c1c788e2d09f0f7ffcf4658a04f9e79c47;hp=748d8c23e426d69a295a6487454404c5a0598177;hb=cf9987b67aa49777a4c91c2d21f96e58bf17aa82;hpb=b9800d7b05252b911b10d36febfb5e6da3271766 diff --git a/matrixoutputcommand.h b/matrixoutputcommand.h index 748d8c2..5ddfb2c 100644 --- a/matrixoutputcommand.h +++ b/matrixoutputcommand.h @@ -54,6 +54,7 @@ #include "memchord.h" #include "memeuclidean.h" #include "mempearson.h" +#include "sharedjsd.h" // aka. dist.shared() @@ -73,7 +74,9 @@ public: vector setParameters(); string getCommandName() { return "dist.shared"; } string getCommandCategory() { return "OTU-Based Approaches"; } + string getHelpString(); + string getOutputPattern(string); string getCitation() { return "http://www.mothur.org/wiki/Dist.shared"; } string getDescription() { return "generate a distance matrix that describes the dissimilarity among multiple groups"; } @@ -88,7 +91,7 @@ private: }; vector lines; - void printSims(ostream&, vector< vector >&); + void printSims(ostream&, vector< vector >&); int process(vector); vector matrixCalculators; @@ -96,12 +99,12 @@ private: InputData* input; vector lookup; string exportFileName, output, sharedfile; - int numGroups, processors; + int numGroups, processors, iters, subsampleSize; ofstream out; - bool abort, allLines; + bool abort, allLines, subsample; set labels; //holds labels to be used - string outputFile, calc, groups, label, outputDir; + string outputFile, calc, groups, label, outputDir, mode; vector Estimators, Groups, outputNames; //holds estimators to be used int process(vector, string, string); int driver(vector, int, int, vector< vector >&); @@ -110,7 +113,6 @@ private: /**************************************************************************************************/ //custom data structure for threads to use. -//main process handling the calcs that can do more than 2 groups // This is passed by void pointer so it can be any data type // that can be passed using a single void pointer (LPVOID). struct distSharedData { @@ -120,6 +122,7 @@ struct distSharedData { unsigned long long start; unsigned long long end; MothurOut* m; + int count; distSharedData(){} distSharedData(MothurOut* mout, unsigned long long st, unsigned long long en, vector est, vector lu) { @@ -128,10 +131,11 @@ struct distSharedData { end = en; Estimators = est; thisLookup = lu; + count = 0; } }; /**************************************************************************************************/ -#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) +#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux) || (__linux__) || (__unix__) || (__unix) #else static DWORD WINAPI MyDistSharedThreadFunction(LPVOID lpParam){ distSharedData* pDataArray; @@ -221,7 +225,10 @@ static DWORD WINAPI MyDistSharedThreadFunction(LPVOID lpParam){ matrixCalculators.push_back(new MemEuclidean()); }else if (pDataArray->Estimators[i] == "mempearson") { matrixCalculators.push_back(new MemPearson()); + }else if (pDataArray->Estimators[i] == "jsd") { + matrixCalculators.push_back(new JSD()); } + } } @@ -229,7 +236,7 @@ static DWORD WINAPI MyDistSharedThreadFunction(LPVOID lpParam){ vector 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++) { if (k != l) { //we dont need to similiarity of a groups to itself