]> git.donarmstrong.com Git - mothur.git/blobdiff - validcalculator.cpp
working on search=dist in chimera.slayer
[mothur.git] / validcalculator.cpp
index 6242d5aaf5c7e49eb54a75b26a0eb48425302123..2798b53ba50c8f3ffd50a20fcaa7462d62a071a7 100644 (file)
@@ -447,6 +447,9 @@ void ValidCalculators::initialVennShared() {
 /********************************************************************/
 void ValidCalculators::initialTreeGroups() {
        try {   
+               treegroup["sharedsobs"]                         = "sharedsobs";
+               treegroup["sharedchao"]                         = "sharedchao";
+               treegroup["sharedace"]                          = "sharedace";
                treegroup["jabund"]                                     = "jabund";
                treegroup["sorabund"]                           = "sorabund";
                treegroup["jclass"]                                     = "jclass";
@@ -455,8 +458,35 @@ void ValidCalculators::initialTreeGroups() {
                treegroup["sorest"]                                     = "sorest";
                treegroup["thetayc"]                            = "thetayc";
                treegroup["thetan"]                                     = "thetan";
+               treegroup["kstest"]                                     = "kstest";
+               treegroup["whittaker"]                          = "whittaker";
+               treegroup["sharednseqs"]                        = "sharednseqs";
+               treegroup["ochiai"]                                     = "ochiai";
+               treegroup["anderberg"]                          = "anderberg";
+               treegroup["kulczynski"]                         = "kulczynski";
+               treegroup["kulczynskicody"]                     = "kulczynskicody";
+               treegroup["lennon"]                                     = "lennon";
                treegroup["morisitahorn"]                       = "morisitahorn";
                treegroup["braycurtis"]                         = "braycurtis";
+               treegroup["odum"]                                       = "odum";
+               treegroup["canberra"]                           = "canberra";
+               treegroup["structeuclidean"]            = "structeuclidean";
+               treegroup["structchord"]                        = "structchord";
+               treegroup["hellinger"]                          = "hellinger";
+               treegroup["manhattan"]                          = "manhattan";
+               treegroup["structpearson"]                      = "structpearson";
+               treegroup["structkulczynski"]           = "structkulczynski";
+               treegroup["structchi2"]                         = "structchi2";
+               treegroup["soergel"]                            = "soergel";
+               treegroup["spearman"]                           = "spearman";
+               treegroup["speciesprofile"]                     = "speciesprofile";
+               treegroup["hamming"]                            = "hamming";
+               treegroup["gower"]                                      = "gower";
+               treegroup["memchi2"]                            = "memchi2";
+               treegroup["memchord"]                           = "memchord";
+               treegroup["memeuclidean"]                       = "memeuclidean";
+               treegroup["mempearson"]                         = "mempearson";
+               
        }
        catch(exception& e) {
                m->errorOut(e, "ValidCalculator", "initialTreeGroups");
@@ -486,16 +516,46 @@ void ValidCalculators::initialHeat() {
 /********************************************************************/
 void ValidCalculators::initialMatrix() {
        try {   
-               matrix["jabund"]                                = "jabund";
+               matrix["sharedsobs"]                            = "sharedsobs";
+               matrix["sharedchao"]                            = "sharedchao";
+               matrix["sharedace"]                             = "sharedace";
+               matrix["jabund"]                                        = "jabund";
                matrix["sorabund"]                              = "sorabund";
-               matrix["jclass"]                                = "jclass";
+               matrix["jclass"]                                        = "jclass";
                matrix["sorclass"]                              = "sorclass";
                matrix["jest"]                                  = "jest";
-               matrix["sorest"]                                = "sorest";
+               matrix["sorest"]                                        = "sorest";
                matrix["thetayc"]                               = "thetayc";
-               matrix["thetan"]                                = "thetan";
+               matrix["thetan"]                                        = "thetan";
+               matrix["kstest"]                                        = "kstest";
+               matrix["whittaker"]                             = "whittaker";
+               matrix["sharednseqs"]                   = "sharednseqs";
+               matrix["ochiai"]                                        = "ochiai";
+               matrix["anderberg"]                             = "anderberg";
+               matrix["kulczynski"]                            = "kulczynski";
+               matrix["kulczynskicody"]                        = "kulczynskicody";
+               matrix["lennon"]                                        = "lennon";
                matrix["morisitahorn"]                  = "morisitahorn";
-               matrix["braycurtis"]                    = "braycurtis";
+               matrix["braycurtis"]                            = "braycurtis";
+               matrix["odum"]                                  = "odum";
+               matrix["canberra"]                              = "canberra";
+               matrix["structeuclidean"]               = "structeuclidean";
+               matrix["structchord"]                   = "structchord";
+               matrix["hellinger"]                             = "hellinger";
+               matrix["manhattan"]                             = "manhattan";
+               matrix["structpearson"]                 = "structpearson";
+               matrix["structkulczynski"]              = "structkulczynski";
+               matrix["structchi2"]                            = "structchi2";
+               matrix["soergel"]                               = "soergel";
+               matrix["spearman"]                              = "spearman";
+               matrix["speciesprofile"]                        = "speciesprofile";
+               matrix["hamming"]                               = "hamming";
+               matrix["gower"]                                 = "gower";
+               matrix["memchi2"]                               = "memchi2";
+               matrix["memchord"]                              = "memchord";
+               matrix["memeuclidean"]                  = "memeuclidean";
+               matrix["mempearson"]                            = "mempearson";
+               
        }
        catch(exception& e) {
                m->errorOut(e, "ValidCalculator", "initialMatrix");
@@ -606,4 +666,79 @@ void ValidCalculators::printCalc(string parameter, ostream& out) {
        }
 }
 /********************************************************************/
+string ValidCalculators::printCalc(string parameter) {
+       try{
+               string output = "The available estimators for calc are ";
+               //are you looking for a calculator for a single parameter
+               if (parameter == "single") {
+                       for (it = single.begin(); it != single.end(); it++) {
+                               output += it->first + ", ";
+                       }
+                       //are you looking for a calculator for a shared parameter
+               }else if (parameter == "shared") {
+                       for (it = shared.begin(); it != shared.end(); it++) {
+                               output += it->first + ", ";
+                       }
+                       //are you looking for a calculator for a rarefaction parameter
+               }else if (parameter == "rarefaction") {
+                       for (it = rarefaction.begin(); it != rarefaction.end(); it++) {
+                               output += it->first + ", ";
+                       }
+                       //are you looking for a calculator for a summary parameter
+               }else if (parameter == "summary") {
+                       for (it = summary.begin(); it != summary.end(); it++) {
+                               output += it->first + ", ";
+                       }
+                       //are you looking for a calculator for a sharedsummary parameter
+               }else if (parameter == "sharedsummary") {
+                       for (it = sharedsummary.begin(); it != sharedsummary.end(); it++) {
+                               output += it->first + ", ";
+                       }
+               }else if (parameter == "sharedrarefaction") {
+                       for (it = sharedrarefaction.begin(); it != sharedrarefaction.end(); it++) {
+                               output += it->first + ", ";
+                       }
+               }else if (parameter == "vennsingle") {
+                       for (it = vennsingle.begin(); it != vennsingle.end(); it++) {
+                               output += it->first + ", ";
+                       }
+               }else if (parameter == "vennshared") {
+                       for (it = vennshared.begin(); it != vennshared.end(); it++) {
+                               output += it->first + ", ";
+                       }
+               }else if (parameter == "treegroup") {
+                       for (it = treegroup.begin(); it != treegroup.end(); it++) {
+                               output += it->first + ", ";
+                       }
+               }else if (parameter == "matrix") {
+                       for (it = matrix.begin(); it != matrix.end(); it++) {
+                               output += it->first + ", ";
+                       }
+               }else if (parameter == "heat") {
+                       for (it = heat.begin(); it != heat.end(); it++) {
+                               output += it->first + ", ";
+                       }
+               }else if (parameter == "boot") {
+                       for (it = boot.begin(); it != boot.end(); it++) {
+                               output += it->first + ", ";
+                       }
+               }else if (parameter == "distance") {
+                       for (it = distance.begin(); it != distance.end(); it++) {
+                               output += it->first + ", ";
+                       }
+               }
+               
+               //rip off comma
+               output = output.substr(0, output.length()-1);
+               output += "\n";
+               
+               return output;
+       }
+       catch(exception& e) {
+               m->errorOut(e, "ValidCalculator", "printCalc");
+               exit(1);
+       }
+}
+/********************************************************************/
+