Skip to content

Commit

Permalink
feat: allow lower case for insertions
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKellerer committed Dec 18, 2023
1 parent 74cfa74 commit 79c9f2d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 79c9f2d

Please sign in to comment.