From 82acd8229aca8691dcc8a3b5d0833d11d9d74a61 Mon Sep 17 00:00:00 2001 From: trvinh Date: Thu, 21 Dec 2023 18:26:01 +0100 Subject: [PATCH] option to validate hmm hits by sequence score --- fdog/libs/hmm.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/fdog/libs/hmm.py b/fdog/libs/hmm.py index ce4d34c..88ea070 100644 --- a/fdog/libs/hmm.py +++ b/fdog/libs/hmm.py @@ -70,22 +70,22 @@ def sort_hmm_hits(hmm_hits, hmm_score_type = 'domain', hitLimit = 10, scoreCutof score_dict[best_domain_score].append(best_domain_hit) else: for hit in hmm_hits: - ori_hits[hit.name.decode('ASCII')] = len(hit.domains) + ori_hits[hit.name.decode('ASCII')] = hit.score if hit.score > best_hit_score: # get hit with best score best_hit_score = hit.score best_hit = hit.name.decode('ASCII') - # add to score_dict - if best_hit_score > best_score: - best_score = best_hit_score - cutoff = best_score/100*(100-scoreCutoff) - if best_score < 0: - cutoff = best_score/100*(100+scoreCutoff) - if best_hit_score >= cutoff: - if best_hit_score not in score_dict: - score_dict[best_hit_score] = [best_hit] - else: - score_dict[best_hit_score].append(best_hit) + # add to score_dict + if best_hit_score > best_score: + best_score = best_hit_score + cutoff = best_score/100*(100-scoreCutoff) + if best_score < 0: + cutoff = best_score/100*(100+scoreCutoff) + if hit.score >= cutoff: + if hit.score not in score_dict: + score_dict[hit.score] = [hit.name.decode('ASCII')] + else: + score_dict[hit.score].append(hit.name.decode('ASCII')) output_fn.print_debug(debug, 'All HMM hits', ori_hits) hmm_cand = {}