Skip to content

Commit

Permalink
Merge pull request #254 from bcgsc/bugfix/DEVSU-1996-fix-tmb-filtering
Browse files Browse the repository at this point in the history
bugfix/DEVSU-1996-fix-tmb-filtering
  • Loading branch information
Nithriel authored May 15, 2023
2 parents ce72a67 + 895ca12 commit 6234439
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/routes/report/variants.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,13 @@ const cancerRelevanceFilter = {
},
variantType: {[Op.and]: [
{[Op.is]: literal('distinct from \'exp\'')},
{[Op.is]: literal('distinct from \'tmb\'')},
]},
// Regex filter for finding columns with 2 or more spaces that end with
// mutation or mutations
[Op.not]: {kbVariant: {[Op.regexp]: MUTATION_REGEX}},
};

const unknownSignificanceIncludes = ['mut', 'tmb'];
const unknownSignificanceIncludes = ['mut'];
const signatureVariant = ['tmb', 'msi'];

const unknownSignificanceGeneFilter = {
Expand Down
18 changes: 16 additions & 2 deletions test/routes/report/variants.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ describe('/reports/{REPORTID}/kb-matches', () => {
let rapidDataIprB;
let rapidDataAlreadyReported;
let rapidDataIprANotTherapeuticMsi;
let rapidDataIprANotTherapeuticTmb;
let rapidDataIprANotTherapeutic;
let rapidDataTherapeuticIprC;
let rapidDataTherapeuticIprCGeneric;
Expand All @@ -126,6 +127,7 @@ describe('/reports/{REPORTID}/kb-matches', () => {
let kbMatchRapidDataIprB;
let kbMatchRapidDataIprANotTherapeutic;
let kbMatchRapidDataIprANotTherapeuticMsi;
let kbMatchRapidDataIprANotTherapeuticTmb;
let kbMatchRapidDataAlreadyReported;
let kbMatchRapidDataTherapeuticIprC;
let kbMatchRapidDataTherapeuticIprCGeneric;
Expand Down Expand Up @@ -245,7 +247,6 @@ describe('/reports/{REPORTID}/kb-matches', () => {
});
rapidVariantTmb = await db.models.tmburMutationBurden.create({
reportId: rapidReport.id,
geneId: rapidGeneUSAllTrue.id,
});

rapidDataIprA = {
Expand Down Expand Up @@ -295,6 +296,15 @@ describe('/reports/{REPORTID}/kb-matches', () => {
kbVariant: 'also should be table 2',
};

rapidDataIprANotTherapeuticTmb = {
reportId: rapidReport.id,
variantId: rapidVariantTmb.id,
category: 'unknown',
variantType: 'tmb',
iprEvidenceLevel: 'IPR-A',
kbVariant: 'geneX specific mutation',
};

rapidDataTherapeuticIprC = {
reportId: rapidReport.id,
variantId: rapidVariantCR.id,
Expand Down Expand Up @@ -378,6 +388,9 @@ describe('/reports/{REPORTID}/kb-matches', () => {
kbMatchRapidDataIprANotTherapeuticMsi = await db.models.kbMatches.create(
rapidDataIprANotTherapeuticMsi,
);
kbMatchRapidDataIprANotTherapeuticTmb = await db.models.kbMatches.create(
rapidDataIprANotTherapeuticTmb,
);
kbMatchRapidDataAlreadyReported = await db.models.kbMatches.create(
rapidDataAlreadyReported,
);
Expand Down Expand Up @@ -410,6 +423,7 @@ describe('/reports/{REPORTID}/kb-matches', () => {
kbMatchRapidDataIprUnknownNull,
kbMatchRapidDataIprAMatchedCancerFalse,
kbMatchRapidDataIprANotTherapeuticMsi,
kbMatchRapidDataIprANotTherapeuticTmb,
];
unknownSignificanceMatches = [
kbMatchRapidDataIprAGeneric,
Expand All @@ -426,12 +440,12 @@ describe('/reports/{REPORTID}/kb-matches', () => {
cancerRelevanceVariants = [
rapidVariantCR,
rapidVariantMsi,
rapidVariantTmb,
];
unknownSignificanceVariants = [
rapidVariantUSOncogene,
rapidVariantUStumourSuppressor,
rapidVariantUSAllTrue,
rapidVariantTmb,
rapidVariantTAGeneric,
rapidVariantCRGeneric,
];
Expand Down

0 comments on commit 6234439

Please sign in to comment.