]> git.donarmstrong.com Git - mothur.git/blobdiff - readotucommand.cpp
removed read.dist, read.otu, read.tree and globaldata. added current to defaults...
[mothur.git] / readotucommand.cpp
index 3d0b94d84fb4ec54fe14e4b07a6adfde21f6f432..19c936e4ec4fd069849ac413721f7501f4fbc3ad 100644 (file)
@@ -9,22 +9,12 @@
 
 #include "readotucommand.h"
 
-//**********************************************************************************************************************
-vector<string> ReadOtuCommand::getValidParameters(){   
-       try {
-               string Array[] =  {"list","order","shared","relabund","label","group","sabund", "rabund","groups","ordergroup","outputdir","inputdir"};
-               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
-               return myArray;
-       }
-       catch(exception& e) {
-               m->errorOut(e, "ReadOtuCommand", "getValidParameters");
-               exit(1);
-       }
-}
+
 //**********************************************************************************************************************
 ReadOtuCommand::ReadOtuCommand(){      
        try {
                abort = true; calledHelp = true; 
+               setParameters();
                vector<string> tempOutNames;
                outputTypes["rabund"] = tempOutNames;
                outputTypes["shared"] = tempOutNames;
@@ -35,32 +25,8 @@ ReadOtuCommand::ReadOtuCommand(){
        }
 }
 //**********************************************************************************************************************
-vector<string> ReadOtuCommand::getRequiredParameters(){        
-       try {
-               string Array[] =  {"list","shared","relabund","sabund","rabund","or"};
-               vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
-               return myArray;
-       }
-       catch(exception& e) {
-               m->errorOut(e, "ChopSeqsCommand", "getRequiredParameters");
-               exit(1);
-       }
-}
-//**********************************************************************************************************************
-vector<string> ReadOtuCommand::getRequiredFiles(){     
-       try {
-               vector<string> myArray;
-               return myArray;
-       }
-       catch(exception& e) {
-               m->errorOut(e, "ReadOtuCommand", "getRequiredFiles");
-               exit(1);
-       }
-}
-//**********************************************************************************************************************
 ReadOtuCommand::ReadOtuCommand(string option)  {
        try {
-               globaldata = GlobalData::getInstance();
                abort = false; calledHelp = false;   
                allLines = 1;
                
@@ -68,6 +34,7 @@ ReadOtuCommand::ReadOtuCommand(string option)  {
                if(option == "help") { help(); abort = true; calledHelp = true; }
                
                else {
+                       /*
                        //valid paramters for this command
                        string Array[] =  {"list","order","shared","relabund","label","group","sabund", "rabund","groups","ordergroup","outputdir","inputdir"};
                        vector<string> myArray (Array, Array+(sizeof(Array)/sizeof(string)));
@@ -246,6 +213,7 @@ ReadOtuCommand::ReadOtuCommand(string option)  {
                                //gets whichever one of the above is set
                                filename = globaldata->inputFileName;
                        }
+                        */
                }
 
        }
@@ -254,43 +222,15 @@ ReadOtuCommand::ReadOtuCommand(string option)  {
                exit(1);
        }
 }
-//**********************************************************************************************************************
-
-void ReadOtuCommand::help(){
-       try {
-               m->mothurOut("The read.otu command must be run before you execute a collect.single, rarefaction.single, summary.single, \n");
-               m->mothurOut("collect.shared, rarefaction.shared, summary.shared heatmap.bin, heatmap.sim or venn command.   Mothur will generate a .list, .rabund and .sabund upon completion of the cluster command \n");
-               m->mothurOut("or you may use your own. The read.otu command parameter options are list, rabund, sabund, shared, relabund, group, order, ordergroup, label and groups.\n");
-               m->mothurOut("The read.otu command can be used in two ways.  The first is to read a list, rabund or sabund and run the collect.single, rarefaction.single or summary.single.\n");
-               m->mothurOut("For this use the read.otu command should be in the following format: read.otu(list=yourListFile, order=yourOrderFile, label=yourLabels).\n");
-               m->mothurOut("The list, rabund or sabund parameter is required, but you may only use one of them.\n");
-               m->mothurOut("The label parameter is used to read specific labels in your input.\n");
-               m->mothurOut("The second way to use the read.otu command is to read a list and a group, or a shared so you can use the collect.shared, rarefaction.shared or summary.shared commands.\n");
-               m->mothurOut("In this case the read.otu command should be in the following format: read.otu(list=yourListFile, group=yourGroupFile) or read.otu(shared=yourSharedFile).  \n");
-               m->mothurOut("The list parameter and group paramaters or the shared paremeter is required. When using the command the second way with a list and group file read.otu command parses the .list file\n");
-               m->mothurOut("and separates it into groups.  It outputs a .shared file containing the OTU information for each group. The read.otu command also outputs a .rabund file for each group. \n");
-               m->mothurOut("You can use the groups parameter to choose only specific groups to be used in the .shared and .rabund files. \n");
-               m->mothurOut("You can use the ordergroup parameter to provide a file containing a list of group names in the order you would like them to appear in your shared file. \n");
-               m->mothurOut("Note: No spaces between parameter labels (i.e. list), '=' and parameters (i.e.yourListfile).\n\n");
-
-       }
-       catch(exception& e) {
-               m->errorOut(e, "ReadOtuCommand", "help");
-               exit(1);
-       }
-}
-
-
-
-//**********************************************************************************************************************
-ReadOtuCommand::~ReadOtuCommand(){}
-//**********************************************************************************************************************
+///**********************************************************************************************************************
 
 int ReadOtuCommand::execute(){
        try {
        
                if (abort == true) { if (calledHelp) { return 0; }  return 2;   }
+               m->mothurOut(getHelpString()); m->mothurOutEndLine();
        
+               /*
                if (globaldata->getFormat() == "shared") {
                        
                        shared = new SharedCommand(outputDir);
@@ -324,7 +264,7 @@ int ReadOtuCommand::execute(){
                        
                        delete shared;
                }
-               
+               */
                                
                return 0;
        }