Skip to content

Commit

Permalink
Fix rapidReport filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Nithriel committed Nov 10, 2023
1 parent fba2ec9 commit 5089411
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
28 changes: 11 additions & 17 deletions app/routes/report/variants.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ const therapeuticAssociationFilter = {
{[Op.is]: literal('distinct from \'msi\'')},
{[Op.is]: literal('distinct from \'tmb\'')},
]},
[Op.or]: [
{
relevance: 'resistance',
iprEvidenceLevel: 'IPR-A',
},
{
relevance: 'sensitivity',
},
],
[Op.and]: {
[Op.or]: [
{
relevance: 'resistance',
iprEvidenceLevel: 'IPR-A',
},
{
relevance: 'sensitivity',
},
],
},
// Regex filter for finding columns with 2 or more spaces that end with
// mutation or mutations
[Op.not]: {kbVariant: {[Op.regexp]: MUTATION_REGEX}},
Expand All @@ -58,14 +60,6 @@ const therapeuticAssociationFilter = {
// Literal is used in order to accomodate NULL rows.
const cancerRelevanceFilter = {
id: {[Op.ne]: null},
[Op.not]: {
[Op.or]: [
{iprEvidenceLevel: {[Op.is]: literal('not distinct from \'IPR-A\'')}},
{iprEvidenceLevel: {[Op.is]: literal('not distinct from \'IPR-B\'')}},
],
category: 'therapeutic',
matchedCancer: true,
},
variantType: {[Op.and]: [
{[Op.is]: literal('distinct from \'exp\'')},
]},
Expand Down
12 changes: 11 additions & 1 deletion test/testData/mockRapidReportData.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"category": "therapeutic",
"variantType": "cnv",
"variant": "TA",
"iprEvidenceLevel": "IPR-B",
"iprEvidenceLevel": "IPR-A",
"kbVariant": "this should be in table 1",
"matchedCancer": true,
"relevance": "resistance",
Expand All @@ -43,6 +43,16 @@
"relevance": "resistance",
"evidenceLevel": "table 2"
},
{
"category": "therapeutic",
"variantType": "cnv",
"variant": "CR",
"iprEvidenceLevel": "IPR-D",
"kbVariant": "geneX specific mutation 7",
"matchedCancer": true,
"relevance": "sensitivity",
"evidenceLevel": "table 2"
},
{
"category": "therapeutic",
"variantType": "cnv",
Expand Down

0 comments on commit 5089411

Please sign in to comment.