X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=treegroupscommand.h;h=36c852bd8ef545894b9aa00245064eb112e236c6;hp=d3c1b3e47615fb6d3b342c8d41758aa7b9d9178a;hb=b206f634aae1b4ce13978d203247fb64757d5482;hpb=0caf3fbabaa3ece404f8ce77f4c883dc5b1bf1dc diff --git a/treegroupscommand.h b/treegroupscommand.h index d3c1b3e..36c852b 100644 --- a/treegroupscommand.h +++ b/treegroupscommand.h @@ -15,11 +15,10 @@ #include "groupmap.h" #include "validcalculator.h" #include "tree.h" -#include "treemap.h" +#include "counttable.h" #include "readmatrix.hpp" #include "readcolumn.h" #include "readphylip.h" -#include "sparsematrix.hpp" #include "sharedsobscollectsummary.h" #include "sharedchao1.h" #include "sharedace.h" @@ -69,8 +68,6 @@ They can also use as many or as few calculators as they wish. */ -typedef list::iterator MatData; - class TreeGroupCommand : public Command { public: @@ -81,7 +78,9 @@ public: vector setParameters(); string getCommandName() { return "tree.shared"; } string getCommandCategory() { return "OTU-Based Approaches"; } + string getHelpString(); + string getOutputPattern(string); string getCitation() { return "http://www.mothur.org/wiki/Tree.shared"; } string getDescription() { return "generate a tree file that describes the dissimilarity among groups"; } @@ -100,21 +99,19 @@ private: Tree* createTree(vector< vector >&); void printSims(ostream&, vector< vector >&); int makeSimsShared(); - vector< vector > makeSimsDist(); + vector< vector > makeSimsDist(SparseDistanceMatrix*); int writeTree(string, Tree*); int driver(vector, int, int, vector< vector >&); - ReadMatrix* readMatrix; - SparseMatrix* matrix; NameAssignment* nameMap; ListVector* list; - TreeMap* tmap; + CountTable* ct; Tree* t; InputData* input; vector treeCalculators; vector lookup; string lastLabel; - string format, groupNames, filename, sharedfile, inputfile; + string format, groupNames, filename, sharedfile, countfile, inputfile; int numGroups, subsampleSize, iters, processors; ofstream out; float precision, cutoff; @@ -142,6 +139,7 @@ struct treeSharedData { unsigned long long start; unsigned long long end; MothurOut* m; + int count; treeSharedData(){} treeSharedData(MothurOut* mout, unsigned long long st, unsigned long long en, vector est, vector lu) { @@ -150,6 +148,7 @@ struct treeSharedData { end = en; Estimators = est; thisLookup = lu; + count=0; } }; /**************************************************************************************************/ @@ -252,6 +251,8 @@ static DWORD WINAPI MyTreeSharedThreadFunction(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