]> git.donarmstrong.com Git - mothur.git/blob - kruskalwalliscommand.h
sffinfo bug with flow grams right index when clipQualRight=0
[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 #include "inputdata.h"
13 #include "sharedrabundvector.h"
14
15
16 class KruskalWallisCommand : public Command {
17    
18 public:
19             
20         KruskalWallisCommand(string);   
21         KruskalWallisCommand();
22         ~KruskalWallisCommand(){}
23         
24         vector<string> setParameters();
25         string getCommandName()                 { return "kruskalwallis";                       }
26         string getCommandCategory()             { return "Hypothesis Testing";  }
27     string getOutputPattern(string);    
28         string getHelpString(); 
29         string getCitation() { return "http://www.mothur.org/wiki/kruskalwallis"; }
30         string getDescription()         { return "Non-parametric method for testing whether samples originate from the same distribution."; }
31     
32     struct groupRank {
33         string group;
34         double value;
35         double rank;        
36     };
37     
38     int execute(); 
39         void help() { m->mothurOut(getHelpString()); }
40     void assignRank(vector<groupRank>&);
41     void assignValue(vector<groupRank>&);
42     
43     
44 private:
45     string outputDir, sharedfile, groups;
46     bool abort;
47     set<string> labels;
48     vector<string> outputNames, Groups;
49     vector<int> counts;
50     vector<double> rankSums;
51     vector<double> rankMeans;
52     
53   
54         
55     static bool comparevalue(const groupRank &a, const groupRank &b) { return a.value < b.value; }
56     static bool equalvalue(const groupRank &a, const groupRank &b) { return a.value == b.value; }
57     static bool comparerank(const groupRank &a, const groupRank &b) { return a.rank < b.rank; }
58     static bool equalrank(const groupRank &a, const groupRank &b) { return a.rank == b.rank; }
59     static bool equalgroup(const groupRank &a, const groupRank &b) { return a.group == b.group; }
60     
61 };
62
63 #endif  /* KRUSKALWALLISCOMMAND_H */
64