Skip to content

Commit

Permalink
feat(af divided by 100, skani doesnt return ani with 0 anymore):
Browse files Browse the repository at this point in the history
  • Loading branch information
pchaumeil committed Apr 2, 2024
1 parent 2322b0d commit 0d5e82e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions gtdbtk/external/skani.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,11 @@ def run_proc(self, qid, rid, ql, rl, preset):
af_q = float(tokens[4])
ani_af = (qid, rid, ani, af_r, af_q)
else:
# genomes too divergent to determine ANI and AF
# with skani so default to zeros
ani_af = (qid, rid, 0.0, 0.0, 0.0)
# # genomes too divergent to determine ANI and AF
# # with skani so default to zeros
ani_af = "null"
# ani_af = (qid, rid, 0.0, 0.0, 0.0)


return ani_af

Expand Down Expand Up @@ -257,11 +259,15 @@ def _parse_result_queue(self, q_results):
out = dict()
while True:
job = q_results.get(block=True)
if job == 'null':
continue
if job is None:
break

qid, rid, ani, af_r, af_q = job
max_af = max(af_r, af_q)
# af is a percent, we need to divide it by 100
max_af = max_af/100
if qid not in out:
out[qid] = {rid: {'ani': ani, 'af': max_af}}
else:
Expand Down

0 comments on commit 0d5e82e

Please sign in to comment.