#include "command.hpp"
-class KruskalWallisCommand : public Command {
+class KruskalWallisCommand : public Command {
+
public:
-
+
KruskalWallisCommand(string);
KruskalWallisCommand();
~KruskalWallisCommand(){}
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<double,double> getRank(vector<KruskalWallisCommand::groupRank>);
+ void assignRank(vector<groupRank>&);
+
private:
string outputDir;
+ bool abort;
vector<int> counts;
vector<double> rankSums;
vector<double> rankMeans;
+
+
+ bool comparevalue(const groupRank &a, const groupRank &b) { return a.value < b.value; }
+ bool equalvalue(const groupRank &a, const groupRank &b) { return a.value == b.value; }
+ bool comparerank(const groupRank &a, const groupRank &b) { return a.rank < b.rank; }
+ bool equalrank(const groupRank &a, const groupRank &b) { return a.rank == b.rank; }
+ bool equalgroup(const groupRank &a, const groupRank &b) { return a.group == b.group; }
+
};
#endif /* KRUSKALWALLISCOMMAND_H */