#include "kruskalwalliscommand.h"
//**********************************************************************************************************************
-vector<string> KruskalWallisCommand::setParameters(){
+/*vector<string> KruskalWallisCommand::setParameters(){
try {
CommandParameter pinputdir("inputdir", "String", "", "", "", "", "",false,false); parameters.push_back(pinputdir);
CommandParameter poutputdir("outputdir", "String", "", "", "", "", "",false,false); parameters.push_back(poutputdir);
m->errorOut(e, "KruskalWallisCommand", "KruskalWallisCommand");
exit(1);
}
-}
+}**/
//**********************************************************************************************************************
int KruskalWallisCommand::execute(){
try {
void KruskalWallisCommand::assignRank(vector<groupRank> &vec) {
try {
double rank = 1;
- double numRanks, avgRank;
+ double numRanks, avgRank, j;
vector<groupRank>::iterator it, oldit;
sort (vec.begin(), vec.end(), comparevalue);
while ( it != vec.end() ) {
j = rank;
oldit = it;
- if (!equalvalue(*it, *it+1)) { *it->rank = rank; rank++; it++; }
+ if (!equalvalue(*it, *it+1)) { *it->rank = rank; rank=rank+1; it++; }
else {
while(equalrank(*it, *it+1)) {
j = j + (j+1.0);
#include "command.hpp"
-
class KruskalWallisCommand : public Command {
public:
string getDescription() { return "Non-parametric method for testing whether samples originate from the same distribution."; }
struct groupRank {
- sstring group;
+ string group;
double value;
double rank;
};
int execute();
void help() { m->mothurOut(getHelpString()); }
- void assignRank(vector<groupRank>);
+ void assignRank(vector<groupRank>&);
+
private:
string outputDir;
+ bool abort;
vector<int> counts;
vector<double> rankSums;
vector<double> rankMeans;