]> git.donarmstrong.com Git - mothur.git/blobdiff - globaldata.cpp
fixed multiple bugs for 1.4 release
[mothur.git] / globaldata.cpp
index 16d434bcb47dbd18e91914214cd8fda032e9f47b..02b9013887308ef118212b2d7fb06d14b0fd6012 100644 (file)
@@ -28,7 +28,7 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                        gGroupmap = NULL;
                        gTree.clear();
                        Treenames.clear();
-                       labels.clear(); lines.clear(); groups.clear();
+                       labels.clear(); lines.clear(); Groups.clear();
                        allLines = 1;
                }
                
@@ -80,13 +80,13 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                                if (key == "sorted")            { sorted = value;               }
                                if (key == "vertical")          { vertical = value;             }
                                if (key == "trump")                 { trump = value;            }
-                               if (key == "filter")            { filter = value;               }
+                               if (key == "hard")                      { hard = value;         }
                                if (key == "soft")                  { soft = value;                 }
                                if (key == "scale")                     { scale = value;                }
-                               if (key == "ends" )                     { ends = value;                 }
+                               if (key == "countends" )        { countends = value;    }
                                if (key == "processors" )       { processors = value;   }
                                if (key == "size" )         { size = value;         }
-                               if (key == "template")          { templatefile = value; }
+                               if (key == "candidate")         { candidatefile = value;        }
                                if (key == "search")            { search = value;               }
                                if (key == "ksize")                     { ksize = value;                }
                                if (key == "align")                 { align = value;            }
@@ -151,13 +151,13 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                        if (key == "sorted")            { sorted = value;               }
                        if (key == "vertical")          { vertical = value;             }
                        if (key == "trump")                 { trump = value;            }
-                       if (key == "filter")            { filter = value;               }
+                       if (key == "hard")                      { hard = value;         }
                        if (key == "soft")                  { soft = value;                 }
                        if (key == "scale")                     { scale = value;                }
-                       if (key == "ends" )                     { ends = value;                 }
+                       if (key == "countends" )        { countends = value;    }
                        if (key == "processors" )       { processors = value;   }
                        if (key == "size" )         { size = value;         }
-                       if (key == "template")          { templatefile = value; }
+                       if (key == "candidate")         { candidatefile = value;        }
                        if (key == "search")            { search = value;               }
                        if (key == "ksize")                     { ksize = value;                }
                        if (key == "align")                 { align = value;            }
