]> 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
15 class KruskalWallisCommand : public Command {
16    
17 public:
18             
19         KruskalWallisCommand(string);   
20         KruskalWallisCommand();
21         ~KruskalWallisCommand(){}
22         
23         vector<string> setParameters();
24         string getCommandName()                 { return "kruskalwallis";                       }
25         string getCommandCategory()             { return "Hypothesis Testing";  }
26         string getOutputFileNameTag(string, string);
27         string getHelpString(); 
28         string getCitation() { return "http://www.mothur.org/wiki/kruskalwallis"; }
29         string getDescription()         { return "Non-parametric method for testing whether samples originate from the same distribution."; }
30     
31     struct groupRank {
32         sstring group;
33         double value;
34         double rank;        
35     };
36     
37     int execute(); 
38         void help() { m->mothurOut(getHelpString()); }
39     void assignRank(vector<groupRank>);
40     
41 private:
42     string outputDir;
43     vector<int> counts;
44     vector<double> rankSums;
45     vector<double> rankMeans;
46     
47   
48         
49     bool comparevalue(const groupRank &a, const groupRank &b) { return a.value < b.value; }
50     bool equalvalue(const groupRank &a, const groupRank &b) { return a.value == b.value; }
51     bool comparerank(const groupRank &a, const groupRank &b) { return a.rank < b.rank; }
52     bool equalrank(const groupRank &a, const groupRank &b) { return a.rank == b.rank; }
53     bool equalgroup(const groupRank &a, const groupRank &b) { return a.group == b.group; }
54     
55 };
56
57 #endif  /* KRUSKALWALLISCOMMAND_H */
58