#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;
openInputFile(tfile, in);
ofstream out;
- equalizedFile = getRootName(tfile) + "equalized.taxonomy";
+ equalizedFile = outputDir + getRootName(getSimpleName(tfile)) + "equalized.taxonomy";
openOutputFile(equalizedFile, out);
//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;
}