@@ -198,7 +198,7 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                //input defaults for calculators
                if (commandName == "collect.single") {
 
-                       if ((calc == "default") || (calc == "")) { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson-efron-boneh-solow-shen"; }
+                       if ((calc == "default") || (calc == "")) { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson"; }
                        Estimators.clear();
                        splitAtDash(calc, Estimators); 
                }
@@ -214,7 +214,7 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                        splitAtDash(calc, Estimators); 
                }
                if (commandName == "summary.single") {
-                       if ((calc == "default") || (calc == "")) { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson-efron-boneh-solow-shen"; }
+                       if ((calc == "default") || (calc == "")) { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson"; }
                        Estimators.clear();
                        splitAtDash(calc, Estimators); 
                }
@@ -229,7 +229,8 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                        splitAtDash(calc, Estimators); 
                }
                if (commandName == "dist.seqs") {
-                       if ((calc == "default") || (calc == "")) {  calc = "onegap";  }
+                       if ((calc == "default") || (calc == "")) {  calc = "onegap";    }
+                       if (countends == "")    { countends = "T"; }
                        Estimators.clear();
                        splitAtDash(calc, Estimators); 
                }
@@ -242,12 +243,19 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                        splitAtDash(calc, Estimators); 
                }
                if ((commandName == "tree.shared") || (commandName == "bootstrap.shared") || (commandName == "dist.shared")) {
-                       if (calc != "") { 
-                               Estimators.clear();
-                               splitAtDash(calc, Estimators);                  
-                       }else { cout << "You have not specified any calculators." << endl; }
+                       if ((calc == "default") || (calc == "")) { 
+                               calc = "jclass-thetayc";
+                       }
+                       Estimators.clear();
+                       splitAtDash(calc, Estimators); 
                }
+               
+               if(commandName == "filter.seqs"){
+                       if(trump == "" && vertical == "" && hard == "" && soft == ""){
+                               trump = '.';
+                       }
 
+               }
 
                //if you have done a read.otu with a groupfile but don't want to use it anymore because you want to do single commands
                if ((commandName == "collect.single") || (commandName == "rarefaction.single") || (commandName == "summary.single")) {
@@ -296,14 +304,15 @@ string GlobalData::getGroups()                    {       return groups;          }
 string GlobalData::getStep()                   {       return step;            }
 string GlobalData::getForm()                   {       return form;            }
 string GlobalData::getSorted()                 {       return sorted;          }
+string GlobalData::getVertical()               {   return vertical;    }
 string GlobalData::getTrump()                  {   return trump;       }
 string GlobalData::getSoft()                   {   return soft;                }
-string GlobalData::getFilter()                 {   return filter;              }
+string GlobalData::getHard()                   {   return hard;                }
 string GlobalData::getScale()                  {       return scale;           }
-string GlobalData::getEnds()                   {   return ends;                }
+string GlobalData::getCountEnds()              {   return countends;   }
 string GlobalData::getProcessors()             {       return processors;      }
 string GlobalData::getSize()            {   return size;        }
-string GlobalData::getTemplateFile()   {       return templatefile;}
+string GlobalData::getCandidateFile()  {       return candidatefile;}
 string GlobalData::getSearch()                 {       return search;          }
 string GlobalData::getKSize()                  {       return ksize;           }
 string GlobalData::getAlign()                  {       return align;           }
@@ -313,19 +322,19 @@ string GlobalData::getGapopen()                   {       return gapopen;         }
 string GlobalData::getGapextend()              {       return gapextend;       }
 
 
-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;}
-void GlobalData::setPhylipFile(string file)    {       phylipfile = file;    inputFileName = file;}
-void GlobalData::setColumnFile(string file)    {       columnfile = file;    inputFileName = file;}
-void GlobalData::setGroupFile(string file)             {       groupfile = file;       }
-void GlobalData::setSharedFile(string file)            {       sharedfile = file;      inputFileName = file; fileroot = file;}
+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;                                   }
+void GlobalData::setPhylipFile(string file)            {       phylipfile = file;    inputFileName = file;                                     }
+void GlobalData::setColumnFile(string file)            {       columnfile = file;    inputFileName = file;                                     }
+void GlobalData::setGroupFile(string file)             {       groupfile = file;                                                                                       }
+void GlobalData::setSharedFile(string file)            {       sharedfile = file;      inputFileName = file; fileroot = file;  }
 void GlobalData::setNameFile(string file)              {       namefile = file;                }
 void GlobalData::setFormat(string Format)              {       format = Format;                }
 void GlobalData::setRandomTree(string Random)  {       randomtree = Random;    }
 void GlobalData::setGroups(string g)                   {       groups = g;                             }
 void GlobalData::setCalc(string Calc)                  {       calc = Calc;                    }
-void GlobalData::setEnds(string e)                             {   ends = e;                           }
+void GlobalData::setCountEnds(string e)                        {   countends = e;                      }
 void GlobalData::setProcessors(string p)               {       processors = p;                 }
 
 
@@ -357,7 +366,7 @@ void GlobalData::clear() {
        clustalfile             =   "";
        treefile                =       "";
        sharedfile              =       "";
-       templatefile    =       "";
+       candidatefile   =       "";
        cutoff                  =       "10.00";
        format                  =       "";
        precision               =       "100";
@@ -375,19 +384,19 @@ void GlobalData::clear() {
        form                    =       "integral";
        sorted                  =       "T";  //F means don't sort, T means sort.
        vertical        =   "";         
-       trump           =   "";         
-       filter          =   "";         
+       trump           =       "";             
+       hard                    =   "";         
        soft            =   ""; 
        scale                   =       "log10";
-       ends                    =   "T";  //yes
+       countends               =   "T";  //yes
        processors              =       "1";
-       size            =   "1000";
-       search                  =       "suffix";
+       size            =   "0";
+       search                  =       "kmer";
        ksize                   =       "7";
-       align                   =       "blast";
+       align                   =       "needleman";
        match                   =       "1.0";
        mismatch                =       "-1.0";
-       gapopen                 =       "-5.0";
+       gapopen                 =       "-1.0";
        gapextend               =       "-2.0";
 }
 
@@ -408,16 +417,21 @@ void GlobalData::reset() {
        abund                   =   "10";
        step                    =       "0.01";
        form                    =       "integral";
-       ends                    =   "T";
+       countends               =   "T";
        processors              =       "1";
-       size            =   "1000";
-       search                  =       "suffix";
+       size            =   "0";
+       search                  =       "kmer";
        ksize                   =       "7";
-       align                   =       "blast";
+       align                   =       "needleman";
        match                   =       "1.0";
        mismatch                =       "-1.0";
-       gapopen                 =       "-5.0";
+       gapopen                 =       "-1.0";
        gapextend               =       "-2.0";
+       vertical        =   "";         
+       trump           =   "";         
+       hard                    =   "";         
+       soft            =   ""; 
+
 }
 /*******************************************************/