Skip to content

Commit

Permalink
fix: error when the Mutations action looked for sequences but the fil…
Browse files Browse the repository at this point in the history
…ter was empty
  • Loading branch information
Taepper committed Sep 8, 2023
1 parent 2590b66 commit 91e5d52
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
29 changes: 29 additions & 0 deletions endToEndTests/test/queries/insertionContains_noSeqCol.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"testCaseName": "Insertion Contains without sequence or column specified",
"query": {
"action": {
"type": "Mutations",
"minProportion": 1
},
"filterExpression": {
"type": "And",
"children": [
{
"type": "InsertionContains",
"position": 25701,
"value": "CC.*"
},
{
"type": "InsertionContains",
"position": 22339,
"value": ".*C.*G.*"
}
]
}
},
"expectedQueryResult": [
{
"count": 1
}
]
}
17 changes: 17 additions & 0 deletions endToEndTests/test/queries/mutations_False.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"testCaseName": "Mutations action without sequence and empty result",
"query": {
"action": {
"type": "Mutations",
"minProportion": 1
},
"filterExpression": {
"type": "False"
}
},
"expectedQueryResult": [
{
"count": 1
}
]
}
11 changes: 8 additions & 3 deletions src/silo/query_engine/actions/mutations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,14 @@ QueryResult Mutations<SymbolType>::execute(
const SequenceStore<SymbolType>& sequence_store =
database.getSequenceStores<SymbolType>().at(sequence_name);

addMutationsToOutput(
sequence_name, sequence_store, bitmaps_to_evaluate.at(sequence_name), mutation_proportions
);
if (bitmaps_to_evaluate.contains(sequence_name)) {
addMutationsToOutput(
sequence_name,
sequence_store,
bitmaps_to_evaluate.at(sequence_name),
mutation_proportions
);
}
}
return {mutation_proportions};
}
Expand Down

0 comments on commit 91e5d52

Please sign in to comment.