]> git.donarmstrong.com Git - mothur.git/blobdiff - kruskalwalliscommand.h
Merge remote-tracking branch 'origin/master'
[mothur.git] / kruskalwalliscommand.h
index 7e526137bc42daa1928c7e0988e1b52d546dbf2a..da1166ed16a787adfaaf8a2e183afc8724f6f0a0 100644 (file)
@@ -9,11 +9,14 @@
 #define        KRUSKALWALLISCOMMAND_H
 
 #include "command.hpp"
+#include "inputdata.h"
+#include "sharedrabundvector.h"
 
-class KruskalWallisCommand : public Command {
 
+class KruskalWallisCommand : public Command {
+   
 public:
-       
+           
        KruskalWallisCommand(string);   
        KruskalWallisCommand();
        ~KruskalWallisCommand(){}
@@ -26,16 +29,35 @@ public:
        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>&);
+    void assignValue(vector<groupRank>&);
+    
     
 private:
-    string outputDir;
+    string outputDir, sharedfile, groups;
+    bool abort;
+    set<string> labels;
+    vector<string> outputNames, Groups;
     vector<int> counts;
     vector<double> rankSums;
     vector<double> rankMeans;
     
+  
+        
+    static bool comparevalue(const groupRank &a, const groupRank &b) { return a.value < b.value; }
+    static bool equalvalue(const groupRank &a, const groupRank &b) { return a.value == b.value; }
+    static bool comparerank(const groupRank &a, const groupRank &b) { return a.rank < b.rank; }
+    static bool equalrank(const groupRank &a, const groupRank &b) { return a.rank == b.rank; }
+    static bool equalgroup(const groupRank &a, const groupRank &b) { return a.group == b.group; }
+    
 };
 
 #endif /* KRUSKALWALLISCOMMAND_H */