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