diff --git a/lapis2/src/main/kotlin/org/genspectrum/lapis/request/AminoAcidInsertion.kt b/lapis2/src/main/kotlin/org/genspectrum/lapis/request/AminoAcidInsertion.kt index 8c14c85a..0dd6550e 100644 --- a/lapis2/src/main/kotlin/org/genspectrum/lapis/request/AminoAcidInsertion.kt +++ b/lapis2/src/main/kotlin/org/genspectrum/lapis/request/AminoAcidInsertion.kt @@ -29,7 +29,7 @@ data class AminoAcidInsertion(val position: Int, val gene: String, val insertion val insertions = matchGroups["insertions"]?.value?.replace( LAPIS_INSERTION_AMBIGUITY_SYMBOL, SILO_INSERTION_AMBIGUITY_SYMBOL, - ) + )?.uppercase() ?: throw BadRequestException( "Invalid amino acid insertion: $aminoAcidInsertion: Did not find insertions", ) diff --git a/lapis2/src/main/kotlin/org/genspectrum/lapis/request/NucleotideInsertion.kt b/lapis2/src/main/kotlin/org/genspectrum/lapis/request/NucleotideInsertion.kt index a4eb0137..44fd7588 100644 --- a/lapis2/src/main/kotlin/org/genspectrum/lapis/request/NucleotideInsertion.kt +++ b/lapis2/src/main/kotlin/org/genspectrum/lapis/request/NucleotideInsertion.kt @@ -27,7 +27,7 @@ data class NucleotideInsertion(val position: Int, val insertions: String, val se val insertions = matchGroups["insertions"]?.value?.replace( LAPIS_INSERTION_AMBIGUITY_SYMBOL, SILO_INSERTION_AMBIGUITY_SYMBOL, - ) + )?.uppercase() ?: throw BadRequestException( "Invalid nucleotide insertion: $nucleotideInsertion: Did not find insertions", ) diff --git a/lapis2/src/test/kotlin/org/genspectrum/lapis/request/AminoAcidInsertionTest.kt b/lapis2/src/test/kotlin/org/genspectrum/lapis/request/AminoAcidInsertionTest.kt index 58769179..bb5a47d9 100644 --- a/lapis2/src/test/kotlin/org/genspectrum/lapis/request/AminoAcidInsertionTest.kt +++ b/lapis2/src/test/kotlin/org/genspectrum/lapis/request/AminoAcidInsertionTest.kt @@ -80,6 +80,10 @@ class AminoAcidInsertionTest { "\"ins_gene:123:AB.*?CD\"", AminoAcidInsertion(123, "gene", "AB.*.*CD"), ), + Arguments.of( + "\"ins_gene:123:abCd\"", + AminoAcidInsertion(123, "gene", "ABCD"), + ), ) @JvmStatic diff --git a/lapis2/src/test/kotlin/org/genspectrum/lapis/request/NucleotideInsertionTest.kt b/lapis2/src/test/kotlin/org/genspectrum/lapis/request/NucleotideInsertionTest.kt index e8de35b5..386683b4 100644 --- a/lapis2/src/test/kotlin/org/genspectrum/lapis/request/NucleotideInsertionTest.kt +++ b/lapis2/src/test/kotlin/org/genspectrum/lapis/request/NucleotideInsertionTest.kt @@ -88,6 +88,10 @@ class NucleotideInsertionTest { "\"ins_segment:123:AB.*?CD\"", NucleotideInsertion(123, "AB.*.*CD", "segment"), ), + Arguments.of( + "\"ins_segment:123:abCd\"", + NucleotideInsertion(123, "ABCD", "segment"), + ), ) @JvmStatic