]> git.donarmstrong.com Git - mothur.git/blobdiff - globaldata.cpp
fixed valid parameters to include shared parameter for read.shared command.
[mothur.git] / globaldata.cpp
index 0348ae6bca626342104591d945ff8acd951d835b..b1ac4e87b986cee6380c997c6c40590b089067f7 100644 (file)
@@ -67,13 +67,15 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                allLines = 1;
                commandName = commandString; //save command name to be used by other classes
                
-               //set all non filename paramters to default values
+               //set all non filename paramters to default
                reset();
                
                //clears out data from previous read
                if ((commandName == "read.dist") || (commandName == "read.otu") || (commandName == "read.tree") || (commandName == "read.shared")) { 
                        clear();
                        gGroupmap = NULL;
+                       gTree.clear();
+                       labels.clear(); lines.clear(); groups.clear();
                }
                
                //saves help request
@@ -106,9 +108,10 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                                if (key == "freq" )                     { freq = value;                 }
                                if (key == "method" )           { method = value;               }
                                if (key == "fileroot" )         { fileroot = value;             }
-                               if (key == "randomtree" )       { randomtree = value;   }
-                               if (key == "groups" )           { groups = value;       }
+                               if (key == "abund" )        { abund = value;        }
+                               if (key == "random" )           { randomtree = value;   }
                                if (key == "calc")                      { calc = value;         }
+
                                
                                if (key == "line") {//stores lines to be used in a set
                                        lines.clear();
@@ -124,11 +127,13 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                                        splitAtDash(value, labels);
                                        allLines = 0;
                                }
+
                                if (key == "groups") {//stores groups to be used in a vector
                                        Groups.clear();
                                        groups = value;
                                        splitAtDash(value, Groups);
                                }
+
                        }
                        
                        //saves the last parameter
@@ -152,8 +157,8 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                        if (key == "freq" )                     { freq = value;                 }
                        if (key == "method" )           { method = value;               }
                        if (key == "fileroot" )         { fileroot = value;             }
-                       if (key == "randomtree" )       { randomtree = value;   }
-                       if (key == "groups" )           { groups = value;       }
+                       if (key == "abund" )        { abund = value;        }
+                       if (key == "random" )           { randomtree = value;   }
                        if (key == "calc")                      { calc = value;         }
 
 
@@ -180,6 +185,7 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                
                //set format for shared
                if ((listfile != "") && (groupfile != "")) { format = "shared"; }
+               if ((phylipfile != "") && (groupfile != "")) { format = "matrix"; }
                                
                //input defaults for calculators
                if (commandName == "collect.single") {
@@ -252,7 +258,9 @@ string GlobalData::getFileRoot()            {       return fileroot;        }
 string GlobalData::getIters()                  {       return iters;           }
 string GlobalData::getJumble()                 {       return jumble;          }
 string GlobalData::getFreq()                   {       return freq;            }
+string GlobalData::getAbund()           {   return abund;       }
 string GlobalData::getRandomTree()             {       return randomtree;      }
+string GlobalData::getGroups()                 {       return groups;          }
 void GlobalData::setListFile(string file)      {       listfile = file;        inputFileName = file;}
 void GlobalData::setRabundFile(string file)    {       rabundfile = file;      inputFileName = file;}
 void GlobalData::setSabundFile(string file)    {       sabundfile = file;      inputFileName = file;}
@@ -261,7 +269,8 @@ void GlobalData::setColumnFile(string file) {       columnfile = file;    inputFileNam
 void GlobalData::setNameFile(string file)              {       namefile = file;                }
 void GlobalData::setFormat(string Format)              {       format = Format;                }
 void GlobalData::setRandomTree(string Random)  {       randomtree = Random;    }
-void GlobalData::setCalc(string Calc)                  {       calc = Calc;    }
+void GlobalData::setGroups(string g)                   {       groups = g;                             }
+void GlobalData::setCalc(string Calc)                  {       calc = Calc;                    }
 
 /*******************************************************/
 
@@ -295,13 +304,14 @@ void GlobalData::clear() {
        label                   =       "";
        groups                  =       "";
        jumble                  =       "1";    //0 means don't jumble, 1 means jumble.
-       randomtree              =       "0";  //0 means user will enter some user trees, 1 means they just want the random tree distribution.
+       randomtree              =       "";  //"" means user will enter some user trees, "outputfile" means they just want the random tree distribution to be outputted to outputfile.
        freq                    =       "100";
        method                  =       "furthest";
        fileroot                =       "";
-       calc                    =       "";
+       abund           =   "10";
 }
-/*******************************************************/
+
+//*******************************************************/
 
 /******************************************************/
 void GlobalData::reset() {
@@ -312,10 +322,11 @@ void GlobalData::reset() {
        label                   =       "";
        groups                  =       "";
        jumble                  =       "1";    //0 means don't jumble, 1 means jumble.
-       randomtree              =       "0";  //0 means user will enter some user trees, 1 means they just want the random tree distribution.
+       randomtree              =       "";  //"" means user will enter some user trees, "outputfile" means they just want the random tree distribution to be outputted to outputfile.
        freq                    =       "100";
        method                  =       "furthest";
        calc                    =       "";
+       abund = "10";
 }
 /*******************************************************/
 
@@ -327,6 +338,3 @@ GlobalData::~GlobalData() {
        if(gorder != NULL)                      {       delete gorder;          }
 }
 /*******************************************************/
-
-/******************************************************/
-