From 43e5e9e86410145e796ce2e0a2e6767eee19d0d7 Mon Sep 17 00:00:00 2001 From: Jonas Kellerer Date: Wed, 7 Feb 2024 15:31:31 +0100 Subject: [PATCH] fix: make stop codon a valid symbolFrom for amino acid mutations --- .../kotlin/org/genspectrum/lapis/request/AminoAcidMutation.kt | 2 +- .../org/genspectrum/lapis/request/AminoAcidMutationTest.kt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lapis2/src/main/kotlin/org/genspectrum/lapis/request/AminoAcidMutation.kt b/lapis2/src/main/kotlin/org/genspectrum/lapis/request/AminoAcidMutation.kt index 379a0aae5..bef0ddf59 100644 --- a/lapis2/src/main/kotlin/org/genspectrum/lapis/request/AminoAcidMutation.kt +++ b/lapis2/src/main/kotlin/org/genspectrum/lapis/request/AminoAcidMutation.kt @@ -53,7 +53,7 @@ data class AminoAcidMutation( private val AMINO_ACID_MUTATION_REGEX = Regex( - """^((?[a-zA-Z0-9_-]+):)(?[a-zA-Z]?)(?\d+)(?[a-zA-Z*.-])?$""", + """^((?[a-zA-Z0-9_-]+):)(?[a-zA-Z*]?)(?\d+)(?[a-zA-Z*.-])?$""", ) @JsonComponent diff --git a/lapis2/src/test/kotlin/org/genspectrum/lapis/request/AminoAcidMutationTest.kt b/lapis2/src/test/kotlin/org/genspectrum/lapis/request/AminoAcidMutationTest.kt index 2ba7310b9..4b4d4e41a 100644 --- a/lapis2/src/test/kotlin/org/genspectrum/lapis/request/AminoAcidMutationTest.kt +++ b/lapis2/src/test/kotlin/org/genspectrum/lapis/request/AminoAcidMutationTest.kt @@ -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