]> git.donarmstrong.com Git - mothur.git/blobdiff - taxonomyequalizer.cpp
added a few evenness calculators and fixed a couple of bugs in filter.seqs and pre...
[mothur.git] / taxonomyequalizer.cpp
index fc36eb643c30c549810ff462671c38ba36e118b8..1d2832d5fc3a3ba31861d75d93dd202caf82261e 100644 (file)
@@ -10,7 +10,7 @@
 #include "taxonomyequalizer.h"
 
 /**************************************************************************************************/
-TaxEqualizer::TaxEqualizer(string tfile, int c) : cutoff(c) {
+TaxEqualizer::TaxEqualizer(string tfile, int c, string o) : cutoff(c), outputDir(o) {
        try {
                m = MothurOut::getInstance();
                containsConfidence = false;
@@ -35,7 +35,7 @@ TaxEqualizer::TaxEqualizer(string tfile, int c) : cutoff(c) {
                        openInputFile(tfile, in);
                        
                        ofstream out;
-                       equalizedFile = getRootName(tfile) + "equalized.taxonomy";
+                       equalizedFile = outputDir + getRootName(getSimpleName(tfile)) + "equalized.taxonomy";
                        openOutputFile(equalizedFile, out);
                        
        
@@ -88,19 +88,19 @@ int TaxEqualizer::getHighestLevel(ifstream& in) {
                
                        //save sequences level
                        seqLevels[name] = thisLevel;
-               
+       
                        //is this the longest taxonomy?
                        if (thisLevel > level) {  
                                level = thisLevel;  
                                testTax = tax; //testTax is used to figure out if this file has confidences we need to strip out
-                       }  
+                       } 
                }
                
                int pos = testTax.find_first_of('(');
 
                //if there are '(' then there are confidences we need to take out
                if (pos != -1) {  containsConfidence = true;  }
-               
+       
                return level;
                                        
        }