X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=bayesian.cpp;h=6eaab6f2f974f8e1036561c2f76d9587d6dd0399;hp=cf70010e76a6b9cba77b8ade2fcd7d18713391d3;hb=8159f34321e2c771638059b59a986caca9f3ab60;hpb=7aa301dfa67cfcb5b00c6b4e38a7ad56eb8337db diff --git a/bayesian.cpp b/bayesian.cpp index cf70010..6eaab6f 100644 --- a/bayesian.cpp +++ b/bayesian.cpp @@ -308,7 +308,11 @@ string Bayesian::getTaxonomy(Sequence* seq) { //bootstrap - to set confidenceScore int numToSelect = queryKmers.size() / 8; + if (m->debug) { m->mothurOut(seq->getName() + "\t"); } + tax = bootstrapResults(queryKmers, index, numToSelect); + + if (m->debug) { m->mothurOut("\n"); } return tax; } @@ -374,6 +378,7 @@ string Bayesian::bootstrapResults(vector kmers, int tax, int numToSelect) { int seqTaxIndex = tax; TaxNode seqTax = phyloTree->get(tax); + while (seqTax.level != 0) { //while you are not at the root itBoot2 = confidenceScores.find(seqTaxIndex); //is this a classification we already have a count on @@ -383,11 +388,13 @@ string Bayesian::bootstrapResults(vector kmers, int tax, int numToSelect) { confidence = itBoot2->second; } + if (m->debug) { m->mothurOut(seqTax.name + "(" + toString(((confidence/(float)iters) * 100)) + ");"); } + if (((confidence/(float)iters) * 100) >= confidenceThreshold) { confidenceTax = seqTax.name + "(" + toString(((confidence/(float)iters) * 100)) + ");" + confidenceTax; simpleTax = seqTax.name + ";" + simpleTax; } - + seqTaxIndex = seqTax.parent; seqTax = phyloTree->get(seqTax.parent); }