Skip to content

Commit

Permalink
feat: amino acid and nucleotide insertion filters are case-insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKellerer authored and fengelniederhammer committed Jan 23, 2024
1 parent aed296f commit 667f487
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ data class AminoAcidInsertion(val position: Int, val gene: String, val insertion
private val AMINO_ACID_INSERTION_REGEX =
Regex(
"""^ins_(?<gene>[a-zA-Z0-9_-]+):(?<position>\d+):(?<insertions>(([a-zA-Z?]|(\.\*))+))$""",
setOf(
RegexOption.IGNORE_CASE,
),
)

@JsonComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ data class NucleotideInsertion(val position: Int, val insertions: String, val se
private val NUCLEOTIDE_INSERTION_REGEX =
Regex(
"""^ins_((?<segment>[a-zA-Z0-9_-]+)(?=:):)?(?<position>\d+):(?<insertions>(([a-zA-Z?]|(\.\*))+))$""",
setOf(
RegexOption.IGNORE_CASE,
),
)

@JsonComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ class AminoAcidInsertionTest {
"\"ins_gEne1:123:ABCD\"",
AminoAcidInsertion(123, "gene1", "ABCD"),
),
Arguments.of(
"\"INs_gEne1:123:ABCD\"",
AminoAcidInsertion(123, "gene1", "ABCD"),
),
)

@JvmStatic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ class NucleotideInsertionTest {
"\"ins_oTher_segmenT:123:ABCD\"",
NucleotideInsertion(123, "ABCD", "other_segment"),
),
Arguments.of(
"\"INs_123:AcCD\"",
NucleotideInsertion(123, "ACCD", null),
),
)

@JvmStatic
Expand Down

0 comments on commit 667f487

Please sign in to comment.