]> git.donarmstrong.com Git - mothur.git/commitdiff
updated kruskalwallis struct
authorKathryn Iverson <kd.iverson@gmail.com>
Thu, 28 Jun 2012 20:17:15 +0000 (16:17 -0400)
committerKathryn Iverson <kd.iverson@gmail.com>
Thu, 28 Jun 2012 20:17:15 +0000 (16:17 -0400)
kruskalwalliscommand.cpp
kruskalwalliscommand.h

index f67fef89f65c53964a354023ed20a7bbc00f3c3f..946701bd46268a59556df9757c3fefba4ecbfd49 100644 (file)
@@ -7,7 +7,7 @@
 #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);
@@ -117,7 +117,7 @@ KruskalWallisCommand::KruskalWallisCommand(string option) {
                m->errorOut(e, "KruskalWallisCommand", "KruskalWallisCommand");
                exit(1);
        }
-}
+}**/
 //**********************************************************************************************************************
 int KruskalWallisCommand::execute(){
        try {
@@ -176,7 +176,7 @@ int KruskalWallisCommand::execute(){
 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);
@@ -186,7 +186,7 @@ void KruskalWallisCommand::assignRank(vector<groupRank> &vec) {
         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);
index 3b5fdcea8975ecc774116fc4f8a824d0db8e64aa..1aadb16e807c8e69d563f4a94abe23dc74c26d19 100644 (file)
@@ -11,7 +11,6 @@
 #include "command.hpp"
 
 
-
 class KruskalWallisCommand : public Command {
    
 public:
@@ -29,17 +28,19 @@ 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;