From 6efbdf7bb073f7cfcc122fe03bd960abfaaf5748 Mon Sep 17 00:00:00 2001 From: Matthijs Pon Date: Wed, 12 Jun 2024 12:01:36 +0200 Subject: [PATCH 1/2] Fix swapping generic assay profiles in comparison view --- src/shared/lib/comparison/ComparisonStore.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shared/lib/comparison/ComparisonStore.ts b/src/shared/lib/comparison/ComparisonStore.ts index 6d24da88278..eccf5b62161 100644 --- a/src/shared/lib/comparison/ComparisonStore.ts +++ b/src/shared/lib/comparison/ComparisonStore.ts @@ -1699,14 +1699,14 @@ export default abstract class ComparisonStore extends AnalysisStore readonly gaEnrichmentGroupsByAssayType = remoteData({ await: () => [ this - .selectedGenericAssayEnrichmentProfileMapGroupedByGenericAssayType, + .selectedAllGenericAssayEnrichmentProfileMapGroupedByGenericAssayType, this.enrichmentAnalysisGroups, ], invoke: () => { return Promise.resolve( _.mapValues( this - .selectedGenericAssayEnrichmentProfileMapGroupedByGenericAssayType + .selectedAllGenericAssayEnrichmentProfileMapGroupedByGenericAssayType .result!, selectedGenericAssayEnrichmentProfileMap => { let studyIds = Object.keys( @@ -1850,7 +1850,7 @@ export default abstract class ComparisonStore extends AnalysisStore await: () => [ this.gaEnrichmentGroupsByAssayType, this - .selectedGenericAssayEnrichmentProfileMapGroupedByGenericAssayType, + .selectedAllGenericAssayEnrichmentProfileMapGroupedByGenericAssayType, ], invoke: () => { return Promise.resolve( @@ -1866,7 +1866,7 @@ export default abstract class ComparisonStore extends AnalysisStore sample => ({ caseId: sample.sampleId, molecularProfileId: this - .selectedGenericAssayEnrichmentProfileMapGroupedByGenericAssayType + .selectedAllGenericAssayEnrichmentProfileMapGroupedByGenericAssayType .result![genericAssayType][ sample.studyId ].molecularProfileId, @@ -1973,7 +1973,7 @@ export default abstract class ComparisonStore extends AnalysisStore await: () => [], getSelectedProfileMap: () => this - .selectedGenericAssayEnrichmentProfileMapGroupedByGenericAssayType + .selectedAllGenericAssayEnrichmentProfileMapGroupedByGenericAssayType .result![genericAssayType], // returns an empty array if the selected study doesn't have any generic assay profiles fetchData: () => { if ( From 25fc31cd17f46bd9e9389268433eef2686636799 Mon Sep 17 00:00:00 2001 From: Matthijs Pon Date: Fri, 28 Jun 2024 10:43:58 +0200 Subject: [PATCH 2/2] Remove unused GenericAssayEnrichments.tsx --- .../GenericAssayEnrichments.tsx | 125 ------------------ 1 file changed, 125 deletions(-) delete mode 100644 src/pages/groupComparison/GenericAssayEnrichments.tsx diff --git a/src/pages/groupComparison/GenericAssayEnrichments.tsx b/src/pages/groupComparison/GenericAssayEnrichments.tsx deleted file mode 100644 index a93e7642074..00000000000 --- a/src/pages/groupComparison/GenericAssayEnrichments.tsx +++ /dev/null @@ -1,125 +0,0 @@ -import * as React from 'react'; -import { observer } from 'mobx-react'; -import autobind from 'autobind-decorator'; -import { MolecularProfile } from 'cbioportal-ts-api-client'; -import { MakeMobxView } from '../../shared/components/MobxView'; -import Loader from '../../shared/components/loadingIndicator/LoadingIndicator'; -import ErrorMessage from '../../shared/components/ErrorMessage'; -import { MakeEnrichmentsTabUI } from './GroupComparisonUtils'; -import _ from 'lodash'; -import ComparisonStore from '../../shared/lib/comparison/ComparisonStore'; -import GenericAssayEnrichmentsContainer from 'pages/resultsView/enrichments/GenericAssayEnrichmentsContainer'; -import EnrichmentsDataSetDropdown from 'pages/resultsView/enrichments/EnrichmentsDataSetDropdown'; - -export interface IGenericAssayEnrichmentsProps { - store: ComparisonStore; - genericAssayType: string; - resultsViewMode?: boolean; -} - -@observer -export default class GenericAssayEnrichments extends React.Component< - IGenericAssayEnrichmentsProps, - {} -> { - @autobind - private onChangeProfile(profileMap: { - [studyId: string]: MolecularProfile; - }) { - this.props.store.setGenericAssayEnrichmentProfileMap( - profileMap, - this.props.genericAssayType - ); - } - - readonly tabUI = MakeEnrichmentsTabUI( - () => this.props.store, - () => this.enrichmentsUI, - this.props.genericAssayType, - true, - true, - false - ); - - readonly enrichmentsUI = MakeMobxView({ - await: () => { - const ret: any[] = [ - this.props.store.gaEnrichmentDataByAssayType, - this.props.store - .selectedGenericAssayEnrichmentProfileMapGroupedByGenericAssayType, - this.props.store.gaEnrichmentGroupsByAssayType, - this.props.store.studies, - ]; - if ( - this.props.store.gaEnrichmentDataByAssayType.isComplete && - this.props.store.gaEnrichmentDataByAssayType.result![ - this.props.genericAssayType - ] - ) { - ret.push( - this.props.store.gaEnrichmentDataByAssayType.result![ - this.props.genericAssayType - ] - ); - } - return ret; - }, - render: () => { - // since generic assay enrichments tab is enabled only for one study, selectedGenericAssayEnrichmentProfileMap - // would contain only one key. - const studyId = Object.keys( - this.props.store - .selectedGenericAssayEnrichmentProfileMapGroupedByGenericAssayType - .result![this.props.genericAssayType] - )[0]; - // select the first found profile in the study as the default selection for selected genericAssayType - const selectedProfile = this.props.store - .selectedGenericAssayEnrichmentProfileMapGroupedByGenericAssayType - .result![this.props.genericAssayType][studyId]; - return ( -
- - -
- ); - }, - renderPending: () => ( - - ), - renderError: () => , - }); - - render() { - return this.tabUI.component; - } -}