]> git.donarmstrong.com Git - mothur.git/blobdiff - globaldata.cpp
fixed memory issue with cluster command
[mothur.git] / globaldata.cpp
index 66a44f25b7246af237194e634eeeeb9514623899..60a106a17eb6ce31e75b51a088bb2261e1815361 100644 (file)
@@ -16,50 +16,6 @@ GlobalData* GlobalData::getInstance() {
 }
 /*******************************************************/
 
-/******************************************************/
-
-ListVector* GlobalData::getListVector()                {       return gListVector;             }
-/*******************************************************/
-
-/******************************************************/
-void GlobalData::setListVector(ListVector* lv){
-       try {
-               if(gListVector != NULL){        delete gListVector;     }
-               gListVector = new ListVector(*lv);
-       }
-       catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the GlobalData class Function setListVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-       catch(...) {
-               cout << "An unknown error has occurred in the GlobalData class function setListVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-}
-/*******************************************************/
-
-/******************************************************/
-
-SparseMatrix* GlobalData::getSparseMatrix()    {       return gSparseMatrix;   }
-/*******************************************************/
-
-/******************************************************/
-void GlobalData::setSparseMatrix(SparseMatrix* sm){
-       try{
-               if(gSparseMatrix != NULL){      delete gSparseMatrix;   }
-               gSparseMatrix = new SparseMatrix(*sm);
-       }
-       catch(exception& e) {
-               cout << "Standard Error: " << e.what() << " has occurred in the GlobalData class Function setSparseMatrix. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-       catch(...) {
-               cout << "An unknown error has occurred in the GlobalData class function setSparseMatrix. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
-               exit(1);
-       }
-}
-/*******************************************************/
-
 /******************************************************/
 //This function parses through the option string of the command to remove its parameters
 void GlobalData::parseGlobalData(string commandString, string optionText){
@@ -110,7 +66,6 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                                if (key == "fileroot" )         { fileroot = value;             }
                                if (key == "abund" )        { abund = value;        }
                                if (key == "random" )           { randomtree = value;   }
-                               if (key == "groups" )           { groups = value;       }
                                if (key == "calc")                      { calc = value;         }
 
                                
@@ -160,7 +115,6 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                        if (key == "fileroot" )         { fileroot = value;             }
                        if (key == "abund" )        { abund = value;        }
                        if (key == "random" )           { randomtree = value;   }
-                       if (key == "groups" )           { groups = value;       }
                        if (key == "calc")                      { calc = value;         }
 
 
@@ -187,6 +141,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") {
@@ -261,6 +216,7 @@ 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;}
@@ -269,7 +225,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;                    }
 
 /*******************************************************/