]> git.donarmstrong.com Git - mothur.git/blob - kruskalwalliscommand.h
updated kruskalwallis struct
[mothur.git] / kruskalwalliscommand.h
1 /* 
2  * File:   kruskalwalliscommand.h
3  * Author: kiverson
4  *
5  * Created on June 26, 2012, 11:07 AM
6  */
7
8 #ifndef KRUSKALWALLISCOMMAND_H
9 #define KRUSKALWALLISCOMMAND_H
10
11 #include "command.hpp"
12
13
14 class KruskalWallisCommand : public Command {
15    
16 public:
17             
18         KruskalWallisCommand(string);   
19         KruskalWallisCommand();
20         ~KruskalWallisCommand(){}
21         
22         vector<string> setParameters();
23         string getCommandName()                 { return "kruskalwallis";                       }
24         string getCommandCategory()             { return "Hypothesis Testing";  }
25         string getOutputFileNameTag(string, string);
26         string getHelpString(); 
27         string getCitation() { return "http://www.mothur.org/wiki/kruskalwallis"; }
28         string getDescription()         { return "Non-parametric method for testing whether samples originate from the same distribution."; }
29     
30     struct groupRank {
31         string group;
32         double value;
33         double rank;        
34     };
35     
36     int execute(); 
37         void help() { m->mothurOut(getHelpString()); }
38     void assignRank(vector<groupRank>&);
39     
40     
41 private:
42     string outputDir;
43     bool abort;
44     vector<int> counts;
45     vector<double> rankSums;
46     vector<double> rankMeans;
47     
48   
49         
50     bool comparevalue(const groupRank &a, const groupRank &b) { return a.value < b.value; }
51     bool equalvalue(const groupRank &a, const groupRank &b) { return a.value == b.value; }
52     bool comparerank(const groupRank &a, const groupRank &b) { return a.rank < b.rank; }
53     bool equalrank(const groupRank &a, const groupRank &b) { return a.rank == b.rank; }
54     bool equalgroup(const groupRank &a, const groupRank &b) { return a.group == b.group; }
55     
56 };
57
58 #endif  /* KRUSKALWALLISCOMMAND_H */
59