Skip to content

Commit

Permalink
Update filters for rapid report
Browse files Browse the repository at this point in the history
  • Loading branch information
Nithriel committed Oct 17, 2023
1 parent d80ce18 commit fba2ec9
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
9 changes: 9 additions & 0 deletions app/routes/report/variants.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ const therapeuticAssociationFilter = {
{[Op.is]: literal('distinct from \'msi\'')},
{[Op.is]: literal('distinct from \'tmb\'')},
]},
[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 Down
4 changes: 2 additions & 2 deletions test/routes/report/variants.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const checkRapidReportMatches = (
}

kbMatches.forEach((match) => {
if (!match.evidenceLevel === expectedTable) {
if (!(match.evidenceLevel === expectedTable)) {
found = false;
}
});
Expand All @@ -57,7 +57,7 @@ const checkVariantsFilter = (
let found = true;

variants.forEach((variant) => {
if (!variant.displayName === expectedTable) {
if (!(variant.displayName === expectedTable)) {
found = false;
}
});
Expand Down
41 changes: 41 additions & 0 deletions test/testData/mockRapidReportData.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
"iprEvidenceLevel": "IPR-A",
"kbVariant": "this should be in table 1",
"matchedCancer": true,
"relevance": "sensitivity",
"evidenceLevel": "table 1"
},
{
"category": "therapeutic",
"variantType": "cnv",
"variant": "TA",
"iprEvidenceLevel": "IPR-B",
"kbVariant": "this should be in table 1",
"matchedCancer": true,
"relevance": "resistance",
"evidenceLevel": "table 1"
},
{
Expand All @@ -19,8 +30,38 @@
"iprEvidenceLevel": "IPR-B",
"kbVariant": "thisshouldbeintable1",
"matchedCancer": true,
"relevance": "sensitivity",
"evidenceLevel": "table 1"
},
{
"category": "therapeutic",
"variantType": "cnv",
"variant": "TA",
"iprEvidenceLevel": "IPR-B",
"kbVariant": "thisshouldbeintable2",
"matchedCancer": true,
"relevance": "resistance",
"evidenceLevel": "table 2"
},
{
"category": "therapeutic",
"variantType": "cnv",
"variant": "TA",
"iprEvidenceLevel": "IPR-A",
"kbVariant": "this should be in table 2",
"matchedCancer": true,
"relevance": "no sensitivity",
"evidenceLevel": "table 2"
},
{
"category": "therapeutic",
"variantType": "cnv",
"variant": "TA",
"iprEvidenceLevel": "IPR-A",
"kbVariant": "this should be in table 2",
"matchedCancer": true,
"evidenceLevel": "table 2"
},
{
"category": "unknown",
"variantType": "cnv",
Expand Down

0 comments on commit fba2ec9

Please sign in to comment.