]> git.donarmstrong.com Git - mothur.git/blobdiff - globaldata.cpp
fixed multiple bugs for 1.4 release
[mothur.git] / globaldata.cpp
index fddb5c9caadb3e2e7fcaf7f940718eacb6c39e30..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;
                }
                
@@ -43,7 +43,7 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                }
                
                //set default value for cutoff
-               if (commandName == "dist.seq") {        cutoff = "1.0";         }
+               if (commandName == "dist.seqs") {       cutoff = "1.0";         }
 
                string key, value;              
                //reads in parameters and values
@@ -80,15 +80,20 @@ 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 == "candidate")         { candidatefile = value;        }
+                               if (key == "search")            { search = value;               }
+                               if (key == "ksize")                     { ksize = value;                }
+                               if (key == "align")                 { align = value;            }
+                               if (key == "match")                     { match = value;                }
+                               if (key == "mismatch")          { mismatch = value;         }
+                               if (key == "gapopen")           { gapopen = value;              }
+                               if (key == "gapextend" )        { gapextend = value;    }
                                
                                if (key == "line") {//stores lines to be used in a set
                                        lines.clear();
@@ -146,12 +151,20 @@ 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 == "candidate")         { candidatefile = value;        }
+                       if (key == "search")            { search = value;               }
+                       if (key == "ksize")                     { ksize = value;                }
+                       if (key == "align")                 { align = value;            }
+                       if (key == "match")                     { match = value;                }
+                       if (key == "mismatch")          { mismatch = value;         }
+                       if (key == "gapopen")           { gapopen = value;              }
+                       if (key == "gapextend" )        { gapextend = value;    }
 
                        if (key == "line") {//stores lines to be used in a vector
                                lines.clear();
@@ -215,8 +228,9 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                        Estimators.clear();
                        splitAtDash(calc, Estimators); 
                }
-               if (commandName == "dist.seq") {
-                       if ((calc == "default") || (calc == "")) {  calc = "onegap";  }
+               if (commandName == "dist.seqs") {
+                       if ((calc == "default") || (calc == "")) {  calc = "onegap";    }
+                       if (countends == "")    { countends = "T"; }
                        Estimators.clear();
                        splitAtDash(calc, Estimators); 
                }
@@ -228,13 +242,20 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                        Estimators.clear();
                        splitAtDash(calc, Estimators); 
                }
-               if ((commandName == "tree.shared") || (commandName == "bootstrap.shared")) {
-                       if (calc != "") { 
-                               Estimators.clear();
-                               splitAtDash(calc, Estimators);                  
-                       }else { cout << "You have not specified any calculators." << endl; }
+               if ((commandName == "tree.shared") || (commandName == "bootstrap.shared") || (commandName == "dist.shared")) {
+                       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")) {
@@ -283,26 +304,37 @@ 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;      }
-
-void GlobalData::setListFile(string file)              {       listfile = file;        inputFileName = file;}
-void GlobalData::setGroupFile(string file)             {       groupfile = 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::setSharedFile(string file)            {       sharedfile = file;      inputFileName = file; fileroot = file;}
+string GlobalData::getSize()            {   return size;        }
+string GlobalData::getCandidateFile()  {       return candidatefile;}
+string GlobalData::getSearch()                 {       return search;          }
+string GlobalData::getKSize()                  {       return ksize;           }
+string GlobalData::getAlign()                  {       return align;           }
+string GlobalData::getMatch()                  {       return match;           }
+string GlobalData::getMismatch()               {       return mismatch;        }
+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::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;                 }
 
 
@@ -334,6 +366,7 @@ void GlobalData::clear() {
        clustalfile             =   "";
        treefile                =       "";
        sharedfile              =       "";
+       candidatefile   =       "";
        cutoff                  =       "10.00";
        format                  =       "";
        precision               =       "100";
@@ -351,13 +384,20 @@ 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            =   "0";
+       search                  =       "kmer";
+       ksize                   =       "7";
+       align                   =       "needleman";
+       match                   =       "1.0";
+       mismatch                =       "-1.0";
+       gapopen                 =       "-1.0";
+       gapextend               =       "-2.0";
 }
 
 //*******************************************************/
@@ -377,8 +417,21 @@ void GlobalData::reset() {
        abund                   =   "10";
        step                    =       "0.01";
        form                    =       "integral";
-       ends                    =   "T";
+       countends               =   "T";
        processors              =       "1";
+       size            =   "0";
+       search                  =       "kmer";
+       ksize                   =       "7";
+       align                   =       "needleman";
+       match                   =       "1.0";
+       mismatch                =       "-1.0";
+       gapopen                 =       "-1.0";
+       gapextend               =       "-2.0";
+       vertical        =   "";         
+       trump           =   "";         
+       hard                    =   "";         
+       soft            =   ""; 
+
 }
 /*******************************************************/