Skip to content

Commit

Permalink
Filter fusion and structural varinat profiles while getting non mutat…
Browse files Browse the repository at this point in the history
…ion profiles
  • Loading branch information
kalletlak committed Jan 22, 2020
1 parent 694a016 commit f485685
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
15 changes: 4 additions & 11 deletions src/pages/resultsView/ResultsViewPageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ import {
isRNASeqProfile,
makeEnrichmentDataPromise,
getMolecularProfiles,
excludeMutationAndSVProfiles,
} from './ResultsViewPageStoreUtils';
import MobxPromiseCache from '../../shared/lib/MobxPromiseCache';
import {isSampleProfiledInMultiple} from '../../shared/lib/isSampleProfiled';
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = excludeMutationAndSVProfiles(this.selectedMolecularProfiles.result!);
const genes = this.genes.result;

if (
Expand Down Expand Up @@ -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 = excludeMutationAndSVProfiles(this.nonSelectedMolecularProfiles.result);
const genes = this.genes.result;

if (
Expand Down
7 changes: 6 additions & 1 deletion src/pages/resultsView/ResultsViewPageStoreUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -610,3 +610,8 @@ export function fetchPatients(samples:Sample[]) {
patientFilter
});
}

export function excludeMutationAndSVProfiles(molecularprofiles: MolecularProfile[]): MolecularProfile[] {
const mutationAlterationTypes = [AlterationTypeConstants.MUTATION_EXTENDED, AlterationTypeConstants.FUSION, AlterationTypeConstants.STRUCTURAL_VARIANT];
return molecularprofiles.filter(profile => !mutationAlterationTypes.includes(profile.molecularAlterationType));
}

0 comments on commit f485685

Please sign in to comment.