X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bayesian.cpp;h=1dc38337aef1bcc3b695ff56e86061cdab58c13d;hb=28bcfc4a41b8b82f66636587e0d4d355d07cbdd1;hp=f7ea6e4351868a20a191169b995e94faff6fa053;hpb=16abd6271c455bd01b34ff89a2e3641bef0fa128;p=mothur.git diff --git a/bayesian.cpp b/bayesian.cpp index f7ea6e4..1dc3833 100644 --- a/bayesian.cpp +++ b/bayesian.cpp @@ -27,7 +27,7 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i) { 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"; @@ -111,10 +111,9 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i) { //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 @@ -231,7 +230,7 @@ Classify(), kmerSize(ksize), confidenceThreshold(cutoff), iters(i) { delete phyloTree; phyloTree = new PhyloTree(phyloTreeTest, phyloTreeName); - + //save probabilities if (rdb->save) { rdb->wordGenusProb = wordGenusProb; rdb->WordPairDiffArr = WordPairDiffArr; } } @@ -505,7 +504,7 @@ map Bayesian::parseTaxMap(string newTax) { exit(1); } } -/**************************************************************************************************/ +**************************************************************************************************/ void Bayesian::readProbFile(ifstream& in, ifstream& inNum, string inName, string inNumName) { try{ @@ -606,7 +605,7 @@ void Bayesian::readProbFile(ifstream& in, ifstream& inNum, string inName, string istringstream iss (tempBuf,istringstream::in); float probTemp; iss >> zeroCountProb[i] >> numbers[i] >> probTemp; - WordPairDiffArr[i].prob = tempProb; + WordPairDiffArr[i].prob = probTemp; }