]> git.donarmstrong.com Git - mothur.git/blobdiff - globaldata.cpp
adding treeclimber and unifrac pieces
[mothur.git] / globaldata.cpp
index 87f1ccae776b9e435c00189ed63317e1595cc374..bc836e854cb3c4f1b7cc184789b0d49d6e8e3f45 100644 (file)
@@ -97,16 +97,16 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                                splitAtComma(value, optionText);
                                splitAtEquals(key, value);
                                
-                               if (key == "phylipfile" )       { phylipfile = value; inputFileName = value; fileroot = value; format = "phylip";       }
-                               if (key == "columnfile" )       { columnfile = value; inputFileName = value; fileroot = value; format = "column";       }
-                               if (key == "listfile" )         { listfile = value; inputFileName = value; fileroot = value; format = "list";           }
-                               if (key == "rabundfile" )       { rabundfile = value; inputFileName = value; fileroot = value; format = "rabund";       }
-                               if (key == "sabundfile" )       { sabundfile = value; inputFileName = value; fileroot = value; format = "sabund";       } 
-                               if (key == "fastafile" )        { fastafile = value; inputFileName = value; fileroot = value; format = "fasta";         } 
+                               if (key == "phylip" )   { phylipfile = value; inputFileName = value; fileroot = value; format = "phylip";       }
+                               if (key == "column" )   { columnfile = value; inputFileName = value; fileroot = value; format = "column";       }
+                               if (key == "list" )             { listfile = value; inputFileName = value; fileroot = value; format = "list";           }
+                               if (key == "rabund" )   { rabundfile = value; inputFileName = value; fileroot = value; format = "rabund";       }
+                               if (key == "sabund" )   { sabundfile = value; inputFileName = value; fileroot = value; format = "sabund";       } 
+                               if (key == "fasta" )    { fastafile = value; inputFileName = value; fileroot = value; format = "fasta";         } 
                                if (key == "treefile" )         { treefile = value; inputFileName = value; fileroot = value; format = "tree";           }
-                               if (key == "namefile" )         { namefile = value;             }
-                               if (key == "orderfile" )        { orderfile = value;    }
-                               if (key == "groupfile" )        { groupfile = value;    }
+                               if (key == "name" )             { namefile = value;             }
+                               if (key == "order" )    { orderfile = value;    }
+                               if (key == "group" )    { groupfile = value;    }
                                if (key == "cutoff" )           { cutoff = value;               }
                                if (key == "precision" )        { precision = value;    }
                                if (key == "iters" )            { iters = value;                }
@@ -114,6 +114,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 == "single") {//stores estimators in a vector
                                        singleEstimators.clear(); //clears out old values
@@ -145,33 +147,41 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                                        if (value == "default") { value = "sharedobserved"; }
                                        splitAtDash(value, sharedRareEstimators);
                                }
