]> git.donarmstrong.com Git - mothur.git/blob - taxonomyequalizer.h
9f38b2f2a29756d751f10b6b8e97b4cc3925bd00
[mothur.git] / taxonomyequalizer.h
1 #ifndef TAXONOMYEQUALIZER_H
2 #define TAXONOMYEQUALIZER_H
3
4
5 /*
6  *  taxonomyequalizer.h
7  *  Mothur
8  *
9  *  Created by westcott on 11/20/09.
10  *  Copyright 2009 Schloss Lab. All rights reserved.
11  *
12  */
13
14 #include "mothur.h"
15
16 //reads in taxonomy file and makes all the taxonomies the same length 
17 //by appending the last taxon to a given taxonomy as many times as needed to 
18 //make it as long as the longest taxonomy in the file 
19
20 /**************************************************************************************************/
21
22 class TaxEqualizer  {
23         
24 public:
25         TaxEqualizer(string, int);
26         ~TaxEqualizer() {};
27         
28         string getEqualizedTaxFile()    {       return equalizedFile;   }
29         int getHighestLevel()                   {       return highestLevel;    }
30         
31         
32 private:
33         string equalizedFile, testTax;
34         bool containsConfidence;
35         int cutoff, highestLevel;
36         map<string, int> seqLevels;  //maps name to level of taxonomy
37         
38         int getHighestLevel(ifstream&);  //scans taxonomy file to find taxonomy with highest level
39         void extendTaxonomy(string, string&, int);  //name, taxonomy, desired level
40         void truncateTaxonomy(string, string&, int);  //name, taxonomy, desired level
41         void removeConfidences(string&);  //removes the confidence limits on the taxon 
42
43         
44 };
45
46 /**************************************************************************************************/
47
48
49 #endif
50
51