From bd7b64068cfbbb80943a30ca84b368ede02bd315 Mon Sep 17 00:00:00 2001 From: Dillon Barker Date: Mon, 29 Oct 2018 16:34:01 -0600 Subject: [PATCH] fix bug with short matches --- src/allele_call.py | 1 + src/update.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/allele_call.py b/src/allele_call.py index f37a8bf..739d929 100644 --- a/src/allele_call.py +++ b/src/allele_call.py @@ -158,6 +158,7 @@ def unpack_value(value): 'QueryName': blast_hit['qseqid'], 'SubjName': blast_hit['sseqid'], 'PercentIdentity': blast_hit['pident'], + 'PercentLength': blast_hit['length'] / blast_hit['qlen'], 'SubjectStartIndex': blast_hit['sstart'], 'SubjectEndIndex': blast_hit['send'], 'QueryStartIndex': blast_hit['qstart'], diff --git a/src/update.py b/src/update.py index 624ce33..9703b1d 100644 --- a/src/update.py +++ b/src/update.py @@ -23,7 +23,9 @@ def update_locus(gene: Dict[str, Union[str, int, bool, float]], if not gene['BlastResult']: return None, None - if gene['CorrectMarkerMatch'] or gene['IsContigTruncation']: + if any((gene['CorrectMarkerMatch'], + gene['IsContigTruncation'], + gene['PercentLength'] < 1)): return None, None