Skip to content

Commit bd7b640

Browse files
committed
fix bug with short matches
1 parent adfc226 commit bd7b640

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/allele_call.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ def unpack_value(value):
158158
'QueryName': blast_hit['qseqid'],
159159
'SubjName': blast_hit['sseqid'],
160160
'PercentIdentity': blast_hit['pident'],
161+
'PercentLength': blast_hit['length'] / blast_hit['qlen'],
161162
'SubjectStartIndex': blast_hit['sstart'],
162163
'SubjectEndIndex': blast_hit['send'],
163164
'QueryStartIndex': blast_hit['qstart'],

src/update.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ def update_locus(gene: Dict[str, Union[str, int, bool, float]],
2323
if not gene['BlastResult']:
2424
return None, None
2525

26-
if gene['CorrectMarkerMatch'] or gene['IsContigTruncation']:
26+
if any((gene['CorrectMarkerMatch'],
27+
gene['IsContigTruncation'],
28+
gene['PercentLength'] < 1)):
2729

2830
return None, None
2931

0 commit comments

Comments
 (0)