]> git.donarmstrong.com Git - mothur.git/blobdiff - collectsharedcommand.cpp
working on pam
[mothur.git] / collectsharedcommand.cpp
index dd1ec270334e09f1d316ce060c2ab8c185e0d313..56e60d88bc88200a1b21d82d70b4a9c1f22ebdef 100644 (file)
@@ -49,6 +49,7 @@
 #include "memchord.h"
 #include "memeuclidean.h"
 #include "mempearson.h"
+#include "sharedjsd.h"
 
 
 //**********************************************************************************************************************
@@ -57,7 +58,7 @@ vector<string> CollectSharedCommand::setParameters(){
                CommandParameter pshared("shared", "InputTypes", "", "", "none", "none", "none","",false,true,true); parameters.push_back(pshared);
                CommandParameter plabel("label", "String", "", "", "", "", "","",false,false); parameters.push_back(plabel);
                CommandParameter pfreq("freq", "Number", "", "100", "", "", "","",false,false); parameters.push_back(pfreq);
-               CommandParameter pcalc("calc", "Multiple", "sharedchao-sharedsobs-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan-kstest-whittaker-sharednseqs-ochiai-anderberg-kulczynski-kulczynskicody-lennon-morisitahorn-braycurtis-odum-canberra-structeuclidean-structchord-hellinger-manhattan-structpearson-soergel-spearman-structkulczynski-speciesprofile-structchi2-hamming-gower-memchi2-memchord-memeuclidean-mempearson", "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan", "", "", "","",true,false,true); parameters.push_back(pcalc);
+               CommandParameter pcalc("calc", "Multiple", "sharedchao-sharedsobs-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan-kstest-whittaker-sharednseqs-ochiai-anderberg-kulczynski-kulczynskicody-lennon-morisitahorn-braycurtis-odum-canberra-structeuclidean-structchord-hellinger-manhattan-structpearson-soergel-spearman-structkulczynski-speciesprofile-structchi2-hamming-gower-memchi2-memchord-memeuclidean-mempearson-jsd", "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan", "", "", "","",true,false,true); parameters.push_back(pcalc);
                CommandParameter pall("all", "Boolean", "", "F", "", "", "","",false,false); parameters.push_back(pall);
                CommandParameter pgroups("groups", "String", "", "", "", "", "","",false,false); parameters.push_back(pgroups);
                CommandParameter pinputdir("inputdir", "String", "", "", "", "", "","",false,false); parameters.push_back(pinputdir);
@@ -89,7 +90,7 @@ string CollectSharedCommand::getHelpString(){
                helpString += "The all parameter is used to specify if you want the estimate of all your groups together.  This estimate can only be made for sharedsobs and sharedchao calculators. The default is false.\n";
                helpString += "If you use sharedchao and run into memory issues, set all to false. \n";
                helpString += "The groups parameter allows you to specify which of the groups in your groupfile you would like analyzed.  You must enter at least 2 valid groups.\n";
-               helpString += "Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile).\n";
+               helpString += "Note: No spaces between parameter labels (i.e. shared), '=' and parameters (i.e.yourSharedfile).\n";
                return helpString;
        }
        catch(exception& e) {
@@ -141,6 +142,7 @@ string CollectSharedCommand::getOutputPattern(string type) {
         else if (type == "memchord")            {  pattern =  "[filename],memchord";        }
         else if (type == "memeuclidean")        {  pattern =  "[filename],memeuclidean";    }
         else if (type == "mempearson")          {  pattern =  "[filename],mempearson";      }
+        else if (type == "jsd")                 {  pattern =  "[filename],jsd";             }
         else { m->mothurOut("[ERROR]: No definition for type " + type + " output pattern.\n"); m->control_pressed = true;  }
         
         return pattern;
@@ -196,6 +198,7 @@ CollectSharedCommand::CollectSharedCommand(){
                outputTypes["memchord"] = tempOutNames;
                outputTypes["memeuclidean"] = tempOutNames;
                outputTypes["mempearson"] = tempOutNames;
+        outputTypes["jsd"] = tempOutNames;
                
        }
        catch(exception& e) {
@@ -268,6 +271,7 @@ CollectSharedCommand::CollectSharedCommand(string option)  {
                        outputTypes["memchord"] = tempOutNames;
                        outputTypes["memeuclidean"] = tempOutNames;
                        outputTypes["mempearson"] = tempOutNames;
+            outputTypes["jsd"] = tempOutNames;
                        
                        
                        //if the user changes the input directory command factory will send this info to us in the output parameter 
@@ -460,6 +464,9 @@ CollectSharedCommand::CollectSharedCommand(string option)  {
                                                }else if (Estimators[i] == "mempearson") { 
                                                        cDisplays.push_back(new CollectDisplay(new MemPearson(), new SharedOneColumnFile(getOutputFileName("mempearson", variables))));
                                                        outputNames.push_back(getOutputFileName("mempearson", variables)); outputTypes["mempearson"].push_back(getOutputFileName("mempearson", variables));
+                                               }else if (Estimators[i] == "jsd") {
+                                                       cDisplays.push_back(new CollectDisplay(new JSD(), new SharedOneColumnFile(getOutputFileName("jsd", variables))));
+                                                       outputNames.push_back(getOutputFileName("jsd", variables)); outputTypes["jsd"].push_back(getOutputFileName("jsd", variables));
                                                }
                                                
                                        }