]> git.donarmstrong.com Git - mothur.git/blobdiff - taxonomyequalizer.cpp
fixed splash page citation
[mothur.git] / taxonomyequalizer.cpp
index 37b7720de256d79e35cd415d91584fddfa05f0a6..c84c439a9efbc3633372ffe3ff3461f127dae171 100644 (file)
@@ -17,7 +17,7 @@ TaxEqualizer::TaxEqualizer(string tfile, int c) : cutoff(c) {
                ifstream inTax;
                openInputFile(tfile, inTax);
        
-               int highestLevel = getHighestLevel(inTax);
+               highestLevel = getHighestLevel(inTax);
        
                //if the user has specified a cutoff and it's smaller than the highest level
                if ((cutoff != -1) && (cutoff < highestLevel)) { 
@@ -27,30 +27,31 @@ TaxEqualizer::TaxEqualizer(string tfile, int c) : cutoff(c) {
                        mothurOutEndLine();
                }
                
-               inTax.close();  
-               openInputFile(tfile, inTax);
+               inTax.close(); 
+               ifstream in; 
+               openInputFile(tfile, in);
                
                ofstream out;
                equalizedFile = getRootName(tfile) + "equalized.taxonomy";
                openOutputFile(equalizedFile, out);
                
                string name, tax;
-               while (inTax) {
-                       inTax >> name >> tax;   gobble(inTax);
+               while (in) {
+                       in >> name >> tax;   gobble(in);
                        
                        if (containsConfidence) {  removeConfidences(tax);      }
                        
                        //is this a taxonomy that needs to be extended?
                        if (seqLevels[name] < highestLevel) {
                                extendTaxonomy(name, tax, highestLevel);
-                       }else if (seqLevels[name] > highestLevel) { //this can happen if hte user enters a cutoff
+                       }else if (seqLevels[name] > highestLevel) { //this can happen if the user enters a cutoff
                                truncateTaxonomy(name, tax, highestLevel);
                        }
                        
                        out << name << '\t' << tax << endl;
                }
                
-               inTax.close();
+               in.close();
                out.close();
                                        
        }