X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=kruskalwalliscommand.h;h=feefebd58fdb5650f41e9642a63e6dc68d011a24;hb=bd27c2b0612942815b7417c79f7ee41f669a2a34;hp=7e526137bc42daa1928c7e0988e1b52d546dbf2a;hpb=013ef8f1507c29ef442e47eb3538ecdd1ef6ddef;p=mothur.git diff --git a/kruskalwalliscommand.h b/kruskalwalliscommand.h index 7e52613..feefebd 100644 --- a/kruskalwalliscommand.h +++ b/kruskalwalliscommand.h @@ -9,11 +9,14 @@ #define KRUSKALWALLISCOMMAND_H #include "command.hpp" +#include "inputdata.h" +#include "sharedrabundvector.h" -class KruskalWallisCommand : public Command { +class KruskalWallisCommand : public Command { + public: - + KruskalWallisCommand(string); KruskalWallisCommand(); ~KruskalWallisCommand(){} @@ -21,21 +24,40 @@ public: vector setParameters(); string getCommandName() { return "kruskalwallis"; } string getCommandCategory() { return "Hypothesis Testing"; } - string getOutputFileNameTag(string, string); + string getOutputPattern(string); string getHelpString(); string getCitation() { return "http://www.mothur.org/wiki/kruskalwallis"; } string getDescription() { return "Non-parametric method for testing whether samples originate from the same distribution."; } + struct groupRank { + string group; + double value; + double rank; + }; + int execute(); void help() { m->mothurOut(getHelpString()); } - multimap getRank(vector); + void assignRank(vector&); + void assignValue(vector&); + private: - string outputDir; + string outputDir, sharedfile, groups; + bool abort; + set labels; + vector outputNames, Groups; vector counts; vector rankSums; vector rankMeans; + + + static bool comparevalue(const groupRank &a, const groupRank &b) { return a.value < b.value; } + static bool equalvalue(const groupRank &a, const groupRank &b) { return a.value == b.value; } + static bool comparerank(const groupRank &a, const groupRank &b) { return a.rank < b.rank; } + static bool equalrank(const groupRank &a, const groupRank &b) { return a.rank == b.rank; } + static bool equalgroup(const groupRank &a, const groupRank &b) { return a.group == b.group; } + }; #endif /* KRUSKALWALLISCOMMAND_H */