-                               if (key == "line") {//stores lines to be used in a vector
+                               if (key == "line") {//stores lines to be used in a set
                                        lines.clear();
                                        line = value;
+                                       label = "";
                                        splitAtDash(value, lines);
                                        allLines = 0;
                                }
-                               if (key == "label") {//stores lines to be used in a vector
+                               if (key == "label") {//stores lines to be used in a set
                                        labels.clear();
                                        label = value;
+                                       line = "";
                                        splitAtDash(value, labels);
                                        allLines = 0;
                                }
+                               if (key == "groups") {//stores lines to be used in a vector
+                                       Groups.clear();
+                                       groups = value;
+                                       splitAtDash(value, Groups);
+                               }
+
                        }
                        
                        //saves the last parameter
                        value = optionText;
                        splitAtEquals(key, value);
-                       if (key == "phylipfile" )       { phylipfile = value; inputFileName = value; fileroot = value; format = "phylip";       }
-                       if (key == "columnfile" )       { columnfile = value; inputFileName = value; fileroot = value; format = "column";       }
-                       if (key == "listfile" )         { listfile = value; inputFileName = value; fileroot = value; format = "list";           }
-                       if (key == "rabundfile" )       { rabundfile = value; inputFileName = value; fileroot = value; format = "rabund";       }
-                       if (key == "sabundfile" )       { sabundfile = value; inputFileName = value; fileroot = value; format = "sabund";       }
-                       if (key == "fastafile" )        { fastafile = value; inputFileName = value; fileroot = value; format = "fasta";         }
+                       if (key == "phylip" )   { phylipfile = value; inputFileName = value; fileroot = value; format = "phylip";       }
+                       if (key == "column" )   { columnfile = value; inputFileName = value; fileroot = value; format = "column";       }
+                       if (key == "list" )             { listfile = value; inputFileName = value; fileroot = value; format = "list";           }
+                       if (key == "rabund" )   { rabundfile = value; inputFileName = value; fileroot = value; format = "rabund";       }
+                       if (key == "sabund" )   { sabundfile = value; inputFileName = value; fileroot = value; format = "sabund";       }
+                       if (key == "fasta" )    { fastafile = value; inputFileName = value; fileroot = value; format = "fasta";         }
                        if (key == "treefile" )         { treefile = value; inputFileName = value; fileroot = value; format = "tree";           }  
-                       if (key == "namefile" )         { namefile = value;             }
-                       if (key == "orderfile" )        { orderfile = value;    }
-                       if (key == "groupfile" )        { groupfile = value;    }
+                       if (key == "name" )             { namefile = value;             }
+                       if (key == "order" )    { orderfile = value;    }
+                       if (key == "group" )    { groupfile = value;    }
                        if (key == "cutoff" )           { cutoff = value;               }
                        if (key == "precision" )        { precision = value;    }
                        if (key == "iters" )            { iters = value;                }
@@ -179,7 +189,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 == "single") {//stores estimators in a vector
                                singleEstimators.clear(); //clears out old values
                                if (value == "default") { value = "sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson-rarefraction"; }
@@ -214,12 +225,14 @@ void GlobalData::parseGlobalData(string commandString, string optionText){
                        if (key == "line") {//stores lines to be used in a vector
                                lines.clear();
                                line = value;
+                               label = "";
                                splitAtDash(value, lines);
                                allLines = 0;
                        }
                        if (key == "label") {//stores lines to be used in a vector
                                labels.clear();
                                label = value;
+                               line = "";
                                splitAtDash(value, labels);
                                allLines = 0;
                        }
@@ -289,14 +302,16 @@ string GlobalData::getFileRoot()          {       return fileroot;        }
 string GlobalData::getIters()                  {       return iters;           }
 string GlobalData::getJumble()                 {       return jumble;          }
 string GlobalData::getFreq()                   {       return freq;            }
+string GlobalData::getRandomTree()             {       return randomtree;      }
 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::setNameFile(string file)      {       namefile = file;        }
-void GlobalData::setFormat(string Format)      {       format = Format;        }
+//void GlobalData::setGroupFile(string file)   {       groupfile = file;               }
+void GlobalData::setNameFile(string file)              {       namefile = file;                }
+void GlobalData::setFormat(string Format)              {       format = Format;                }
+void GlobalData::setRandomTree(string Random)  {       randomtree = Random;    }
 
 
 /*******************************************************/
@@ -330,12 +345,13 @@ void GlobalData::clear() {
        iters                   =       "1000"; 
        line                    =   "";
        label                   =       "";
-       jumble                  =       "1";
+       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.
        freq                    =       "100";
        method                  =       "furthest";
        fileroot                =       "";
        single                  =       "sobs-chao-ace-jack-bootstrap-shannon-npshannon-simpson-rarefraction";
-       rarefaction             =       "rarefaction";
+       rarefaction             =       "sobs";
        shared                  =       "sharedSobs-sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN";
        sharedsummary   =   "sharedSobs-sharedChao-sharedAce-sharedJabund-sharedSorensonAbund-sharedJclass-sharedSorClass-sharedJest-sharedSorEst-SharedThetaYC-SharedThetaN";
        summary                 =       "summary-chao-ace-jack-bootstrap-shannon-npshannon-simpson";