Skip to content

Commit

Permalink
fix: make stop codon a valid symbolFrom for amino acid mutations
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKellerer committed Feb 8, 2024
1 parent c540153 commit 43e5e9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ data class AminoAcidMutation(

private val AMINO_ACID_MUTATION_REGEX =
Regex(
"""^((?<gene>[a-zA-Z0-9_-]+):)(?<symbolFrom>[a-zA-Z]?)(?<position>\d+)(?<symbolTo>[a-zA-Z*.-])?$""",
"""^((?<gene>[a-zA-Z0-9_-]+):)(?<symbolFrom>[a-zA-Z*]?)(?<position>\d+)(?<symbolTo>[a-zA-Z*.-])?$""",
)

@JsonComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ class AminoAcidMutationTest {
"\"MAYBE(gene1:G123A)\"",
AminoAcidMutation("gene1", 123, "A", maybe = true),
),
Arguments.of(
"\"gene1:*123A\"",
AminoAcidMutation("gene1", 123, "A", maybe = false),
),
)

@JvmStatic
Expand Down

0 comments on commit 43e5e9e

Please sign in to comment.