void TaskTimer::printStats() { CharDoubleMap flatProfile; double total=0; printf("Tree Profile:\n Incl-Abs Incl-%% Self-Abs Self-%% Name\n"); #ifdef _OPENMP total = printThreadTreeInfo(flatProfile); #else TaskTimer *root = (stack.size()>0 ? stack.front() : 0); if (root) { total += root->value(); root->printStats(0, root->value(), flatProfile); } #endif printf("Flat Profile:\n Incl-Abs Incl-%% Self-Abs Self-%% Name\n"); for (CharDoubleMap::iterator it=flatProfile.begin(); it!=flatProfile.end(); ++it) { printf("% 10.1fms % 7.2f%% %10.1fms % 7.2f%% %s\n", it->second.incl, 100.0f*it->second.incl/total, it->second.self, 100.0f*it->second.self/total, it->first); } }
double GetStandardProbability(char ch) { typedef map < char, double > CharDoubleMap; static CharDoubleMap standardProbabilities; if (standardProbabilities.size() == 0) { // initialize static stuff if (BLASTAA_SIZE != 28) { ERROR_MESSAGE("GetStandardProbability() - confused by BLASTAA_SIZE != 28"); return 0.0; } double *probs = BLAST_GetStandardAaProbabilities(); for (unsigned int i=0; i<28; ++i) { standardProbabilities[LookupCharacterFromNCBIStdaaNumber(i)] = probs[i]; // TRACE_MESSAGE("standard probability " << LookupCharacterFromNCBIStdaaNumber(i) << " : " << probs[i]); } sfree(probs); } CharDoubleMap::const_iterator f = standardProbabilities.find(toupper((unsigned char) ch)); if (f != standardProbabilities.end()) return f->second; WARNING_MESSAGE("GetStandardProbability() - unknown residue character " << ch); return 0.0; }