Skip to content

Commit

Permalink
different logic for testing whether sequence with a deletion counts a…
Browse files Browse the repository at this point in the history
…s mutated
  • Loading branch information
iskandr committed Oct 20, 2019
1 parent a7bc1c3 commit 8a6a5db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion isovar/protein_sequence_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,12 @@ def translation_from_variant_sequence_and_reference_context(
self.protein_sequence_length)
ends_with_stop_codon = False

contains_mutation = len(amino_acids) > mutation_start_idx
if mutation_end_idx == mutation_start_idx:
# a deletion only counts as mutated if the amino acids on
# either side are in the sequence
contains_mutation = (0 < mutation_start_idx < len(amino_acids))
else:
contains_mutation = len(amino_acids) > mutation_start_idx

translation = Translation(
amino_acids=amino_acids,
Expand Down

0 comments on commit 8a6a5db

Please sign in to comment.