Skip to content

Commit

Permalink
feat: added amino acid insertion search, added many test cases and fi…
Browse files Browse the repository at this point in the history
…xed various bugs
  • Loading branch information
Taepper committed Aug 22, 2023
1 parent 08ae05b commit d1e4b2b
Show file tree
Hide file tree
Showing 30 changed files with 373 additions and 239 deletions.
4 changes: 1 addition & 3 deletions endToEndTests/test/queries/DetailsOrderBy.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"query": {
"action": {
"type": "Details",
"orderByFields": [
"gisaid_epi_isl"
]
"orderByFields": ["gisaid_epi_isl"]
},
"filterExpression": {
"type": "And",
Expand Down
4 changes: 1 addition & 3 deletions endToEndTests/test/queries/DetailsOrderByLimit.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"query": {
"action": {
"type": "Details",
"orderByFields": [
"gisaid_epi_isl"
],
"orderByFields": ["gisaid_epi_isl"],
"offset": 9,
"limit": 2
},
Expand Down
4 changes: 1 addition & 3 deletions endToEndTests/test/queries/LimitLargerThanTable.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"query": {
"action": {
"type": "Details",
"orderByFields": [
"gisaid_epi_isl"
],
"orderByFields": ["gisaid_epi_isl"],
"limit": 1231241
},
"filterExpression": {
Expand Down
4 changes: 1 addition & 3 deletions endToEndTests/test/queries/Offset0.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"query": {
"action": {
"type": "Details",
"orderByFields": [
"gisaid_epi_isl"
],
"orderByFields": ["gisaid_epi_isl"],
"offset": 0
},
"filterExpression": {
Expand Down
4 changes: 1 addition & 3 deletions endToEndTests/test/queries/OffsetLimitOverlap.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"query": {
"action": {
"type": "Details",
"orderByFields": [
"gisaid_epi_isl"
],
"orderByFields": ["gisaid_epi_isl"],
"offset": 90,
"limit": 90
},
Expand Down
15 changes: 6 additions & 9 deletions endToEndTests/test/queries/aaInsertionsAction.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
"action": {
"type": "AminoAcidInsertions",
"column": "aaInsertions",
"orderByFields": [
"insertions",
"position"
]
"orderByFields": ["insertions", "position"]
},
"filterExpression": {
"type": "True"
Expand All @@ -17,31 +14,31 @@
{
"count": 5,
"insertions": "EPE",
"position": 215,
"position": 214,
"sequenceName": "S"
},
{
"count": 1,
"insertions": "F",
"position": 3603,
"position": 3602,
"sequenceName": "ORF1a"
},
{
"count": 1,
"insertions": "IV",
"position": 211,
"position": 210,
"sequenceName": "S"
},
{
"count": 1,
"insertions": "SGE",
"position": 248,
"position": 247,
"sequenceName": "S"
},
{
"count": 1,
"insertions": "T",
"position": 144,
"position": 143,
"sequenceName": "S"
}
]
Expand Down
38 changes: 6 additions & 32 deletions endToEndTests/test/queries/aaInsertionsActionAndFilter.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,21 @@
"action": {
"type": "AminoAcidInsertions",
"column": "aaInsertions",
"orderByFields": [
"insertions",
"position"
]
"orderByFields": ["insertions", "position"]
},
"filterExpression": {
"type": "InsertionContains",
"type": "AminoAcidInsertionContains",
"sequenceName": "S",
"value": "E.*",
"column": "aaInsertion",
"position": 215
"column": "aaInsertions",
"position": 214
}
},
"expectedQueryResult": [
{
"count": 5,
"insertions": "EPE",
"position": 215,
"sequenceName": "S"
},
{
"count": 1,
"insertions": "F",
"position": 3603,
"sequenceName": "ORF1a"
},
{
"count": 1,
"insertions": "IV",
"position": 211,
"sequenceName": "S"
},
{
"count": 1,
"insertions": "SGE",
"position": 248,
"sequenceName": "S"
},
{
"count": 1,
"insertions": "T",
"position": 144,
"position": 214,
"sequenceName": "S"
}
]
Expand Down
40 changes: 40 additions & 0 deletions endToEndTests/test/queries/aaInsertionsActionOneSequence.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"testCaseName": "amino acid insertions action only one sequence",
"query": {
"action": {
"type": "AminoAcidInsertions",
"column": "aaInsertions",
"orderByFields": ["insertions", "position"],
"sequenceName": "S"
},
"filterExpression": {
"type": "True"
}
},
"expectedQueryResult": [
{
"count": 5,
"insertions": "EPE",
"position": 214,
"sequenceName": "S"
},
{
"count": 1,
"insertions": "IV",
"position": 210,
"sequenceName": "S"
},
{
"count": 1,
"insertions": "SGE",
"position": 247,
"sequenceName": "S"
},
{
"count": 1,
"insertions": "T",
"position": 143,
"sequenceName": "S"
}
]
}
39 changes: 39 additions & 0 deletions endToEndTests/test/queries/aaInsertionsContains.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"testCaseName": "amino acid insertions contains filter",
"query": {
"action": {
"type": "Details",
"fields": ["aaInsertions", "gisaid_epi_isl"],
"orderByFields": ["gisaid_epi_isl"]
},
"filterExpression": {
"type": "AminoAcidInsertionContains",
"sequenceName": "S",
"value": "E.*E",
"column": "aaInsertions",
"position": 214
}
},
"expectedQueryResult": [
{
"aaInsertions": "S:214:EPE",
"gisaid_epi_isl": "EPI_ISL_1003629"
},
{
"aaInsertions": "S:214:EPE",
"gisaid_epi_isl": "EPI_ISL_1408408"
},
{
"aaInsertions": "S:214:EPE",
"gisaid_epi_isl": "EPI_ISL_1597932"
},
{
"aaInsertions": "S:214:EPE",
"gisaid_epi_isl": "EPI_ISL_1750868"
},
{
"aaInsertions": "S:214:EPE",
"gisaid_epi_isl": "EPI_ISL_581968"
}
]
}
21 changes: 9 additions & 12 deletions endToEndTests/test/queries/insertionsAction.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
"action": {
"type": "Insertions",
"column": "insertions",
"orderByFields": [
"insertions",
"position"
]
"orderByFields": ["insertions", "position"]
},
"filterExpression": {
"type": "True"
Expand All @@ -17,26 +14,26 @@
{
"count": 1,
"insertions": "CAGAA",
"position": 22205,
"sequenceName": ""
"position": 22204,
"sequenceName": "main"
},
{
"count": 17,
"insertions": "CCC",
"position": 25702,
"sequenceName": ""
"position": 25701,
"sequenceName": "main"
},
{
"count": 1,
"insertions": "GCTGGT",
"position": 22340,
"sequenceName": ""
"position": 22339,
"sequenceName": "main"
},
{
"count": 1,
"insertions": "TAT",
"position": 5960,
"sequenceName": ""
"position": 5959,
"sequenceName": "main"
}
]
}
4 changes: 2 additions & 2 deletions endToEndTests/test/queries/insertionsActionAndFilter.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
{
"count": 1,
"insertions": "GCTGGT",
"position": 22340,
"sequenceName": ""
"position": 22339,
"sequenceName": "main"
}
]
}
Loading

0 comments on commit d1e4b2b

Please sign in to comment.