]> git.donarmstrong.com Git - mothur.git/blob - globaldata.cpp
405e646a5276e9afa8acaa2b5d0dee776e35b94e
[mothur.git] / globaldata.cpp
1 #include "globaldata.hpp"
2 #include "tree.h"
3 #include "sparsematrix.hpp"
4
5 /*******************************************************/
6
7 /******************************************************/
8 GlobalData* GlobalData::getInstance() {
9         if( _uniqueInstance == 0 ) {
10                 _uniqueInstance = new GlobalData();
11         }
12         return _uniqueInstance;
13 }
14 /*******************************************************/
15
16 /******************************************************/
17 //This function parses through the option string of the command to remove its parameters
18 void GlobalData::parseGlobalData(string commandString, string optionText){
19         try {
20                 commandName = commandString; //save command name to be used by other classes
21                 
22                 //set all non filename paramters to default
23                 reset();
24                 
25                 //clears out data from previous read
26                 if ((commandName == "read.dist") || (commandName == "read.otu") || (commandName == "read.tree")) { 
27                         clear();
28                         gGroupmap = NULL;
29                         gListVector = NULL;
30                         gSparseMatrix = NULL;
31                         gTree.clear();
32                         Treenames.clear();
33                         labels.clear(); lines.clear(); Groups.clear();
34                         allLines = 1;
35                 }
36                 
37                 //saves help request
38                 if (commandName =="help") {
39                         helpRequest = optionText;
40                 }
41                 
42                 if (commandName == "libshuff") {
43                         iters = "10000";
44                         cutoff = "1.0";
45                 }
46                 
47                 //set default value for cutoff
48                 if (commandName == "dist.seqs") {       cutoff = "1.0";         }
49
50                 string key, value;              
51                 //reads in parameters and values
52                 if((optionText != "") && (commandName != "help")){
53                         while((optionText.find_first_of(',') != -1)) {  //while there are parameters
54                                 splitAtComma(value, optionText);
55                                 splitAtEquals(key, value);
56                                 
57                                 if (key == "phylip" )   { phylipfile = value; inputFileName = value; fileroot = value; format = "phylip";       }
58                                 if (key == "column" )   { columnfile = value; inputFileName = value; fileroot = value; format = "column";       }
59                                 if (key == "list" )             { listfile = value; inputFileName = value; fileroot = value; format = "list";           }
60                                 if (key == "rabund" )   { rabundfile = value; inputFileName = value; fileroot = value; format = "rabund";       }
61                                 if (key == "sabund" )   { sabundfile = value; inputFileName = value; fileroot = value; format = "sabund";       } 
62                                 if (key == "fasta" )    { fastafile = value; inputFileName = value; fileroot = value; format = "fasta";         }
63                                 if (key == "nexus" )    { nexusfile = value; inputFileName = value; fileroot = value; format = "nexus";         } 
64                                 if (key == "clustal" )  { clustalfile = value; inputFileName = value; fileroot = value; format = "clustal"; }
65                                 if (key == "tree" )             { treefile = value; inputFileName = value; fileroot = value; format = "tree";           }
66                                 if (key == "shared" )   { sharedfile = value; inputFileName = value; fileroot = value; format = "sharedfile";   }
67                                 if (key == "name" )             { namefile = value;             }
68                                 if (key == "order" )    { orderfile = value;    }
69                                 if (key == "group" )    { groupfile = value;    }
70                                 if (key == "cutoff" )           { cutoff = value;               }
71                                 if (key == "precision" )        { precision = value;    }
72                                 if (key == "iters" )            { iters = value;                }
73                                 if (key == "jumble" )           { jumble = value;               }
74                                 if (key == "freq" )                     { freq = value;                 }
75                                 if (key == "method" )           { method = value;               }
76                                 if (key == "fileroot" )         { fileroot = value;             }
77                                 if (key == "abund" )        { abund = value;        }
78                                 if (key == "random" )           { randomtree = value;   }
79                                 if (key == "calc")                      { calc = value;                 }
80                                 if (key == "step")                      { step = value;                 }
81                                 if (key == "form")                      { form = value;                 }
82                                 if (key == "sorted")            { sorted = value;               }
83                                 if (key == "vertical")          { vertical = value;             }
84                                 if (key == "trump")                 { trump = value;            }
85                                 if (key == "hard")                      { hard = value;         }
86                                 if (key == "soft")                  { soft = value;                 }
87                                 if (key == "scale")                     { scale = value;                }
88                                 if (key == "countends" )        { countends = value;    }
89                                 if (key == "processors" )       { processors = value;   }
90                                 if (key == "size" )         { size = value;         }
91                                 if (key == "candidate")         { candidatefile = value;        }
92                                 if (key == "search")            { search = value;               }
93                                 if (key == "ksize")                     { ksize = value;                }
94                                 if (key == "align")                 { align = value;            }
95                                 if (key == "match")                     { match = value;                }
96                                 if (key == "mismatch")          { mismatch = value;         }
97                                 if (key == "gapopen")           { gapopen = value;              }
98                                 if (key == "gapextend" )        { gapextend = value;    }
99                                 
100                                 if (key == "line") {//stores lines to be used in a set
101                                         lines.clear();
102                                         labels.clear();
103                                         line = value;
104                                         label = "";
105                                         splitAtDash(value, lines);
106                                         allLines = 0;
107                                 }
108                                 if (key == "label") {//stores labels to be used in a set
109                                         labels.clear();
110                                         lines.clear();
111                                         label = value;
112                                         line = "";
113                                         splitAtDash(value, labels);
114                                         allLines = 0;
115                                 }
116
117                                 if (key == "groups") {//stores groups to be used in a vector
118                                         Groups.clear();
119                                         groups = value;
120                                         splitAtDash(value, Groups);
121                                 }
122
123                         }
124                         
125                         //saves the last parameter
126                         value = optionText;
127                         splitAtEquals(key, value);
128                         if (key == "phylip" )   { phylipfile = value; inputFileName = value; fileroot = value; format = "phylip";       }
129                         if (key == "column" )   { columnfile = value; inputFileName = value; fileroot = value; format = "column";       }
130                         if (key == "list" )             { listfile = value; inputFileName = value; fileroot = value; format = "list";           }
131                         if (key == "rabund" )   { rabundfile = value; inputFileName = value; fileroot = value; format = "rabund";       }
132                         if (key == "sabund" )   { sabundfile = value; inputFileName = value; fileroot = value; format = "sabund";       }
133                         if (key == "fasta" )    { fastafile = value; inputFileName = value; fileroot = value; format = "fasta";         }
134                         if (key == "nexus" )    { nexusfile = value; inputFileName = value; fileroot = value; format = "nexus";         }
135                         if (key == "clustal" )  { clustalfile = value; inputFileName = value; fileroot = value; format = "clustal"; } 
136                         if (key == "tree" )             { treefile = value; inputFileName = value; fileroot = value; format = "tree";           } 
137                         if (key == "shared" )   { sharedfile = value; inputFileName = value; fileroot = value; format = "sharedfile";   } 
138                         if (key == "name" )             { namefile = value;             }
139                         if (key == "order" )    { orderfile = value;    }
140                         if (key == "group" )    { groupfile = value;    }
141                         if (key == "cutoff" )           { cutoff = value;               }
142                         if (key == "precision" )        { precision = value;    }
143                         if (key == "iters" )            { iters = value;                }
144                         if (key == "jumble" )           { jumble = value;               }
145                         if (key == "freq" )                     { freq = value;                 }
146                         if (key == "method" )           { method = value;               }
147                         if (key == "fileroot" )         { fileroot = value;             }
148                         if (key == "abund" )        { abund = value;        }
149                         if (key == "random" )           { randomtree = value;   }
150                         if (key == "calc")                      { calc = value;                 }
151                         if (key == "step")                      { step = value;                 }
152                         if (key == "form")                      { form = value;                 }
153                         if (key == "sorted")            { sorted = value;               }
154                         if (key == "vertical")          { vertical = value;             }
155                         if (key == "trump")                 { trump = value;            }
156                         if (key == "hard")                      { hard = value;         }
157                         if (key == "soft")                  { soft = value;                 }
158                         if (key == "scale")                     { scale = value;                }
159                         if (key == "countends" )        { countends = value;    }
160                         if (key == "processors" )       { processors = value;   }
161                         if (key == "size" )         { size = value;         }
162                         if (key == "candidate")         { candidatefile = value;        }
163                         if (key == "search")            { search = value;               }
164                         if (key == "ksize")                     { ksize = value;                }
165                         if (key == "align")                 { align = value;            }
166                         if (key == "match")                     { match = value;                }
167                         if (key == "mismatch")          { mismatch = value;         }
168                         if (key == "gapopen")           { gapopen = value;              }
169                         if (key == "gapextend" )        { gapextend = value;    }
170
171                         if (key == "line") {//stores lines to be used in a vector
172                                 lines.clear();
173                                 labels.clear();
174                                 line = value;
175                                 label = "";
176                                 if (line != "all") {  splitAtDash(value, lines);  allLines = 0;  }
177                                 else { allLines = 1;  }
178                         }
179                         
180                         if (key == "label") {//stores lines to be used in a vector
181                                 labels.clear();
182                                 lines.clear();
183                                 label = value;
184                                 line = "";
185                                 if (label != "all") {  splitAtDash(value, labels);  allLines = 0;  }
186                                 else { allLines = 1;  }
187                         }
188                         
189                         if (key == "groups") {//stores groups to be used in a vector
190                                         Groups.clear();
191                                         groups = value;
192                                         splitAtDash(value, Groups);
193                         }
194                 }
195                 
196                 //set format for shared
197                 if ((listfile != "") && (groupfile != "")) { format = "shared"; }
198                 if ((phylipfile != "") && (groupfile != "")) { format = "matrix"; }
199                                 
200                 //input defaults for calculators
201                 if (commandName == "collect.single") {
202
203                         if ((calc == "default") || (calc == "")) { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson"; }
204                         Estimators.clear();
205                         splitAtDash(calc, Estimators); 
206                 }
207                 if (commandName == "rarefaction.single") {
208                         if ((calc == "default") || (calc == "")) { calc = "sobs"; }
209                         Estimators.clear();
210                         splitAtDash(calc, Estimators); 
211                 }
212                 if (commandName == "collect.shared") {
213
214                         if ((calc == "default") || (calc == "")) { calc = "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan"; }
215                         Estimators.clear();
216                         splitAtDash(calc, Estimators); 
217                 }
218                 if (commandName == "summary.single") {
219                         if ((calc == "default") || (calc == "")) { calc = "sobs-chao-ace-jack-shannon-npshannon-simpson"; }
220                         Estimators.clear();
221                         splitAtDash(calc, Estimators); 
222                 }
223                 if (commandName == "summary.shared") {
224                         if ((calc == "default") || (calc == "")) { calc = "sharedsobs-sharedchao-sharedace-jabund-sorabund-jclass-sorclass-jest-sorest-thetayc-thetan"; }
225                         Estimators.clear();
226                         splitAtDash(calc, Estimators); 
227                 }
228                 if (commandName == "rarefaction.shared") {
229                         if ((calc == "default") || (calc == "")) { calc = "sharedobserved"; }
230                         Estimators.clear();
231                         splitAtDash(calc, Estimators); 
232                 }
233                 if (commandName == "dist.seqs") {
234                         if ((calc == "default") || (calc == "")) {  calc = "onegap";    }
235                         if (countends == "")    { countends = "T"; }
236                         Estimators.clear();
237                         splitAtDash(calc, Estimators); 
238                 }
239                 if (commandName == "venn") {
240                         if ((calc == "default") || (calc == "")) { 
241                                 if (format == "list") { calc = "sobs"; }
242                                 else { calc = "sharedsobs"; }
243                         }
244                         Estimators.clear();
245                         splitAtDash(calc, Estimators); 
246                 }
247                 if ((commandName == "tree.shared") || (commandName == "bootstrap.shared") || (commandName == "dist.shared")) {
248                         if ((calc == "default") || (calc == "")) { 
249                                 calc = "jclass-thetayc";
250                         }
251                         Estimators.clear();
252                         splitAtDash(calc, Estimators); 
253                 }
254                 
255                 if(commandName == "filter.seqs"){
256                         if(trump == "" && vertical == "" && hard == "" && soft == ""){
257                                 trump = '.';
258                         }
259
260                 }
261
262                 //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
263                 if ((commandName == "collect.single") || (commandName == "rarefaction.single") || (commandName == "summary.single")) {
264                         if (listfile != "") { format = "list"; }
265                         else if (sabundfile != "") { format = "sabund"; }
266                         else if (rabundfile != "") { format = "rabund"; }
267                 }
268         }
269         catch(exception& e) {
270                 cout << "Standard Error: " << e.what() << " has occurred in the GlobalData class Function parseGlobalData. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
271                 exit(1);
272         }
273         catch(...) {
274                 cout << "An unknown error has occurred in the GlobalData class function parseGlobalData. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
275                 exit(1);
276         }
277 }
278 /*******************************************************/
279
280 /******************************************************/
281 // These functions give you the option parameters of the commands
282 string GlobalData::getPhylipFile()              {       return phylipfile;      }
283 string GlobalData::getColumnFile()              {       return columnfile;      }
284 string GlobalData::getListFile()                {       return listfile;        }
285 string GlobalData::getRabundFile()              {       return rabundfile;      }
286 string GlobalData::getSabundFile()              {       return sabundfile;      }
287 string GlobalData::getNameFile()                {       return namefile;        }
288 string GlobalData::getGroupFile()               {       return groupfile;       }
289 string GlobalData::getOrderFile()               {       return orderfile;       }
290 string GlobalData::getTreeFile()                {       return treefile;        }
291 string GlobalData::getSharedFile()              {       return sharedfile;      }
292 string GlobalData::getFastaFile()               {       return fastafile;       }
293 string GlobalData::getNexusFile()               {       return nexusfile;       }
294 string GlobalData::getClustalFile()     {   return clustalfile; }
295 string GlobalData::getCutOff()                  {       return cutoff;          }
296 string GlobalData::getFormat()                  {       return format;          }
297 string GlobalData::getPrecision()               {       return precision;       }
298 string GlobalData::getMethod()                  {       return method;          }
299 string GlobalData::getFileRoot()                {       return fileroot;        }
300 string GlobalData::getIters()                   {       return iters;           }
301 string GlobalData::getJumble()                  {       return jumble;          }
302 string GlobalData::getFreq()                    {       return freq;            }
303 string GlobalData::getAbund()           {   return abund;       }
304 string GlobalData::getRandomTree()              {       return randomtree;      }
305 string GlobalData::getGroups()                  {       return groups;          }
306 string GlobalData::getStep()                    {       return step;            }
307 string GlobalData::getForm()                    {       return form;            }
308 string GlobalData::getSorted()                  {       return sorted;          }
309 string GlobalData::getVertical()                {   return vertical;    }
310 string GlobalData::getTrump()                   {   return trump;       }
311 string GlobalData::getSoft()                    {   return soft;                }
312 string GlobalData::getHard()                    {   return hard;                }
313 string GlobalData::getScale()                   {       return scale;           }
314 string GlobalData::getCountEnds()               {   return countends;   }
315 string GlobalData::getProcessors()              {       return processors;      }
316 string GlobalData::getSize()            {   return size;        }
317 string GlobalData::getCandidateFile()   {       return candidatefile;}
318 string GlobalData::getSearch()                  {       return search;          }
319 string GlobalData::getKSize()                   {       return ksize;           }
320 string GlobalData::getAlign()                   {       return align;           }
321 string GlobalData::getMatch()                   {       return match;           }
322 string GlobalData::getMismatch()                {       return mismatch;        }
323 string GlobalData::getGapopen()                 {       return gapopen;         }
324 string GlobalData::getGapextend()               {       return gapextend;       }
325
326
327 void GlobalData::setListFile(string file)               {       listfile = file;        inputFileName = file;                                   }
328 void GlobalData::setRabundFile(string file)             {       rabundfile = file;      inputFileName = file;                                   }
329 void GlobalData::setSabundFile(string file)             {       sabundfile = file;      inputFileName = file;                                   }
330 void GlobalData::setPhylipFile(string file)             {       phylipfile = file;    inputFileName = file;                                     }
331 void GlobalData::setColumnFile(string file)             {       columnfile = file;    inputFileName = file;                                     }
332 void GlobalData::setGroupFile(string file)              {       groupfile = file;                                                                                       }
333 void GlobalData::setSharedFile(string file)             {       sharedfile = file;      inputFileName = file; fileroot = file;  }
334 void GlobalData::setNameFile(string file)               {       namefile = file;                }
335 void GlobalData::setFormat(string Format)               {       format = Format;                }
336 void GlobalData::setRandomTree(string Random)   {       randomtree = Random;    }
337 void GlobalData::setGroups(string g)                    {       groups = g;                             }
338 void GlobalData::setCalc(string Calc)                   {       calc = Calc;                    }
339 void GlobalData::setCountEnds(string e)                 {   countends = e;                      }
340 void GlobalData::setProcessors(string p)                {       processors = p;                 }
341
342
343 /*******************************************************/
344
345 /******************************************************/
346 GlobalData::GlobalData() {
347         //option definitions should go here...
348         helpRequest = "";
349         clear();
350         gListVector == NULL;            
351         gSparseMatrix == NULL;  
352 }
353 /*******************************************************/
354
355 /******************************************************/
356 void GlobalData::clear() {
357         //option definitions should go here...
358         phylipfile              =       "";
359         columnfile              =       "";
360         listfile                =       "";
361         rabundfile              =       "";
362         sabundfile              =       "";
363         namefile                =       "";
364         groupfile               =       ""; 
365         orderfile               =       "";
366         fastafile               =   "";
367         nexusfile               =   "";
368         clustalfile             =   "";
369         treefile                =       "";
370         sharedfile              =       "";
371         candidatefile   =       "";
372         cutoff                  =       "10.00";
373         format                  =       "";
374         precision               =       "100";
375         iters                   =       "1000"; 
376         line                    =   "";
377         label                   =       "";
378         groups                  =       "";
379         jumble                  =       "1";    //0 means don't jumble, 1 means jumble.
380         randomtree              =       "";  //"" means user will enter some user trees, "outputfile" means they just want the random tree distribution to be outputted to outputfile.
381         freq                    =       "100";
382         method                  =       "furthest";
383         fileroot                =       "";
384         abund           =   "10";
385         step                    =       "0.01";
386         form                    =       "integral";
387         sorted                  =       "T";  //F means don't sort, T means sort.
388         vertical        =   "";         
389         trump           =       "";             
390         hard                    =   "";         
391         soft            =   ""; 
392         scale                   =       "log10";
393         countends               =   "T";  //yes
394         processors              =       "1";
395         size            =   "0";
396         search                  =       "kmer";
397         ksize                   =       "7";
398         align                   =       "needleman";
399         match                   =       "1.0";
400         mismatch                =       "-1.0";
401         gapopen                 =       "-1.0";
402         gapextend               =       "-2.0";
403 }
404
405 //*******************************************************/
406
407 /******************************************************/
408 void GlobalData::reset() {
409         cutoff                  =       "10.00";
410         precision               =       "100";
411         iters                   =       "1000"; 
412         groups                  =       "";
413         jumble                  =       "1";    //0 means don't jumble, 1 means jumble.
414         sorted                  =       "T";  //F means don't sort, T means sort.
415         randomtree              =       "";  //"" means user will enter some user trees, "outputfile" means they just want the random tree distribution to be outputted to outputfile.
416         freq                    =       "100";
417         method                  =       "furthest";
418         calc                    =       "";
419         abund                   =   "10";
420         step                    =       "0.01";
421         form                    =       "integral";
422         countends               =   "T";
423         processors              =       "1";
424         size            =   "0";
425         search                  =       "kmer";
426         ksize                   =       "7";
427         align                   =       "needleman";
428         match                   =       "1.0";
429         mismatch                =       "-1.0";
430         gapopen                 =       "-1.0";
431         gapextend               =       "-2.0";
432         vertical        =   "";         
433         trump           =   "";         
434         hard                    =   "";         
435         soft            =   ""; 
436
437 }
438 /*******************************************************/
439
440 /******************************************************/
441 GlobalData::~GlobalData() {
442         _uniqueInstance = 0;
443         if(gListVector != NULL)         {       delete gListVector;             }
444         if(gSparseMatrix != NULL)       {       delete gSparseMatrix;   }
445         if(gorder != NULL)                      {       delete gorder;          }
446 }
447 /*******************************************************/
448
449 /*******************************************************/
450 void GlobalData::parseTreeFile() {
451         //only takes names from the first tree and assumes that all trees use the same names.
452         try {
453                 string filename = treefile;
454                 ifstream filehandle;
455                 openInputFile(filename, filehandle);
456                 int c, comment;
457                 comment = 0;
458                 
459                 //if you are not a nexus file 
460                 if ((c = filehandle.peek()) != '#') {  
461                         while((c = filehandle.peek()) != ';') { 
462                                 while ((c = filehandle.peek()) != ';') {
463                                         // get past comments
464                                         if(c == '[') {
465                                                 comment = 1;
466                                         }
467                                         if(c == ']'){
468                                                 comment = 0;
469                                         }
470                                         if((c == '(') && (comment != 1)){ break; }
471                                         filehandle.get();
472                                 }
473
474                                 readTreeString(filehandle); 
475                         }
476                 //if you are a nexus file
477                 }else if ((c = filehandle.peek()) == '#') {
478                         string holder = "";
479                                         
480                         // get past comments
481                         while(holder != "translate" && holder != "Translate"){  
482                                 if(holder == "[" || holder == "[!"){
483                                         comment = 1;
484                                 }
485                                 if(holder == "]"){
486                                         comment = 0;
487                                 }
488                                 filehandle >> holder; 
489         
490                                 //if there is no translate then you must read tree string otherwise use translate to get names
491                                 if(holder == "tree" && comment != 1){   
492                                         //pass over the "tree rep.6878900 = "
493                                         while (((c = filehandle.get()) != '(') && ((c = filehandle.peek()) != EOF) ) {;}
494
495                                         if (c == EOF ) { break; }
496                                         filehandle.putback(c);  //put back first ( of tree.
497                                         readTreeString(filehandle);     
498                                         break;
499                                 }
500                         }
501                         
502                         //use nexus translation rather than parsing tree to save time
503                         if ((holder == "translate") || (holder == "Translate")) {
504
505                                 string number, name, h;
506                                 h = ""; // so it enters the loop the first time
507                                 while((h != ";") && (number != ";")) { 
508                                         filehandle >> number;
509                                         filehandle >> name;
510         
511                                         //c = , until done with translation then c = ;
512                                         h = name.substr(name.length()-1, name.length()); 
513                                         name.erase(name.end()-1);  //erase the comma
514                                         Treenames.push_back(number);
515                                 }
516                                 if (number == ";") { Treenames.pop_back(); }  //in case ';' from translation is on next line instead of next to last name
517                         }
518                 }
519                 
520         }
521         catch(exception& e) {
522                 cout << "Standard Error: " << e.what() << " has occurred in the GlobalData class Function parseTreeFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
523                 exit(1);
524         }
525         catch(...) {
526                 cout << "An unknown error has occurred in the GlobalData class function parseTreeFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
527                 exit(1);
528         }               
529 }
530 /*******************************************************/
531
532 /*******************************************************/
533 void GlobalData::readTreeString(ifstream& filehandle)   {
534         try {
535                 int c;
536                 string name; //k
537                 
538                 while((c = filehandle.peek()) != ';') { 
539                                 //if you are a name
540                         if ((c != '(') && (c != ')') && (c != ',') && (c != ':') && (c != '\n') && (c != '\t') && (c != 32)) { //32 is space
541                                 name = "";
542                                 c = filehandle.get();
543         //              k = c;
544 //cout << k << endl;
545                                 while ((c != '(') && (c != ')') && (c != ',') && (c != ':') && (c != '\n') && (c != 32) && (c != '\t')) {                       
546                                         name += c;
547                                         c = filehandle.get();
548                 //      k = c;
549 //cout << " in name while " << k << endl;
550                                 }
551                                 
552 //cout << "name = " << name << endl;
553                                 Treenames.push_back(name);
554                                 filehandle.putback(c);
555 //k = c;
556 //cout << " after putback" <<  k << endl;
557                         } 
558                         
559                         if (c  == ':') { //read until you reach the end of the branch length
560                                 while ((c != '(') && (c != ')') && (c != ',') && (c != ';') && (c != '\n') && (c != '\t') && (c != 32)) {
561                                         c = filehandle.get();
562                                 //      k = c;
563         //cout << " in branch while " << k << endl;
564                                 }
565                                 filehandle.putback(c);
566                         }
567                         c = filehandle.get();
568                         if (c == ';') { break; }
569                 //      k = c;
570 //cout << k << endl;
571
572                 }
573         }
574         catch(exception& e) {
575                 cout << "Standard Error: " << e.what() << " has occurred in the GlobalData class Function parseTreeFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
576                 exit(1);
577         }
578         catch(...) {
579                 cout << "An unknown error has occurred in the GlobalData class function parseTreeFile. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
580                 exit(1);
581         }               
582 }       
583
584 /*******************************************************/
585
586 /*******************************************************/
587
588