if (baseTName == "saved") { baseTName = rdb->getSavedTaxonomy(); }
/************calculate the probablity that each word will be in a specific taxonomy*************/
- string tfileroot = baseTName.substr(0,baseTName.find_last_of(".")+1);
+ string tfileroot = m->getFullPathName(baseTName.substr(0,baseTName.find_last_of(".")+1));
string tempfileroot = m->getRootName(m->getSimpleName(baseName));
string phyloTreeName = tfileroot + "tree.train";
string phyloTreeSumName = tfileroot + "tree.sum";
//initialze probabilities
wordGenusProb.resize(numKmers);
WordPairDiffArr.resize(numKmers);
- //cout << numKmers << '\t' << genusNodes.size() << endl;
+
for (int j = 0; j < wordGenusProb.size(); j++) { wordGenusProb[j].resize(genusNodes.size()); }
- //cout << numKmers << '\t' << genusNodes.size() << endl;
- ofstream out;
+ ofstream out;
ofstream out2;
#ifdef USE_MPI
delete phyloTree;
phyloTree = new PhyloTree(phyloTreeTest, phyloTreeName);
-
+
//save probabilities
if (rdb->save) { rdb->wordGenusProb = wordGenusProb; rdb->WordPairDiffArr = WordPairDiffArr; }
}
exit(1);
}
}
-/**************************************************************************************************/
+**************************************************************************************************/
void Bayesian::readProbFile(ifstream& in, ifstream& inNum, string inName, string inNumName) {
try{
istringstream iss (tempBuf,istringstream::in);
float probTemp;
iss >> zeroCountProb[i] >> numbers[i] >> probTemp;
- WordPairDiffArr[i].prob = tempProb;
+ WordPairDiffArr[i].prob = probTemp;
}