From ba817f2f0168b94c7e28e22129f26b523220694d Mon Sep 17 00:00:00 2001 From: Karthik Kalletla Date: Tue, 21 Jan 2020 14:18:00 -0500 Subject: [PATCH] Filter fusion and structural varinat profiles while getting non mutation profiles --- src/pages/resultsView/ResultsViewPageStore.ts | 15 ++++----------- .../resultsView/ResultsViewPageStoreUtils.ts | 7 ++++++- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/pages/resultsView/ResultsViewPageStore.ts b/src/pages/resultsView/ResultsViewPageStore.ts index a584627b131..ed7abe9565e 100644 --- a/src/pages/resultsView/ResultsViewPageStore.ts +++ b/src/pages/resultsView/ResultsViewPageStore.ts @@ -126,6 +126,7 @@ import { isRNASeqProfile, makeEnrichmentDataPromise, getMolecularProfiles, + getProfilesWithoutMutationProfile, } from './ResultsViewPageStoreUtils'; import MobxPromiseCache from '../../shared/lib/MobxPromiseCache'; import {isSampleProfiledInMultiple} from '../../shared/lib/isSampleProfiled'; @@ -202,6 +203,7 @@ export const AlterationTypeConstants = { GENESET_SCORE: 'GENESET_SCORE', METHYLATION: 'METHYLATION', GENERIC_ASSAY: 'GENERIC_ASSAY', + STRUCTURAL_VARIANT: 'STRUCTURAL_VARIANT' }; // only show TREATMENT_RESPONSE in the plots tab for now @@ -1211,11 +1213,7 @@ export class ResultsViewPageStore { ], invoke: () => { // we get mutations with mutations endpoint, all other alterations with this one, so filter out mutation genetic profile - const profilesWithoutMutationProfile = _.filter( - this.selectedMolecularProfiles.result, - (profile: MolecularProfile) => - profile.molecularAlterationType !== 'MUTATION_EXTENDED' - ); + const profilesWithoutMutationProfile = getProfilesWithoutMutationProfile(this.selectedMolecularProfiles.result!); const genes = this.genes.result; if ( @@ -1270,12 +1268,7 @@ export class ResultsViewPageStore { ], invoke: () => { // we get mutations with mutations endpoint, all other alterations with this one, so filter out mutation genetic profile - const profilesWithoutMutationProfile = _.filter( - this.nonSelectedMolecularProfiles.result, - (profile: MolecularProfile) => - profile.molecularAlterationType !== - AlterationTypeConstants.MUTATION_EXTENDED - ); + const profilesWithoutMutationProfile = getProfilesWithoutMutationProfile(this.nonSelectedMolecularProfiles.result); const genes = this.genes.result; if ( diff --git a/src/pages/resultsView/ResultsViewPageStoreUtils.ts b/src/pages/resultsView/ResultsViewPageStoreUtils.ts index 63faef2f0b5..681cebb589c 100644 --- a/src/pages/resultsView/ResultsViewPageStoreUtils.ts +++ b/src/pages/resultsView/ResultsViewPageStoreUtils.ts @@ -20,7 +20,7 @@ import { AnnotatedMutation, CaseAggregatedData, IQueriedCaseData, - IQueriedMergedTrackCaseData, ResultsViewPageStore + IQueriedMergedTrackCaseData, ResultsViewPageStore, AlterationTypeConstants } from "./ResultsViewPageStore"; import {IndicatorQueryResp, remoteData} from "cbioportal-frontend-commons"; import _ from "lodash"; @@ -610,3 +610,8 @@ export function fetchPatients(samples:Sample[]) { patientFilter }); } + +export function getProfilesWithoutMutationProfile(molecularprofiles: MolecularProfile[]): MolecularProfile[] { + const mutationAlterationTypes = [AlterationTypeConstants.MUTATION_EXTENDED, AlterationTypeConstants.FUSION, AlterationTypeConstants.STRUCTURAL_VARIANT]; + return molecularprofiles.filter(profile => !mutationAlterationTypes.includes(profile.molecularAlterationType)); +} \ No newline at end of file