From fe8f0b984895ed0a3a6775083658f07485e9a72c Mon Sep 17 00:00:00 2001 From: Jonas Kellerer Date: Wed, 6 Sep 2023 17:42:17 +0200 Subject: [PATCH] feat: e2e tests for filter by insertions --- .../org/genspectrum/lapis/OpenApiDocs.kt | 41 ++++ .../lapis/config/DatabaseConfig.kt | 6 + .../lapis/config/SequenceFilterFields.kt | 2 + .../lapis/controller/LapisController.kt | 31 ++- .../lapis/request/AminoAcidInsertion.kt | 4 +- .../lapis/request/NucleotideInsertion.kt | 2 +- .../lapis/config/DatabaseConfigTest.kt | 4 + .../LapisControllerCommonFieldsTest.kt | 102 +++++++++ .../lapis/controller/LapisControllerTest.kt | 97 --------- .../lapis/request/AminoAcidInsertionTest.kt | 21 ++ .../lapis/request/NucleotideInsertionTest.kt | 26 +++ .../resources/config/testDatabaseConfig.yaml | 4 + .../testDatabaseConfigWithoutFeatures.yaml | 4 + siloLapisTests/test/aggregated.spec.ts | 37 +++- .../aggregatedQueries/aggregrationFields.json | 8 +- .../test/aggregatedQueries/date.json | 2 +- .../test/aggregatedQueries/dateTo.json | 2 +- .../test/aggregatedQueries/intBetween.json | 2 +- .../test/aggregatedQueries/intEquals.json | 4 +- .../aggregatedQueries/regionIsEurope.json | 2 +- .../test/aminoAcidMutations.spec.ts | 34 +++ siloLapisTests/test/details.spec.ts | 56 ++++- .../test/nucleotideMutations.spec.ts | 34 +++ .../testData/small_metadata_set.tsv | 202 +++++++++--------- .../testData/testDatabaseConfig.yaml | 4 + 25 files changed, 513 insertions(+), 218 deletions(-) diff --git a/lapis2/src/main/kotlin/org/genspectrum/lapis/OpenApiDocs.kt b/lapis2/src/main/kotlin/org/genspectrum/lapis/OpenApiDocs.kt index d1c4d3ea..4f5c6cae 100644 --- a/lapis2/src/main/kotlin/org/genspectrum/lapis/OpenApiDocs.kt +++ b/lapis2/src/main/kotlin/org/genspectrum/lapis/OpenApiDocs.kt @@ -11,6 +11,8 @@ import org.genspectrum.lapis.config.SequenceFilterFields import org.genspectrum.lapis.controller.AGGREGATED_GROUP_BY_FIELDS_DESCRIPTION import org.genspectrum.lapis.controller.AGGREGATED_REQUEST_SCHEMA import org.genspectrum.lapis.controller.AGGREGATED_RESPONSE_SCHEMA +import org.genspectrum.lapis.controller.AMINO_ACID_INSERTIONS_PROPERTY +import org.genspectrum.lapis.controller.AMINO_ACID_INSERTIONS_SCHEMA import org.genspectrum.lapis.controller.AMINO_ACID_MUTATIONS_PROPERTY import org.genspectrum.lapis.controller.AMINO_ACID_MUTATIONS_RESPONSE_SCHEMA import org.genspectrum.lapis.controller.AMINO_ACID_MUTATIONS_SCHEMA @@ -25,6 +27,8 @@ import org.genspectrum.lapis.controller.LIMIT_DESCRIPTION import org.genspectrum.lapis.controller.LIMIT_PROPERTY import org.genspectrum.lapis.controller.LIMIT_SCHEMA import org.genspectrum.lapis.controller.MIN_PROPORTION_PROPERTY +import org.genspectrum.lapis.controller.NUCLEOTIDE_INSERTIONS_PROPERTY +import org.genspectrum.lapis.controller.NUCLEOTIDE_INSERTIONS_SCHEMA import org.genspectrum.lapis.controller.NUCLEOTIDE_MUTATIONS_PROPERTY import org.genspectrum.lapis.controller.NUCLEOTIDE_MUTATIONS_RESPONSE_SCHEMA import org.genspectrum.lapis.controller.NUCLEOTIDE_MUTATIONS_SCHEMA @@ -35,7 +39,9 @@ import org.genspectrum.lapis.controller.ORDER_BY_FIELDS_SCHEMA import org.genspectrum.lapis.controller.ORDER_BY_PROPERTY import org.genspectrum.lapis.controller.REQUEST_SCHEMA_WITH_MIN_PROPORTION import org.genspectrum.lapis.controller.SEQUENCE_FILTERS_SCHEMA +import org.genspectrum.lapis.request.AminoAcidInsertion import org.genspectrum.lapis.request.AminoAcidMutation +import org.genspectrum.lapis.request.NucleotideInsertion import org.genspectrum.lapis.request.NucleotideMutation import org.genspectrum.lapis.request.OrderByField import org.genspectrum.lapis.response.COUNT_PROPERTY @@ -51,6 +57,8 @@ fun buildOpenApiSchema(sequenceFilterFields: SequenceFilterFields, databaseConfi val sequenceFilters = requestProperties + Pair(NUCLEOTIDE_MUTATIONS_PROPERTY, nucleotideMutations()) + Pair(AMINO_ACID_MUTATIONS_PROPERTY, aminoAcidMutations()) + + Pair(NUCLEOTIDE_INSERTIONS_PROPERTY, nucleotideInsertions()) + + Pair(AMINO_ACID_INSERTIONS_PROPERTY, aminoAcidInsertions()) + Pair(ORDER_BY_PROPERTY, orderByPostSchema()) + Pair(LIMIT_PROPERTY, limitSchema()) + Pair(OFFSET_PROPERTY, offsetSchema()) + @@ -130,6 +138,8 @@ fun buildOpenApiSchema(sequenceFilterFields: SequenceFilterFields, databaseConfi ), ) .addSchemas(AMINO_ACID_MUTATIONS_SCHEMA, aminoAcidMutations()) + .addSchemas(NUCLEOTIDE_INSERTIONS_SCHEMA, nucleotideInsertions()) + .addSchemas(AMINO_ACID_INSERTIONS_SCHEMA, aminoAcidInsertions()) .addSchemas(ORDER_BY_FIELDS_SCHEMA, orderByGetSchema()) .addSchemas(LIMIT_SCHEMA, limitSchema()) .addSchemas(OFFSET_SCHEMA, offsetSchema()) @@ -160,6 +170,8 @@ private fun mapToOpenApiType(type: MetadataType): String = when (type) { MetadataType.DATE -> "string" MetadataType.INT -> "integer" MetadataType.FLOAT -> "number" + MetadataType.NUCLEOTIDE_INSERTION -> "string" + MetadataType.AMINO_ACID_INSERTION -> "string" } private fun primitiveSequenceFilterFieldSchemas(sequenceFilterFields: SequenceFilterFields) = @@ -242,6 +254,35 @@ private fun aminoAcidMutations() = ), ) +private fun nucleotideInsertions() = + Schema>() + .type("array") + .items( + Schema() + .type("string") + .example("ins_123:ATT") + .description( + """ + |A nucleotide insertion in the format "ins_(\:)?\:\". + |If the sequenceName is not provided, LAPIS will use the default sequence name. + """.trimMargin(), + ), + ) + +private fun aminoAcidInsertions() = + Schema>() + .type("array") + .items( + Schema() + .type("string") + .example("ins_ORF1:123:ATT") + .description( + """ + |A amino acid insertion in the format "ins_\:\:\". + """.trimMargin(), + ), + ) + private fun orderByGetSchema() = Schema>() .type("array") .items(orderByFieldStringSchema()) diff --git a/lapis2/src/main/kotlin/org/genspectrum/lapis/config/DatabaseConfig.kt b/lapis2/src/main/kotlin/org/genspectrum/lapis/config/DatabaseConfig.kt index 984befb8..488bb950 100644 --- a/lapis2/src/main/kotlin/org/genspectrum/lapis/config/DatabaseConfig.kt +++ b/lapis2/src/main/kotlin/org/genspectrum/lapis/config/DatabaseConfig.kt @@ -32,6 +32,12 @@ enum class MetadataType { @JsonProperty("float") FLOAT, + + @JsonProperty("insertion") + NUCLEOTIDE_INSERTION, + + @JsonProperty("aaInsertion") + AMINO_ACID_INSERTION, } data class DatabaseFeature(val name: String) diff --git a/lapis2/src/main/kotlin/org/genspectrum/lapis/config/SequenceFilterFields.kt b/lapis2/src/main/kotlin/org/genspectrum/lapis/config/SequenceFilterFields.kt index 41fececb..6d4c5b54 100644 --- a/lapis2/src/main/kotlin/org/genspectrum/lapis/config/SequenceFilterFields.kt +++ b/lapis2/src/main/kotlin/org/genspectrum/lapis/config/SequenceFilterFields.kt @@ -39,6 +39,8 @@ private fun mapToSequenceFilterFields(databaseMetadata: DatabaseMetadata) = when "${databaseMetadata.name}From" to SequenceFilterFieldType.FloatFrom(databaseMetadata.name), "${databaseMetadata.name}To" to SequenceFilterFieldType.FloatTo(databaseMetadata.name), ) + MetadataType.NUCLEOTIDE_INSERTION -> emptyList() + MetadataType.AMINO_ACID_INSERTION -> emptyList() } private fun mapToSequenceFilterFieldsFromFeatures(databaseFeature: DatabaseFeature) = when (databaseFeature.name) { diff --git a/lapis2/src/main/kotlin/org/genspectrum/lapis/controller/LapisController.kt b/lapis2/src/main/kotlin/org/genspectrum/lapis/controller/LapisController.kt index f4f19195..231880ab 100644 --- a/lapis2/src/main/kotlin/org/genspectrum/lapis/controller/LapisController.kt +++ b/lapis2/src/main/kotlin/org/genspectrum/lapis/controller/LapisController.kt @@ -42,6 +42,9 @@ const val AMINO_ACID_MUTATIONS_RESPONSE_SCHEMA = "AminoAcidMutationsResponse" const val NUCLEOTIDE_MUTATIONS_SCHEMA = "NucleotideMutations" const val AMINO_ACID_MUTATIONS_SCHEMA = "AminoAcidMutations" +const val NUCLEOTIDE_INSERTIONS_SCHEMA = "NucleotideInsertions" +const val AMINO_ACID_INSERTIONS_SCHEMA = "AminoAcidInsertions" + const val ORDER_BY_FIELDS_SCHEMA = "OrderByFields" const val LIMIT_SCHEMA = "Limit" const val OFFSET_SCHEMA = "Offset" @@ -102,8 +105,10 @@ class LapisController( @RequestParam aminoAcidMutations: List?, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$NUCLEOTIDE_INSERTIONS_SCHEMA")) nucleotideInsertions: List?, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$AMINO_ACID_INSERTIONS_SCHEMA")) aminoAcidInsertions: List?, @Parameter( schema = Schema(ref = "#/components/schemas/$LIMIT_SCHEMA"), @@ -188,8 +193,10 @@ class LapisController( @RequestParam dataFormat: String? = null, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$NUCLEOTIDE_INSERTIONS_SCHEMA")) nucleotideInsertions: List?, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$AMINO_ACID_INSERTIONS_SCHEMA")) aminoAcidInsertions: List?, ): String { val request = SequenceFiltersRequestWithFields( @@ -254,8 +261,10 @@ class LapisController( @RequestParam dataFormat: String? = null, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$NUCLEOTIDE_INSERTIONS_SCHEMA")) nucleotideInsertions: List?, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$AMINO_ACID_INSERTIONS_SCHEMA")) aminoAcidInsertions: List?, ): String { val request = SequenceFiltersRequestWithFields( @@ -296,7 +305,7 @@ class LapisController( responses = [ApiResponse(responseCode = "200")], ) fun postAggregatedAsCsv( - @Parameter(schema = Schema(ref = "#/components/schemas/$DETAILS_REQUEST_SCHEMA")) + @Parameter(schema = Schema(ref = "#/components/schemas/$AGGREGATED_REQUEST_SCHEMA")) @RequestBody request: SequenceFiltersRequestWithFields, ): String { @@ -310,7 +319,7 @@ class LapisController( responses = [ApiResponse(responseCode = "200")], ) fun postAggregatedAsTsv( - @Parameter(schema = Schema(ref = "#/components/schemas/$DETAILS_REQUEST_SCHEMA")) + @Parameter(schema = Schema(ref = "#/components/schemas/$AGGREGATED_REQUEST_SCHEMA")) @RequestBody request: SequenceFiltersRequestWithFields, ): String { @@ -365,8 +374,10 @@ class LapisController( @RequestParam dataFormat: String? = null, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$NUCLEOTIDE_INSERTIONS_SCHEMA")) nucleotideInsertions: List?, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$AMINO_ACID_INSERTIONS_SCHEMA")) aminoAcidInsertions: List?, ): LapisResponse> { val mutationProportionsRequest = MutationProportionsRequest( @@ -427,8 +438,10 @@ class LapisController( @RequestParam offset: Int? = null, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$NUCLEOTIDE_INSERTIONS_SCHEMA")) nucleotideInsertions: List?, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$AMINO_ACID_INSERTIONS_SCHEMA")) aminoAcidInsertions: List?, ): String { val request = MutationProportionsRequest( @@ -487,8 +500,10 @@ class LapisController( @RequestParam offset: Int? = null, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$NUCLEOTIDE_INSERTIONS_SCHEMA")) nucleotideInsertions: List?, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$AMINO_ACID_INSERTIONS_SCHEMA")) aminoAcidInsertions: List?, ): String { val request = MutationProportionsRequest( @@ -594,8 +609,10 @@ class LapisController( @RequestParam offset: Int? = null, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$NUCLEOTIDE_INSERTIONS_SCHEMA")) nucleotideInsertions: List?, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$AMINO_ACID_INSERTIONS_SCHEMA")) aminoAcidInsertions: List?, ): LapisResponse> { val mutationProportionsRequest = MutationProportionsRequest( @@ -656,8 +673,10 @@ class LapisController( @RequestParam offset: Int? = null, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$NUCLEOTIDE_INSERTIONS_SCHEMA")) nucleotideInsertions: List?, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$AMINO_ACID_INSERTIONS_SCHEMA")) aminoAcidInsertions: List?, ): String { val mutationProportionsRequest = MutationProportionsRequest( @@ -716,8 +735,10 @@ class LapisController( @RequestParam offset: Int? = null, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$NUCLEOTIDE_INSERTIONS_SCHEMA")) nucleotideInsertions: List?, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$AMINO_ACID_INSERTIONS_SCHEMA")) aminoAcidInsertions: List?, ): String { val mutationProportionsRequest = MutationProportionsRequest( @@ -842,8 +863,10 @@ class LapisController( @RequestParam dataFormat: String? = null, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$NUCLEOTIDE_INSERTIONS_SCHEMA")) nucleotideInsertions: List?, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$AMINO_ACID_INSERTIONS_SCHEMA")) aminoAcidInsertions: List?, ): LapisResponse> { val request = SequenceFiltersRequestWithFields( @@ -901,8 +924,10 @@ class LapisController( @RequestParam offset: Int? = null, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$NUCLEOTIDE_INSERTIONS_SCHEMA")) nucleotideInsertions: List?, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$AMINO_ACID_INSERTIONS_SCHEMA")) aminoAcidInsertions: List?, ): String { val request = SequenceFiltersRequestWithFields( @@ -958,8 +983,10 @@ class LapisController( @RequestParam offset: Int? = null, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$NUCLEOTIDE_INSERTIONS_SCHEMA")) nucleotideInsertions: List?, @RequestParam + @Parameter(schema = Schema(ref = "#/components/schemas/$AMINO_ACID_INSERTIONS_SCHEMA")) aminoAcidInsertions: List?, ): String { val request = SequenceFiltersRequestWithFields( 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 0b11c477..ea7e06be 100644 --- a/lapis2/src/main/kotlin/org/genspectrum/lapis/request/AminoAcidInsertion.kt +++ b/lapis2/src/main/kotlin/org/genspectrum/lapis/request/AminoAcidInsertion.kt @@ -25,7 +25,7 @@ data class AminoAcidInsertion(val position: Int, val gene: String, val insertion "Invalid amino acid insertion: $aminoAcidInsertion: Did not find gene", ) - val insertions = matchGroups["insertion"]?.value?.replace("?", ".*") + val insertions = matchGroups["insertions"]?.value?.replace("?", ".*") ?: throw IllegalArgumentException( "Invalid amino acid insertion: $aminoAcidInsertion: Did not find insertions", ) @@ -41,7 +41,7 @@ data class AminoAcidInsertion(val position: Int, val gene: String, val insertion private val AMINO_ACID_INSERTION_REGEX = Regex( - """^ins_(?[a-zA-Z0-9_-]+):(?\d+):(?[a-zA-Z0-9?_-]+)?$""", + """^ins_(?[a-zA-Z0-9_-]+):(?\d+):(?(([a-zA-Z?]|(\.\*))+))$""", ) @JsonComponent 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 b047417b..532f00ca 100644 --- a/lapis2/src/main/kotlin/org/genspectrum/lapis/request/NucleotideInsertion.kt +++ b/lapis2/src/main/kotlin/org/genspectrum/lapis/request/NucleotideInsertion.kt @@ -36,7 +36,7 @@ data class NucleotideInsertion(val position: Int, val insertions: String, val se private val NUCLEOTIDE_INSERTION_REGEX = Regex( - """^ins_((?[a-zA-Z0-9_-]+)(?=:):)?(?\d+):(?[a-zA-Z0-9?_-]+)?$""", + """^ins_((?[a-zA-Z0-9_-]+)(?=:):)?(?\d+):(?(([a-zA-Z?]|(\.\*))+))$""", ) @JsonComponent diff --git a/lapis2/src/test/kotlin/org/genspectrum/lapis/config/DatabaseConfigTest.kt b/lapis2/src/test/kotlin/org/genspectrum/lapis/config/DatabaseConfigTest.kt index 2a8f28f1..5f73e36c 100644 --- a/lapis2/src/test/kotlin/org/genspectrum/lapis/config/DatabaseConfigTest.kt +++ b/lapis2/src/test/kotlin/org/genspectrum/lapis/config/DatabaseConfigTest.kt @@ -26,6 +26,8 @@ class DatabaseConfigTest { DatabaseMetadata(name = "region", type = MetadataType.STRING), DatabaseMetadata(name = "country", type = MetadataType.STRING), DatabaseMetadata(name = "pangoLineage", type = MetadataType.PANGO_LINEAGE), + DatabaseMetadata(name = "nucInsertion", type = MetadataType.NUCLEOTIDE_INSERTION), + DatabaseMetadata(name = "aaInsertion", type = MetadataType.AMINO_ACID_INSERTION), ), ) assertThat( @@ -56,6 +58,8 @@ class DatabaseConfigWithoutFeaturesTest { DatabaseMetadata(name = "region", type = MetadataType.STRING), DatabaseMetadata(name = "country", type = MetadataType.STRING), DatabaseMetadata(name = "pangoLineage", type = MetadataType.PANGO_LINEAGE), + DatabaseMetadata(name = "nucInsertion", type = MetadataType.NUCLEOTIDE_INSERTION), + DatabaseMetadata(name = "aaInsertion", type = MetadataType.AMINO_ACID_INSERTION), ), ) assertThat(underTest.schema.features, `is`(emptyList())) diff --git a/lapis2/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerCommonFieldsTest.kt b/lapis2/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerCommonFieldsTest.kt index d5abc851..58bf7ee0 100644 --- a/lapis2/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerCommonFieldsTest.kt +++ b/lapis2/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerCommonFieldsTest.kt @@ -4,11 +4,17 @@ import com.fasterxml.jackson.databind.node.TextNode import com.ninjasquad.springmockk.MockkBean import io.mockk.every import org.genspectrum.lapis.model.SiloQueryModel +import org.genspectrum.lapis.request.AminoAcidInsertion +import org.genspectrum.lapis.request.NucleotideInsertion import org.genspectrum.lapis.request.Order import org.genspectrum.lapis.request.OrderByField import org.genspectrum.lapis.request.SequenceFiltersRequestWithFields import org.genspectrum.lapis.response.AggregationData +import org.hamcrest.Matchers import org.junit.jupiter.api.Test +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.MethodSource import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc import org.springframework.boot.test.context.SpringBootTest @@ -265,4 +271,100 @@ class LapisControllerCommonFieldsTest(@Autowired val mockMvc: MockMvc) { .andExpect(status().isBadRequest) .andExpect(jsonPath("\$.error.message").value("offset must be a number or null")) } + + @Test + fun `GET aggregated with valid nucleotideInsertion`() { + every { + siloQueryModelMock.getAggregated( + SequenceFiltersRequestWithFields( + emptyMap(), + emptyList(), + emptyList(), + listOf(NucleotideInsertion(123, "ABC", null), NucleotideInsertion(124, "DEF", "segment")), + emptyList(), + emptyList(), + ), + ) + } returns listOf(AggregationData(5, emptyMap())) + + mockMvc.perform(get("/aggregated?nucleotideInsertions=ins_123:ABC,ins_segment:124:DEF")) + .andExpect(status().isOk) + .andExpect(jsonPath("\$.data[0].count").value(5)) + } + + @Test + fun `GET aggregated with valid aminoAcidInsertions`() { + every { + siloQueryModelMock.getAggregated( + SequenceFiltersRequestWithFields( + emptyMap(), + emptyList(), + emptyList(), + emptyList(), + listOf(AminoAcidInsertion(123, "S", "ABC"), AminoAcidInsertion(124, "ORF1", "DEF")), + emptyList(), + ), + ) + } returns listOf(AggregationData(5, emptyMap())) + + mockMvc.perform(get("/aggregated?aminoAcidInsertions=ins_S:123:ABC,ins_ORF1:124:DEF")) + .andExpect(status().isOk) + .andExpect(jsonPath("\$.data[0].count").value(5)) + } + + @ParameterizedTest(name = "GET {0} with invalid nucleotide mutation") + @MethodSource("getEndpointsWithNucleotideMutationFilter") + fun `GET endpoint with invalid nucleotide mutation filter`( + endpoint: String, + ) { + mockMvc.perform(get("$endpoint?nucleotideMutations=invalidMutation")) + .andExpect(status().isBadRequest) + .andExpect(jsonPath("\$.detail").value(Matchers.containsString("Failed to convert 'nucleotideMutations'"))) + } + + @ParameterizedTest(name = "GET {0} with invalid nucleotide mutation") + @MethodSource("getEndpointsWithAminoAcidMutationFilter") + fun `GET endpoind with invalid amino acid mutation`(endpoint: String) { + mockMvc.perform(get("$endpoint?aminoAcidMutations=invalidMutation")) + .andExpect(status().isBadRequest) + .andExpect(jsonPath("\$.detail").value(Matchers.containsString("Failed to convert 'aminoAcidMutations'"))) + } + + @ParameterizedTest(name = "GET {0} with invalid nucleotideInsertion") + @MethodSource("getEndpointsWithInsertionFilter") + fun `GET with invalid nucleotide insertion filter`( + endpoint: String, + ) { + mockMvc.perform(get(endpoint + "?nucleotideInsertions=invalidInsertion")) + .andExpect(status().isBadRequest) + .andExpect(jsonPath("\$.detail").value(Matchers.containsString("Failed to convert 'nucleotideInsertions'"))) + } + + @ParameterizedTest(name = "GET {0} with invalid aminoAcidInsertion") + @MethodSource("getEndpointsWithInsertionFilter") + fun `GET with invalid amino acid insertionFilter`( + endpoint: String, + ) { + mockMvc.perform(get(endpoint + "?aminoAcidInsertions=invalidInsertion")) + .andExpect(status().isBadRequest) + .andExpect(jsonPath("\$.detail").value(Matchers.containsString("Failed to convert 'aminoAcidInsertions'"))) + } + + private companion object { + fun allEndpoints() = listOf( + Arguments.of("/nucleotideMutations"), + Arguments.of("/aminoAcidMutations"), + Arguments.of("/aggregated"), + Arguments.of("/details"), + ) + + @JvmStatic + fun getEndpointsWithInsertionFilter() = allEndpoints() + + @JvmStatic + fun getEndpointsWithNucleotideMutationFilter() = allEndpoints() + + @JvmStatic + fun getEndpointsWithAminoAcidMutationFilter() = allEndpoints() + } } diff --git a/lapis2/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerTest.kt b/lapis2/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerTest.kt index 69cbedd0..ff186907 100644 --- a/lapis2/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerTest.kt +++ b/lapis2/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerTest.kt @@ -5,17 +5,14 @@ import com.fasterxml.jackson.databind.node.TextNode import com.ninjasquad.springmockk.MockkBean import io.mockk.every import org.genspectrum.lapis.model.SiloQueryModel -import org.genspectrum.lapis.request.AminoAcidInsertion import org.genspectrum.lapis.request.DataVersion import org.genspectrum.lapis.request.MutationProportionsRequest -import org.genspectrum.lapis.request.NucleotideInsertion import org.genspectrum.lapis.request.NucleotideMutation import org.genspectrum.lapis.request.SequenceFiltersRequestWithFields import org.genspectrum.lapis.response.AggregationData import org.genspectrum.lapis.response.AminoAcidMutationResponse import org.genspectrum.lapis.response.DetailsData import org.genspectrum.lapis.response.NucleotideMutationResponse -import org.hamcrest.Matchers.containsString import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.params.ParameterizedTest @@ -110,24 +107,6 @@ class LapisControllerTest(@Autowired val mockMvc: MockMvc) { .andExpect(jsonPath("\$.data[0].age").value(42)) } - @ParameterizedTest(name = "GET {0} with invalid nucleotide mutation") - @MethodSource("getEndpointsWithNucleotideMutationFilter") - fun `GET endpoint with invalid nucleotide mutation filter`( - endpoint: String, - ) { - mockMvc.perform(get(endpoint + "?nucleotideMutations=invalidMutation")) - .andExpect(status().isBadRequest) - .andExpect(jsonPath("\$.detail").value(containsString("Failed to convert 'nucleotideMutations'"))) - } - - @ParameterizedTest(name = "GET {0} with invalid nucleotide mutation") - @MethodSource("getEndpointsWithAminoAcidMutationFilter") - fun `GET endpoind with invalid amino acid mutation`(endpoint: String) { - mockMvc.perform(get(endpoint + "?aminoAcidMutations=invalidMutation")) - .andExpect(status().isBadRequest) - .andExpect(jsonPath("\$.detail").value(containsString("Failed to convert 'aminoAcidMutations'"))) - } - @Test fun `GET aggregated with valid mutation`() { every { @@ -148,46 +127,6 @@ class LapisControllerTest(@Autowired val mockMvc: MockMvc) { .andExpect(jsonPath("\$.data[0].count").value(5)) } - @Test - fun `GET aggregated with valid nucleotideInsertion`() { - every { - siloQueryModelMock.getAggregated( - SequenceFiltersRequestWithFields( - emptyMap(), - emptyList(), - emptyList(), - listOf(NucleotideInsertion(123, "ABC", null), NucleotideInsertion(124, "DEF", "segment")), - emptyList(), - emptyList(), - ), - ) - } returns listOf(AggregationData(5, emptyMap())) - - mockMvc.perform(get("/aggregated?nucleotideInsertions=ins_123:ABC,ins_segment:124:DEF")) - .andExpect(status().isOk) - .andExpect(jsonPath("\$.data[0].count").value(5)) - } - - @Test - fun `GET aggregated with valid aminoAcidInsertions`() { - every { - siloQueryModelMock.getAggregated( - SequenceFiltersRequestWithFields( - emptyMap(), - emptyList(), - emptyList(), - emptyList(), - listOf(AminoAcidInsertion(123, "S", "ABC"), AminoAcidInsertion(124, "ORF1", "DEF")), - emptyList(), - ), - ) - } returns listOf(AggregationData(5, emptyMap())) - - mockMvc.perform(get("/aggregated?aminoAcidInsertions=ins_S:123:ABC,ins_ORF1:124:DEF")) - .andExpect(status().isOk) - .andExpect(jsonPath("\$.data[0].count").value(5)) - } - @Test fun `POST aggregated with fields`() { every { @@ -215,26 +154,6 @@ class LapisControllerTest(@Autowired val mockMvc: MockMvc) { .andExpect(jsonPath("\$.data[0].age").value(42)) } - @ParameterizedTest(name = "GET {0} with invalid nucleotideInsertion") - @MethodSource("getEndpointsWithInsertionFilter") - fun `GET aggregated with invalid nucleotide insertion filter`( - endpoint: String, - ) { - mockMvc.perform(get(endpoint + "?nucleotideInsertions=invalidInsertion")) - .andExpect(status().isBadRequest) - .andExpect(jsonPath("\$.detail").value(containsString("Failed to convert 'nucleotideInsertions'"))) - } - - @ParameterizedTest(name = "GET {0} with invalid aminoAcidInsertion") - @MethodSource("getEndpointsWithInsertionFilter") - fun `GET aggregated with invalid amino acid insertion0filter`( - endpoint: String, - ) { - mockMvc.perform(get(endpoint + "?aminoAcidInsertions=invalidInsertion")) - .andExpect(status().isBadRequest) - .andExpect(jsonPath("\$.detail").value(containsString("Failed to convert 'aminoAcidInsertions'"))) - } - @ParameterizedTest(name = "GET {0} without explicit minProportion") @MethodSource("getMutationEndpointTypes") fun `GET mutations without explicit minProportion`( @@ -342,27 +261,11 @@ class LapisControllerTest(@Autowired val mockMvc: MockMvc) { } private companion object { - fun allEndpoints() = listOf( - Arguments.of("/nucleotideMutations"), - Arguments.of("/aminoAcidMutations"), - Arguments.of("/aggregated"), - Arguments.of("/details"), - ) - @JvmStatic fun getMutationEndpointTypes() = listOf( Arguments.of("/nucleotideMutations"), Arguments.of("/aminoAcidMutations"), ) - - @JvmStatic - fun getEndpointsWithInsertionFilter() = allEndpoints() - - @JvmStatic - fun getEndpointsWithNucleotideMutationFilter() = allEndpoints() - - @JvmStatic - fun getEndpointsWithAminoAcidMutationFilter() = allEndpoints() } @Test 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 b7c4c94d..b81db221 100644 --- a/lapis2/src/test/kotlin/org/genspectrum/lapis/request/AminoAcidInsertionTest.kt +++ b/lapis2/src/test/kotlin/org/genspectrum/lapis/request/AminoAcidInsertionTest.kt @@ -58,6 +58,26 @@ class AminoAcidInsertionTest { "\"ins_gene:123:?\"", AminoAcidInsertion(123, "gene", ".*"), ), + Arguments.of( + "\"ins_gene:123:.*CD\"", + AminoAcidInsertion(123, "gene", ".*CD"), + ), + Arguments.of( + "\"ins_gene:123:AB.*.*\"", + AminoAcidInsertion(123, "gene", "AB.*.*"), + ), + Arguments.of( + "\"ins_gene:123:?CD\"", + AminoAcidInsertion(123, "gene", ".*CD"), + ), + Arguments.of( + "\"ins_gene:123:AB??\"", + AminoAcidInsertion(123, "gene", "AB.*.*"), + ), + Arguments.of( + "\"ins_gene:123:AB.*?CD\"", + AminoAcidInsertion(123, "gene", "AB.*.*CD"), + ), ) @@ -65,6 +85,7 @@ class AminoAcidInsertionTest { fun getAminoAcidInsertionWithWrongSyntax() = listOf( Arguments.of("\"ins_::123:G\""), Arguments.of("\"ins_:123:\""), + Arguments.of("\"ins_gene:123:\""), Arguments.of("\"ins_gene:gene:123:ABC\""), Arguments.of("\"ins_123:ABCD\""), Arguments.of("\"ins_gene\$name&with/invalid)chars:123:A\""), 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 93c011d6..8e2199f7 100644 --- a/lapis2/src/test/kotlin/org/genspectrum/lapis/request/NucleotideInsertionTest.kt +++ b/lapis2/src/test/kotlin/org/genspectrum/lapis/request/NucleotideInsertionTest.kt @@ -62,6 +62,30 @@ class NucleotideInsertionTest { "\"ins_segment:123:?\"", NucleotideInsertion(123, ".*", "segment"), ), + Arguments.of( + "\"ins_segment:123:AB.*CD\"", + NucleotideInsertion(123, "AB.*CD", "segment"), + ), + Arguments.of( + "\"ins_segment:123:.*CD\"", + NucleotideInsertion(123, ".*CD", "segment"), + ), + Arguments.of( + "\"ins_segment:123:AB.*.*\"", + NucleotideInsertion(123, "AB.*.*", "segment"), + ), + Arguments.of( + "\"ins_segment:123:?CD\"", + NucleotideInsertion(123, ".*CD", "segment"), + ), + Arguments.of( + "\"ins_segment:123:AB??\"", + NucleotideInsertion(123, "AB.*.*", "segment"), + ), + Arguments.of( + "\"ins_segment:123:AB.*?CD\"", + NucleotideInsertion(123, "AB.*.*CD", "segment"), + ), ) @@ -69,7 +93,9 @@ class NucleotideInsertionTest { fun getNucleotideInsertionWithWrongSyntax() = listOf( Arguments.of("\"ins_::123:G\""), Arguments.of("\"ins_:123:\""), + Arguments.of("\"ins_segment:123:\""), Arguments.of("\"ins_segment:segment:123:ABC\""), + Arguments.of("\"ins_segmentWithDotWithoutStar:123:AB.C\""), Arguments.of("\"ins_segment\$name&with/invalid)chars:123:A\""), ) } diff --git a/lapis2/src/test/resources/config/testDatabaseConfig.yaml b/lapis2/src/test/resources/config/testDatabaseConfig.yaml index 2003b9a3..aa56983f 100644 --- a/lapis2/src/test/resources/config/testDatabaseConfig.yaml +++ b/lapis2/src/test/resources/config/testDatabaseConfig.yaml @@ -12,6 +12,10 @@ schema: type: string - name: pangoLineage type: pango_lineage + - name: nucInsertion + type: insertion + - name: aaInsertion + type: aaInsertion features: - name: sarsCoV2VariantQuery primaryKey: gisaid_epi_isl diff --git a/lapis2/src/test/resources/config/testDatabaseConfigWithoutFeatures.yaml b/lapis2/src/test/resources/config/testDatabaseConfigWithoutFeatures.yaml index 94c23e30..55931585 100644 --- a/lapis2/src/test/resources/config/testDatabaseConfigWithoutFeatures.yaml +++ b/lapis2/src/test/resources/config/testDatabaseConfigWithoutFeatures.yaml @@ -12,4 +12,8 @@ schema: type: string - name: pangoLineage type: pango_lineage + - name: nucInsertion + type: insertion + - name: aaInsertion + type: aaInsertion primaryKey: gisaid_epi_isl diff --git a/siloLapisTests/test/aggregated.spec.ts b/siloLapisTests/test/aggregated.spec.ts index e9addf60..75c9503e 100644 --- a/siloLapisTests/test/aggregated.spec.ts +++ b/siloLapisTests/test/aggregated.spec.ts @@ -49,6 +49,28 @@ describe('The /aggregated endpoint', () => { expect(result.data).to.have.length(1); }); + it('should correctly handle nucleotide insertion requests in GET requests', async () => { + const result = await lapisClient.postAggregated1({ + aggregatedPostRequest: { + nucleotideInsertions: ['ins_25701:CC?', 'ins_5959:?AT'], + }, + }); + + expect(result.data).to.have.length(1); + expect(result.data[0].count).to.equal(1); + }); + + it('should correctly handle amino acid insertion requests in GET requests', async () => { + const result = await lapisClient.postAggregated1({ + aggregatedPostRequest: { + aminoAcidInsertions: ['ins_S:143:T', 'ins_ORF1a:3602:F?P'], + }, + }); + + expect(result.data).to.have.length(1); + expect(result.data[0].count).to.equal(1); + }); + it('should order by specified fields', async () => { const ascendingOrderedResult = await lapisClient.postAggregated1({ aggregatedPostRequest: { @@ -57,7 +79,8 @@ describe('The /aggregated endpoint', () => { }, }); - expect(ascendingOrderedResult.data[0]).to.have.property('division', 'Aargau'); + expect(ascendingOrderedResult.data[0].division).to.be.undefined; + expect(ascendingOrderedResult.data[1]).to.have.property('division', 'Aargau'); const descendingOrderedResult = await lapisClient.postAggregated1({ aggregatedPostRequest: { @@ -79,7 +102,7 @@ describe('The /aggregated endpoint', () => { }); expect(resultWithLimit.data).to.have.length(2); - expect(resultWithLimit.data[1]).to.have.property('division', 'Basel-Land'); + expect(resultWithLimit.data[1]).to.have.property('division', 'Aargau'); const resultWithLimitAndOffset = await lapisClient.postAggregated1({ aggregatedPostRequest: { @@ -106,15 +129,16 @@ describe('The /aggregated endpoint', () => { expect(await result.text()).to.be.equal( String.raw` age,country,count +null,Switzerland,2 4,Switzerland,2 5,Switzerland,1 6,Switzerland,1 50,Switzerland,17 -51,Switzerland,8 +51,Switzerland,7 52,Switzerland,8 53,Switzerland,8 54,Switzerland,9 -55,Switzerland,9 +55,Switzerland,8 56,Switzerland,9 57,Switzerland,10 58,Switzerland,9 @@ -135,15 +159,16 @@ age,country,count expect(await result.text()).to.be.equal( String.raw` age country count +null Switzerland 2 4 Switzerland 2 5 Switzerland 1 6 Switzerland 1 50 Switzerland 17 -51 Switzerland 8 +51 Switzerland 7 52 Switzerland 8 53 Switzerland 8 54 Switzerland 9 -55 Switzerland 9 +55 Switzerland 8 56 Switzerland 9 57 Switzerland 10 58 Switzerland 9 diff --git a/siloLapisTests/test/aggregatedQueries/aggregrationFields.json b/siloLapisTests/test/aggregatedQueries/aggregrationFields.json index f7edaf2c..e4e0bf89 100644 --- a/siloLapisTests/test/aggregatedQueries/aggregrationFields.json +++ b/siloLapisTests/test/aggregatedQueries/aggregrationFields.json @@ -11,6 +11,10 @@ ] }, "expected": [ + { + "count": 2, + "country": "Switzerland" + }, { "count": 6, "country": "Switzerland", @@ -27,7 +31,7 @@ "division": "Basel-Stadt" }, { - "count": 10, + "count": 9, "country": "Switzerland", "division": "Bern" }, @@ -67,7 +71,7 @@ "division": "Schwyz" }, { - "count": 16, + "count": 15, "country": "Switzerland", "division": "Solothurn" }, diff --git a/siloLapisTests/test/aggregatedQueries/date.json b/siloLapisTests/test/aggregatedQueries/date.json index 89495552..cba58692 100644 --- a/siloLapisTests/test/aggregatedQueries/date.json +++ b/siloLapisTests/test/aggregatedQueries/date.json @@ -1,5 +1,5 @@ { - "testCaseName": "date to 2021-06-05", + "testCaseName": "date 2021-06-05", "lapisRequest": { "date": "2021-06-05" }, diff --git a/siloLapisTests/test/aggregatedQueries/dateTo.json b/siloLapisTests/test/aggregatedQueries/dateTo.json index a887fe41..cedcfe39 100644 --- a/siloLapisTests/test/aggregatedQueries/dateTo.json +++ b/siloLapisTests/test/aggregatedQueries/dateTo.json @@ -5,7 +5,7 @@ }, "expected": [ { - "count": 89 + "count": 88 } ] } diff --git a/siloLapisTests/test/aggregatedQueries/intBetween.json b/siloLapisTests/test/aggregatedQueries/intBetween.json index b85fbf93..0408861c 100644 --- a/siloLapisTests/test/aggregatedQueries/intBetween.json +++ b/siloLapisTests/test/aggregatedQueries/intBetween.json @@ -6,7 +6,7 @@ }, "expected": [ { - "count": 24 + "count": 23 } ] } diff --git a/siloLapisTests/test/aggregatedQueries/intEquals.json b/siloLapisTests/test/aggregatedQueries/intEquals.json index 2f86cc48..470c7d96 100644 --- a/siloLapisTests/test/aggregatedQueries/intEquals.json +++ b/siloLapisTests/test/aggregatedQueries/intEquals.json @@ -1,11 +1,11 @@ { - "testCaseName": "int between", + "testCaseName": "int equals", "lapisRequest": { "age": 51 }, "expected": [ { - "count": 8 + "count": 7 } ] } diff --git a/siloLapisTests/test/aggregatedQueries/regionIsEurope.json b/siloLapisTests/test/aggregatedQueries/regionIsEurope.json index 39dcab35..5c8b9f30 100644 --- a/siloLapisTests/test/aggregatedQueries/regionIsEurope.json +++ b/siloLapisTests/test/aggregatedQueries/regionIsEurope.json @@ -5,7 +5,7 @@ }, "expected": [ { - "count": 100 + "count": 99 } ] } diff --git a/siloLapisTests/test/aminoAcidMutations.spec.ts b/siloLapisTests/test/aminoAcidMutations.spec.ts index d3cca3df..f3f2c6a5 100644 --- a/siloLapisTests/test/aminoAcidMutations.spec.ts +++ b/siloLapisTests/test/aminoAcidMutations.spec.ts @@ -81,6 +81,40 @@ describe('The /aminoAcidMutations endpoint', () => { expect(resultWithLimitAndOffset.data[0]).to.deep.equal(resultWithLimit.data[1]); }); + it('should correctly handle nucleotide insertion requests in GET requests', async () => { + const expectedFirstResultWithNucleotideInsertion = { + count: 1, + mutation: 'E:T9I', + proportion: 1.0, + }; + + const result = await lapisClient.postAminoAcidMutations1({ + sequenceFiltersWithMinProportion: { + nucleotideInsertions: ['ins_25701:CC?', 'ins_5959:?AT'], + }, + }); + + expect(result.data).to.have.length(55); + expect(result.data[0]).to.deep.equal(expectedFirstResultWithNucleotideInsertion); + }); + + it('should correctly handle amino acid insertion requests in GET requests', async () => { + const expectedFirstResultWithAminoAcidInsertion = { + count: 1, + mutation: 'N:A220V', + proportion: 1.0, + }; + + const result = await lapisClient.postAminoAcidMutations1({ + sequenceFiltersWithMinProportion: { + aminoAcidInsertions: ['ins_S:143:T', 'ins_ORF1a:3602:F?P'], + }, + }); + + expect(result.data).to.have.length(25); + expect(result.data[0]).to.deep.equal(expectedFirstResultWithAminoAcidInsertion); + }); + it('should return the data as CSV', async () => { const urlParams = new URLSearchParams({ country: 'Switzerland', diff --git a/siloLapisTests/test/details.spec.ts b/siloLapisTests/test/details.spec.ts index c1107194..28cd1737 100644 --- a/siloLapisTests/test/details.spec.ts +++ b/siloLapisTests/test/details.spec.ts @@ -14,6 +14,8 @@ describe('The /details endpoint', () => { expect(result.data).to.have.length(2); expect(result.data[0]).to.be.deep.equal({ + aaInsertions: undefined, + insertions: undefined, age: undefined, country: undefined, date: undefined, @@ -34,6 +36,8 @@ describe('The /details endpoint', () => { expect(result.data).to.have.length(2); expect(result.data[0]).to.be.deep.equal({ + aaInsertions: undefined, + insertions: undefined, age: 50, country: 'Switzerland', date: '2021-07-19', @@ -53,7 +57,9 @@ describe('The /details endpoint', () => { }, }); - expect(ascendingOrderedResult.data[0]).to.have.property('division', 'Aargau'); + expect(ascendingOrderedResult.data[0].division).to.be.undefined; + expect(ascendingOrderedResult.data[1].division).to.be.undefined; + expect(ascendingOrderedResult.data[2]).to.have.property('division', 'Aargau'); const descendingOrderedResult = await lapisClient.postDetails1({ detailsPostRequest: { @@ -130,6 +136,54 @@ Solothurn EPI_ISL_1002052 B.1 ); }); + it('should correctly handle nucleotide insertion requests in POST requests', async () => { + const expectedResultWithNucleotideInsertion = { + aaInsertions: undefined, + age: 57, + country: 'Switzerland', + date: '2021-05-12', + division: 'Zürich', + gisaidEpiIsl: 'EPI_ISL_3578231', + insertions: '25701:CCC,5959:TAT', + pangoLineage: 'B.1.1.28.1', + qcValue: 0.93, + region: 'Europe', + }; + + const result = await lapisClient.postDetails1({ + detailsPostRequest: { + nucleotideInsertions: ['ins_25701:CC?', 'ins_5959:?AT'], + }, + }); + + expect(result.data).to.have.length(1); + expect(result.data[0]).to.deep.equal(expectedResultWithNucleotideInsertion); + }); + + it('should correctly handle amino acid insertion requests in POST requests', async () => { + const expectedResultWithAminoAcidInsertion = { + aaInsertions: 'S:143:T,ORF1a:3602:FEP', + insertions: undefined, + age: 52, + country: 'Switzerland', + date: '2021-07-04', + division: 'Vaud', + gisaidEpiIsl: 'EPI_ISL_3259931', + pangoLineage: 'B.1.617.2.43', + qcValue: 0.98, + region: 'Europe', + }; + + const result = await lapisClient.postDetails1({ + detailsPostRequest: { + aminoAcidInsertions: ['ins_S:143:T', 'ins_ORF1a:3602:F?P'], + }, + }); + + expect(result.data).to.have.length(1); + expect(result.data[0]).to.deep.equal(expectedResultWithAminoAcidInsertion); + }); + it('should return the lapis data version in the response', async () => { const result = await fetch(basePath + '/details'); diff --git a/siloLapisTests/test/nucleotideMutations.spec.ts b/siloLapisTests/test/nucleotideMutations.spec.ts index 411125e3..18cb3ac4 100644 --- a/siloLapisTests/test/nucleotideMutations.spec.ts +++ b/siloLapisTests/test/nucleotideMutations.spec.ts @@ -81,6 +81,40 @@ describe('The /nucleotideMutations endpoint', () => { expect(resultWithLimitAndOffset.data[0]).to.deep.equal(resultWithLimit.data[1]); }); + it('should correctly handle nucleotide insertion requests in GET requests', async () => { + const expectedFirstResultWithNucleotideInsertion = { + count: 1, + mutation: 'C241T', + proportion: 1.0, + }; + + const result = await lapisClient.postNucleotideMutations1({ + sequenceFiltersWithMinProportion: { + nucleotideInsertions: ['ins_25701:CC?', 'ins_5959:?AT'], + }, + }); + + expect(result.data).to.have.length(115); + expect(result.data[0]).to.deep.equal(expectedFirstResultWithNucleotideInsertion); + }); + + it('should correctly handle amino acid insertion requests in GET requests', async () => { + const expectedFirstResultWithAminoAcidInsertion = { + count: 1, + mutation: 'G210T', + proportion: 1.0, + }; + + const result = await lapisClient.postNucleotideMutations1({ + sequenceFiltersWithMinProportion: { + aminoAcidInsertions: ['ins_S:143:T', 'ins_ORF1a:3602:F?P'], + }, + }); + + expect(result.data).to.have.length(108); + expect(result.data[0]).to.deep.equal(expectedFirstResultWithAminoAcidInsertion); + }); + it('should return the data as CSV', async () => { const urlParams = new URLSearchParams({ country: 'Switzerland', diff --git a/siloLapisTests/testData/small_metadata_set.tsv b/siloLapisTests/testData/small_metadata_set.tsv index 9a69bb71..7b2bcc75 100644 --- a/siloLapisTests/testData/small_metadata_set.tsv +++ b/siloLapisTests/testData/small_metadata_set.tsv @@ -1,101 +1,101 @@ -gisaid_epi_isl pango_lineage date region country division unsorted_date age qc_value -EPI_ISL_1408408 B.1.1.7 2021-03-18 Europe Switzerland Basel-Land 2021-01-15 4 0.98 -EPI_ISL_1749899 B.1.1.7 2021-04-13 Europe Switzerland Bern 2020-03-08 5 0.97 -EPI_ISL_2016901 B.1.1.7 2021-04-25 Europe Switzerland Aargau 2021-01-29 6 0.96 -EPI_ISL_1749892 B.1.1.7 2021-04-13 Europe Switzerland Bern 2020-12-24 4 0.95 -EPI_ISL_1597932 B.1.1.7 2021-03-19 Europe Switzerland Solothurn 2021-02-10 54 0.94 -EPI_ISL_1407962 B.1.1.7 2021-03-15 Europe Switzerland Solothurn 2021-01-16 55 0.93 -EPI_ISL_1750503 B.1.258.17 2020-12-24 Europe Switzerland Zürich 2021-02-14 56 0.92 -EPI_ISL_1360935 B.1.1.7 2021-03-08 Europe Switzerland Jura 2021-01-03 57 0.91 -EPI_ISL_2019235 B.1.1.7 2021-04-28 Europe Switzerland Basel-Stadt 2021-01-22 58 0.90 -EPI_ISL_1749960 B.1.1.7 2021-04-15 Europe Switzerland Basel-Land 2021-02-03 59 0.89 -EPI_ISL_1361468 B.1.1.7 2021-03-06 Europe Switzerland Zürich 2021-01-20 50 0.98 -EPI_ISL_1408062 B.1.1.7 2021-03-03 Europe Switzerland Valais 2020-11-24 50 0.97 -EPI_ISL_1597890 B.1.1.7 2021-03-21 Europe Switzerland Vaud 2021-01-25 51 0.96 -EPI_ISL_1682849 B.1.236 2020-12-17 Europe Switzerland Thurgau 2021-01-21 52 0.95 -EPI_ISL_1408805 B.1.221 2020-11-24 Europe Switzerland Schwyz 2020-12-09 53 0.94 -EPI_ISL_1750868 B.1.1.189 2020-12-15 Europe Switzerland Solothurn 2021-01-20 54 0.93 -EPI_ISL_2019350 B.1.1.7 2021-04-27 Europe Switzerland Valais 2020-12-21 55 0.92 -EPI_ISL_2017036 B.1.1.7 2021-04-23 Europe Switzerland Solothurn 2021-03-09 56 0.91 -EPI_ISL_1599113 B.1.1.39 2020-12-08 Europe Switzerland Zürich 2021-03-05 57 0.90 -EPI_ISL_2214128 B.1.1.7 2021-05-10 Europe Switzerland Geneva 2020-11-13 58 0.89 -EPI_ISL_2408472 B.1.1.7 2021-05-25 Europe Switzerland Obwalden 2021-03-02 59 0.98 -EPI_ISL_830864 B.1.177 2020-10-08 Europe Switzerland Basel-Stadt 2021-03-03 50 0.97 -EPI_ISL_581968 B.1.160 2020-08-17 Europe Switzerland Basel-Stadt 2021-03-25 50 0.96 -EPI_ISL_2213804 Q.7 2021-05-08 Europe Switzerland Geneva 2021-04-12 51 0.95 -EPI_ISL_2405276 B.1.1.7 2021-05-24 Europe Switzerland Vaud 2021-04-28 52 0.94 -EPI_ISL_2213934 B.1.1.7 2021-05-13 Europe Switzerland Geneva 2021-04-23 53 0.93 -EPI_ISL_2213984 B.1.1.7 2021-05-08 Europe Switzerland Geneva 2021-05-09 54 0.92 -EPI_ISL_2574088 B.1.1.7 2021-06-10 Europe Switzerland Sankt Gallen 2021-05-05 55 0.91 -EPI_ISL_2544226 B.1.1.7 2021-06-05 Europe Switzerland Ticino 2021-05-12 56 0.90 -EPI_ISL_2360326 Q.7 2021-05-23 Europe Switzerland Ticino 2021-03-10 57 0.89 -EPI_ISL_2379651 B.1.1.7 2021-05-11 Europe Switzerland Valais 2021-06-01 58 0.98 -EPI_ISL_1036103 B.1.258 2020-12-09 Europe Switzerland Aargau 2021-06-03 59 0.97 -EPI_ISL_931279 B.1.1 2020-10-28 Europe Switzerland Basel-Stadt 2021-05-11 50 0.96 -EPI_ISL_931031 B.1.177 2020-10-22 Europe Switzerland Basel-Stadt 2021-05-10 50 0.95 -EPI_ISL_1273458 B.1.1.7 2021-01-26 Europe Switzerland Basel-Land 2021-05-18 51 0.94 -EPI_ISL_1273715 B.1.160 2021-01-20 Europe Switzerland Basel-Stadt 2021-05-08 52 0.93 -EPI_ISL_737604 B.1.1 2020-12-14 Europe Switzerland Bern 2021-05-14 53 0.92 -EPI_ISL_1129663 B.1.1.7 2020-12-29 Europe Switzerland Bern 2021-05-07 54 0.91 -EPI_ISL_1003629 B.1.1.39 2021-01-25 Europe Switzerland Aargau 2021-05-18 55 0.90 -EPI_ISL_737715 B.1.177 2020-12-13 Europe Switzerland Bern 2021-05-16 56 0.89 -EPI_ISL_1003036 B.1.177 2021-01-16 Europe Switzerland Aargau 2021-07-14 57 0.98 -EPI_ISL_899762 B.1.177 2020-12-25 Europe Switzerland Schwyz 2021-07-19 58 0.97 -EPI_ISL_899725 B.1.177 2021-01-12 Europe Switzerland Solothurn 2021-07-14 59 0.96 -EPI_ISL_1195052 B.1.1.7 2021-02-23 Europe Switzerland Solothurn 2021-07-04 50 0.95 -EPI_ISL_1003519 B.1.160.16 2021-01-22 Europe Switzerland Solothurn 2021-07-29 50 0.94 -EPI_ISL_1003010 B.1.36.35 2021-01-15 Europe Switzerland Solothurn 2021-07-19 51 0.93 -EPI_ISL_1119584 B.1.1 2020-11-04 Europe Switzerland Solothurn 2021-07-05 52 0.92 -EPI_ISL_1002052 B.1 2021-01-15 Europe Switzerland Solothurn 2021-07-15 53 0.91 -EPI_ISL_466942 B.1 2020-03-08 Europe Switzerland Basel-Stadt 2021-05-12 54 0.90 -EPI_ISL_1003849 B.1.160 2021-01-29 Europe Switzerland Neuchâtel 2021-08-05 55 0.89 -EPI_ISL_768148 B.1.160 2020-12-24 Europe Switzerland Sankt Gallen 2020-03-16 56 0.98 -EPI_ISL_1080536 B.1.1.7 2021-02-10 Europe Switzerland Basel-Land 2021-08-04 57 0.97 -EPI_ISL_1002156 B.1.221 2021-01-16 Europe Switzerland Basel-Land 2021-02-03 58 0.96 -EPI_ISL_1119315 B.1.1.7 2021-02-14 Europe Switzerland Graubünden 2021-03-18 59 0.95 -EPI_ISL_1004495 B.1.177.44 2021-01-03 Europe Switzerland Bern 2021-04-13 50 0.94 -EPI_ISL_1001920 B.1.177 2021-01-22 Europe Switzerland Bern 2021-04-25 50 0.93 -EPI_ISL_1131102 B.1.160 2021-02-03 Europe Switzerland Zürich 2021-04-13 51 0.92 -EPI_ISL_1003373 B.1.177 2021-01-20 Europe Switzerland Zürich 2021-03-19 52 0.91 -EPI_ISL_721941 B.1.1.70 2020-11-24 Europe Switzerland Zürich 2021-03-15 53 0.90 -EPI_ISL_1130868 B.1.525 2021-01-25 Europe Switzerland Zürich 2020-12-24 54 0.89 -EPI_ISL_1003425 B.1.177 2021-01-21 Europe Switzerland Uri 2021-03-08 55 0.98 -EPI_ISL_737860 B.1.160 2020-12-09 Europe Switzerland Valais 2021-04-28 56 0.97 -EPI_ISL_1001493 B.1.177.44 2021-01-20 Europe Switzerland Vaud 2021-04-15 57 0.96 -EPI_ISL_1260480 B.1.160 2020-12-21 Europe Switzerland Zürich 2021-03-06 58 0.95 -EPI_ISL_1747885 B.1.1.7 2021-03-09 Europe Switzerland Solothurn 2021-03-03 59 0.94 -EPI_ISL_1747752 B.1.1.7 2021-03-05 Europe Switzerland Basel-Land 2021-03-21 50 0.93 -EPI_ISL_1005148 B.1.221 2020-11-13 Europe Switzerland Solothurn 2020-12-17 50 0.92 -EPI_ISL_1748243 B.1.1.7 2021-03-02 Europe Switzerland Solothurn 2020-11-24 51 0.91 -EPI_ISL_1748215 B.1.1.7 2021-03-03 Europe Switzerland Solothurn 2020-12-15 52 0.90 -EPI_ISL_1748395 B.1.1.7 2021-03-25 Europe Switzerland Basel-Stadt 2021-04-27 53 0.89 -EPI_ISL_1760534 B.1.1.7 2021-04-12 Europe Switzerland Ticino 2021-04-23 54 0.98 -EPI_ISL_2086867 C.36.3 2021-04-28 Europe Switzerland Zürich 2020-12-08 55 0.97 -EPI_ISL_1840634 Q.7 2021-04-23 Europe Switzerland Ticino 2021-05-10 56 0.96 -EPI_ISL_2180995 B.1.1.7 2021-05-09 Europe Switzerland Basel-Stadt 2021-05-25 57 0.95 -EPI_ISL_2181005 B.1.1.7 2021-05-05 Europe Switzerland Basel-Stadt 2020-10-08 58 0.94 -EPI_ISL_2180023 B.1.1.7 2021-05-12 Europe Switzerland Ticino 2020-08-17 59 0.93 -EPI_ISL_2270139 B.1.1.7 2021-03-10 Europe Switzerland Basel-Stadt 2021-05-08 50 0.92 -EPI_ISL_2544452 B.1.1.7 2021-06-01 Europe Switzerland Schwyz 2021-05-24 50 0.91 -EPI_ISL_2544332 B.1.1.7 2021-06-03 Europe Switzerland Bern 2021-05-13 51 0.90 -EPI_ISL_2307766 B.1.1.7 2021-05-11 Europe Switzerland Bern 2021-05-08 52 0.89 -EPI_ISL_2375490 B.1.1.7 2021-05-10 Europe Switzerland Valais 2021-06-10 53 0.98 -EPI_ISL_2374969 B.1.1.7 2021-05-18 Europe Switzerland Aargau 2021-06-05 54 0.97 -EPI_ISL_2307888 B.1.1.7 2021-05-08 Europe Switzerland Solothurn 2021-05-23 55 0.96 -EPI_ISL_2375247 B.1.1.7 2021-05-14 Europe Switzerland Sankt Gallen 2021-05-11 56 0.95 -EPI_ISL_2308054 B.1.1.7 2021-05-07 Europe Switzerland Zürich 2020-12-09 57 0.94 -EPI_ISL_2375165 B.1.1.7 2021-05-18 Europe Switzerland Basel-Land 2020-10-28 58 0.93 -EPI_ISL_2375097 B.1.1.7 2021-05-16 Europe Switzerland Basel-Land 2020-10-22 59 0.92 -EPI_ISL_3128737 AY.9.2 2021-07-14 Europe Switzerland Zürich 2021-01-26 50 0.91 -EPI_ISL_3128811 B.1.617.2 2021-07-19 Europe Switzerland Aargau 2021-01-20 50 0.90 -EPI_ISL_3086369 AY.122 2021-07-14 Europe Switzerland Ticino 2020-12-14 51 0.89 -EPI_ISL_3259931 AY.43 2021-07-04 Europe Switzerland Vaud 2020-12-29 52 0.98 -EPI_ISL_3267832 AY.43 2021-07-29 Europe Switzerland Bern 2021-01-25 53 0.97 -EPI_ISL_3128796 B.1.617.2 2021-07-19 Europe Switzerland Zürich 2020-12-13 54 0.96 -EPI_ISL_3016465 B.1.1.7 2021-07-05 Europe Switzerland Valais 2021-01-16 55 0.95 -EPI_ISL_3247294 AY.42 2021-07-15 Europe Switzerland Basel-Stadt 2020-12-25 56 0.94 -EPI_ISL_3578231 P.1 2021-05-12 Europe Switzerland Zürich 2021-01-12 57 0.93 -EPI_ISL_3465732 AY.43 2021-08-05 Europe Switzerland Vaud 2021-02-23 58 0.92 -EPI_ISL_2367431 B.1 2020-03-16 Europe Switzerland Vaud 2021-01-22 59 0.91 -EPI_ISL_3465556 AY.43 2021-08-04 Europe Switzerland Solothurn 2021-01-15 50 0.90 -EPI_ISL_2359636 B.1.1.189 2021-02-03 Europe Switzerland Vaud 2020-11-04 57 0.89 \ No newline at end of file +gisaid_epi_isl pango_lineage date region country division unsorted_date age qc_value insertions aaInsertions +EPI_ISL_1408408 B.1.1.7 2021-03-18 Europe Switzerland Basel-Land 4 0.98 S:214:EPE +EPI_ISL_1749899 B.1.1.7 2021-04-13 Europe Switzerland Bern 2020-03-08 5 0.97 +EPI_ISL_2016901 B.1.1.7 2021-04-25 Europe Switzerland Aargau 2021-01-29 6 0.96 +EPI_ISL_1749892 B.1.1.7 2021-04-13 Europe Switzerland Bern 2020-12-24 4 0.95 +EPI_ISL_1597932 B.1.1.7 2021-03-19 Europe Switzerland Solothurn 2021-02-10 54 0.94 S:214:EPE +EPI_ISL_1407962 B.1.1.7 Europe Switzerland Solothurn 2021-01-16 55 0.93 +EPI_ISL_1750503 B.1.258.17 2020-12-24 Europe Switzerland Zürich 2021-02-14 56 0.92 +EPI_ISL_1360935 B.1.1.7 2021-03-08 Europe Switzerland Jura 2021-01-03 57 0.91 +EPI_ISL_2019235 B.1.1.7 2021-04-28 Europe Switzerland Basel-Stadt 2021-01-22 58 0.90 +EPI_ISL_1749960 B.1.1.7 2021-04-15 Europe Switzerland Basel-Land 2021-02-03 59 0.89 +EPI_ISL_1361468 B.1.1.7 2021-03-06 Europe Switzerland Zürich 2021-01-20 50 0.98 +EPI_ISL_1408062 B.1.1.7 2021-03-03 Europe Switzerland Valais 2020-11-24 50 0.97 22204:CAGAA +EPI_ISL_1597890 B.1.1.7 2021-03-21 Switzerland Vaud 2021-01-25 51 0.96 22339:GCTGGT +EPI_ISL_1682849 XA.1 2020-12-17 Europe Switzerland Thurgau 2021-01-21 52 0.95 +EPI_ISL_1408805 B.1.221 2020-11-24 Europe Switzerland Schwyz 2020-12-09 53 0.94 +EPI_ISL_1750868 B.1.1.189 2020-12-15 Europe Switzerland Solothurn 2021-01-20 54 0.93 S:214:EPE +EPI_ISL_2019350 B.1.1.7 2021-04-27 Europe Switzerland Valais 2020-12-21 55 0.92 +EPI_ISL_2017036 B.1.1.7 2021-04-23 Europe Switzerland Solothurn 2021-03-09 56 0.91 +EPI_ISL_1599113 B.1.1.39 2020-12-08 Europe Switzerland Zürich 2021-03-05 57 0.90 +EPI_ISL_2214128 B.1.1.7 2021-05-10 Europe Switzerland Geneva 2020-11-13 58 0.89 +EPI_ISL_2408472 B.1.1.7 2021-05-25 Europe Switzerland Obwalden 2021-03-02 59 0.98 +EPI_ISL_830864 B.1.177 2020-10-08 Europe Switzerland Basel-Stadt 2021-03-03 50 0.97 +EPI_ISL_581968 B.1.160 2020-08-17 Europe Switzerland Basel-Stadt 2021-03-25 50 0.96 S:214:EPE +EPI_ISL_2213804 Q.7 2021-05-08 Europe Switzerland Geneva 2021-04-12 51 25701:CCC +EPI_ISL_2405276 B.1.1.7 2021-05-24 Europe Switzerland Vaud 2021-04-28 52 0.94 +EPI_ISL_2213934 B.1.1.7 2021-05-13 Europe Switzerland Geneva 2021-04-23 53 0.93 +EPI_ISL_2213984 B.1.1.7 2021-05-08 Europe Switzerland Geneva 2021-05-09 54 0.92 25701:CCC +EPI_ISL_2574088 B.1.1.7 2021-06-10 Europe Switzerland Sankt Gallen 2021-05-05 55 0.91 25701:CCC +EPI_ISL_2544226 B.1.1.7 2021-06-05 Europe Switzerland Ticino 2021-05-12 56 0.90 +EPI_ISL_2360326 Q.7 2021-05-23 Europe Switzerland Ticino 2021-03-10 57 0.89 +EPI_ISL_2379651 B.1.1.7 2021-05-11 Europe Switzerland Valais 2021-06-01 58 0.98 +EPI_ISL_1036103 B.1.258 2020-12-09 Europe Switzerland Aargau 2021-06-03 59 0.97 +EPI_ISL_931279 B.1.1 2020-10-28 Europe Switzerland Basel-Stadt 2021-05-11 50 0.96 +EPI_ISL_931031 B.1.177 2020-10-22 Europe Switzerland Basel-Stadt 2021-05-10 50 0.95 +EPI_ISL_1273458 B.1.1.7 2021-01-26 Europe Switzerland Basel-Land 2021-05-18 51 0.94 25701:CCC +EPI_ISL_1273715 B.1.160 2021-01-20 Europe Switzerland Basel-Stadt 2021-05-08 52 0.93 +EPI_ISL_737604 B.1.1 2020-12-14 Europe Switzerland Bern 2021-05-14 53 0.92 +EPI_ISL_1129663 B.1.1.7 2020-12-29 Europe Switzerland Bern 2021-05-07 54 0.91 +EPI_ISL_1003629 B.1.1.39 2021-01-25 Europe Switzerland Aargau 2021-05-18 55 0.90 S:214:EPE +EPI_ISL_737715 B.1.177 2020-12-13 Europe Switzerland Bern 2021-05-16 56 0.89 S:247:SGE +EPI_ISL_1003036 B.1.177 2021-01-16 Europe Switzerland Aargau 2021-07-14 57 0.98 5959:TAT +EPI_ISL_899762 B.1.177 2020-12-25 Europe Switzerland Schwyz 2021-07-19 58 0.97 +EPI_ISL_899725 B.1.177 2021-01-12 Europe Switzerland Solothurn 2021-07-14 59 0.96 S:210:IV +EPI_ISL_1195052 B.1.1.7 2021-02-23 Europe Switzerland Solothurn 2021-07-04 50 0.95 +EPI_ISL_1003519 B.1.160.16 2021-01-22 Europe Switzerland 2021-07-29 50 0.94 +EPI_ISL_1003010 B.1.36.35 2021-01-15 Europe Switzerland Solothurn 2021-07-19 51 0.93 +EPI_ISL_1119584 B.1.1 2020-11-04 Europe Switzerland Solothurn 2021-07-05 52 0.92 +EPI_ISL_1002052 B.1 2021-01-15 Europe Switzerland Solothurn 2021-07-15 53 0.91 +EPI_ISL_466942 B.1 2020-03-08 Europe Switzerland Basel-Stadt 2021-05-12 54 0.90 +EPI_ISL_1003849 B.1.160 2021-01-29 Europe Switzerland Neuchâtel 2021-08-05 55 0.89 +EPI_ISL_768148 GD.1 2020-12-24 Europe Switzerland Sankt Gallen 2020-03-16 56 0.98 25701:CCC +EPI_ISL_1080536 B.1.1.7 2021-02-10 Europe Switzerland Basel-Land 2021-08-04 57 0.97 +EPI_ISL_1002156 B.1.221 2021-01-16 Europe Switzerland Basel-Land 2021-02-03 58 0.96 +EPI_ISL_1119315 B.1.1.7 2021-02-14 Europe Switzerland Graubünden 2021-03-18 59 0.95 +EPI_ISL_1004495 B.1.177.44 2021-01-03 Europe Switzerland 2021-04-13 50 0.94 25701:CCC +EPI_ISL_1001920 B.1.177 2021-01-22 Europe Switzerland Bern 2021-04-25 50 0.93 +EPI_ISL_1131102 B.1.160 2021-02-03 Europe Switzerland Zürich 2021-04-13 51 0.92 +EPI_ISL_1003373 B.1.177 2021-01-20 Europe Switzerland Zürich 2021-03-19 52 0.91 +EPI_ISL_721941 B.1.1.70 2020-11-24 Europe Switzerland Zürich 2021-03-15 53 0.90 +EPI_ISL_1130868 B.1.525 2021-01-25 Europe Switzerland Zürich 2020-12-24 54 0.89 25701:CCC +EPI_ISL_1003425 B.1.177 2021-01-21 Europe Switzerland Uri 2021-03-08 55 0.98 +EPI_ISL_737860 B.1.160 2020-12-09 Europe Switzerland Valais 2021-04-28 56 0.97 +EPI_ISL_1001493 B.1.177.44 2021-01-20 Europe Switzerland Vaud 2021-04-15 57 0.96 +EPI_ISL_1260480 B.1.160 2020-12-21 Europe Switzerland Zürich 2021-03-06 58 0.95 +EPI_ISL_1747885 B.1.1.7 2021-03-09 Europe Switzerland Solothurn 2021-03-03 59 0.94 +EPI_ISL_1747752 B.1.1.7 2021-03-05 Europe Switzerland Basel-Land 2021-03-21 50 0.93 +EPI_ISL_1005148 B.1.221 2020-11-13 Europe Switzerland Solothurn 2020-12-17 50 0.92 25701:CCC +EPI_ISL_1748243 B.1.1.7 2021-03-02 Europe Switzerland Solothurn 2020-11-24 0.91 +EPI_ISL_1748215 B.1.1.7 2021-03-03 Europe Switzerland Solothurn 2020-12-15 52 0.90 +EPI_ISL_1748395 B.1.1.7 2021-03-25 Europe Switzerland Basel-Stadt 2021-04-27 53 0.89 +EPI_ISL_1760534 B.1.1.7 2021-04-12 Europe Switzerland Ticino 2021-04-23 54 0.98 +EPI_ISL_2086867 C.36.3 2021-04-28 Europe Switzerland Zürich 2020-12-08 55 0.97 25701:CCC +EPI_ISL_1840634 Q.7 2021-04-23 Europe Switzerland Ticino 2021-05-10 56 0.96 +EPI_ISL_2180995 B.1.1.7 2021-05-09 Europe Switzerland Basel-Stadt 2021-05-25 57 0.95 +EPI_ISL_2181005 B.1.1.7 2021-05-05 Europe Switzerland Basel-Stadt 2020-10-08 58 0.94 +EPI_ISL_2180023 B.1.1.7 2021-05-12 Europe Switzerland Ticino 2020-08-17 59 0.93 25701:CCC +EPI_ISL_2270139 B.1.1.7 2021-03-10 Europe Switzerland Basel-Stadt 2021-05-08 50 0.92 +EPI_ISL_2544452 B.1.1.7 2021-06-01 Europe Switzerland Schwyz 2021-05-24 50 0.91 +EPI_ISL_2544332 B.1.1.7 2021-06-03 Europe Switzerland Bern 2021-05-13 51 0.90 25701:CCC +EPI_ISL_2307766 B.1.1.7 2021-05-11 Europe Switzerland Bern 2021-05-08 52 0.89 +EPI_ISL_2375490 B.1.1.7 2021-05-10 Europe Switzerland Valais 2021-06-10 53 0.98 +EPI_ISL_2374969 B.1.1.7 2021-05-18 Europe Switzerland Aargau 2021-06-05 54 0.97 25701:CCC +EPI_ISL_2307888 B.1.1.7 2021-05-08 Europe Switzerland Solothurn 2021-05-23 55 0.96 +EPI_ISL_2375247 B.1.1.7 2021-05-14 Europe Switzerland Sankt Gallen 2021-05-11 56 25701:CCC +EPI_ISL_2308054 B.1.1.7 2021-05-07 Europe Switzerland Zürich 2020-12-09 57 0.94 +EPI_ISL_2375165 B.1.1.7 2021-05-18 Europe Switzerland Basel-Land 2020-10-28 58 0.93 +EPI_ISL_2375097 B.1.1.7 2021-05-16 Europe Switzerland Basel-Land 2020-10-22 59 0.92 +EPI_ISL_3128737 AY.9.2 2021-07-14 Europe Switzerland Zürich 2021-01-26 50 0.91 +EPI_ISL_3128811 B.1.617.2 2021-07-19 Europe Switzerland Aargau 2021-01-20 50 0.90 +EPI_ISL_3086369 AY.122 2021-07-14 Europe Switzerland Ticino 2020-12-14 51 0.89 25701:CCC +EPI_ISL_3259931 AY.43 2021-07-04 Europe Switzerland Vaud 2020-12-29 52 0.98 S:143:T,ORF1a:3602:FEP +EPI_ISL_3267832 AY.43 2021-07-29 Europe Switzerland Bern 2021-01-25 53 0.97 +EPI_ISL_3128796 B.1.617.2 2021-07-19 Europe Switzerland Zürich 2020-12-13 54 0.96 25701:CCC +EPI_ISL_3016465 B.1.1.7 2021-07-05 Europe Switzerland Valais 2021-01-16 0.95 +EPI_ISL_3247294 2021-07-15 Europe Switzerland Basel-Stadt 2020-12-25 56 0.94 +EPI_ISL_3578231 P.1 2021-05-12 Europe Switzerland Zürich 2021-01-12 57 0.93 25701:CCC,5959:TAT +EPI_ISL_3465732 AY.43 2021-08-05 Europe Switzerland Vaud 2021-02-23 58 0.92 +EPI_ISL_2367431 B.1 2020-03-16 Europe Switzerland Vaud 2021-01-22 59 0.91 +EPI_ISL_3465556 AY.43 2021-08-04 Europe Switzerland Solothurn 2021-01-15 50 0.90 +EPI_ISL_2359636 B.1.1.189 2021-02-03 Europe Switzerland Vaud 2020-11-04 57 0.89 25701:CCC ORF1a:3602:F diff --git a/siloLapisTests/testData/testDatabaseConfig.yaml b/siloLapisTests/testData/testDatabaseConfig.yaml index 758bfa54..dd23ce92 100644 --- a/siloLapisTests/testData/testDatabaseConfig.yaml +++ b/siloLapisTests/testData/testDatabaseConfig.yaml @@ -21,6 +21,10 @@ schema: type: int - name: qc_value type: float + - name: insertions + type: insertion + - name: aaInsertions + type: aaInsertion features: - name: sarsCoV2VariantQuery primaryKey: gisaid_epi_isl