diff --git a/src/pages/resultsView/ResultsViewPage.tsx b/src/pages/resultsView/ResultsViewPage.tsx index f5cf1b9b3b4..46b69b8ed93 100644 --- a/src/pages/resultsView/ResultsViewPage.tsx +++ b/src/pages/resultsView/ResultsViewPage.tsx @@ -266,9 +266,7 @@ export default class ResultsViewPage extends React.Component< sampleKeyToSample={store.sampleKeyToSample} genes={store.genes} clinicalAttributes={store.clinicalAttributes} - customAttributes={ - store.clinicalAttributes_customCharts - } + customAttributes={store.customAttributes} genesets={store.genesets} genericAssayEntitiesGroupByMolecularProfileId={ store.genericAssayEntitiesGroupByMolecularProfileId diff --git a/src/pages/resultsView/ResultsViewPageStore.ts b/src/pages/resultsView/ResultsViewPageStore.ts index e371a31808d..eae513b2eb2 100644 --- a/src/pages/resultsView/ResultsViewPageStore.ts +++ b/src/pages/resultsView/ResultsViewPageStore.ts @@ -1093,6 +1093,7 @@ export class ResultsViewPageStore extends AnalysisStore this.studyIds, this.clinicalAttributes_profiledIn, this.clinicalAttributes_comparisonGroupMembership, + this.customAttributes, this.samples, this.patients, ], @@ -1141,6 +1142,7 @@ export class ResultsViewPageStore extends AnalysisStore ...specialAttributes, ...this.clinicalAttributes_profiledIn.result!, ...this.clinicalAttributes_comparisonGroupMembership.result!, + ...this.customAttributes.result!, ]; }, }); @@ -1185,7 +1187,7 @@ export class ResultsViewPageStore extends AnalysisStore this.studyToDataQueryFilter, this.clinicalAttributes_profiledIn, this.clinicalAttributes_comparisonGroupMembership, - this.clinicalAttributes_customCharts, + this.customAttributes, ], invoke: async () => { let clinicalAttributeCountFilter: ClinicalAttributeCountFilter; @@ -1268,7 +1270,7 @@ export class ResultsViewPageStore extends AnalysisStore ); } // add counts for custom chart clinical attributes - for (const attr of this.clinicalAttributes_customCharts.result!) { + for (const attr of this.customAttributes.result!) { ret[attr.clinicalAttributeId] = attr.data!.filter( d => d.value !== 'NA' ).length; @@ -2721,7 +2723,7 @@ export class ResultsViewPageStore extends AnalysisStore default: [], }); - readonly clinicalAttributes_customCharts = remoteData({ + readonly customAttributes = remoteData({ await: () => [this.sampleMap], invoke: async () => { let ret: ExtendedClinicalAttribute[] = []; @@ -5691,7 +5693,7 @@ export class ResultsViewPageStore extends AnalysisStore this.coverageInformation, this.filteredSampleKeyToSample, this.filteredPatientKeyToPatient, - this.clinicalAttributes_customCharts + this.customAttributes ); public mutationCache = new MobxPromiseCache< diff --git a/src/pages/resultsView/oncoprint/TracksMenu.tsx b/src/pages/resultsView/oncoprint/TracksMenu.tsx index 839eb7aa698..a8910a227ba 100644 --- a/src/pages/resultsView/oncoprint/TracksMenu.tsx +++ b/src/pages/resultsView/oncoprint/TracksMenu.tsx @@ -151,7 +151,7 @@ export default class TracksMenu extends React.Component { await: () => [ this.props.store.clinicalAttributes, this.clinicalAttributeIdToAvailableFrequency, - this.props.store.clinicalAttributes_customCharts, + this.props.store.customAttributes, ], invoke: () => { const uniqueAttributes = _.uniqBy( @@ -167,7 +167,7 @@ export default class TracksMenu extends React.Component { }; const customChartClinicalAttributeIds = _.keyBy( - this.props.store.clinicalAttributes_customCharts.result!, + this.props.store.customAttributes.result!, a => a.clinicalAttributeId ); diff --git a/src/pages/studyView/StudyViewPage.tsx b/src/pages/studyView/StudyViewPage.tsx index 0ad0c0e135c..59c918103c8 100644 --- a/src/pages/studyView/StudyViewPage.tsx +++ b/src/pages/studyView/StudyViewPage.tsx @@ -773,8 +773,7 @@ export default class StudyViewPage extends React.Component< this.store.clinicalAttributes } customAttributes={ - this.store - .clinicalAttributes_customCharts + this.store.customAttributes } genesets={this.store.genesets} genericAssayEntitiesGroupByMolecularProfileId={ diff --git a/src/pages/studyView/StudyViewPageStore.ts b/src/pages/studyView/StudyViewPageStore.ts index 98d9da7d788..bca05fbfe11 100644 --- a/src/pages/studyView/StudyViewPageStore.ts +++ b/src/pages/studyView/StudyViewPageStore.ts @@ -11439,7 +11439,7 @@ export class StudyViewPageStore ), }); - readonly clinicalAttributes_customCharts = remoteData({ + readonly customAttributes = remoteData({ await: () => [this.sampleMap], invoke: async () => { let ret: ExtendedClinicalAttribute[] = []; @@ -11485,7 +11485,7 @@ export class StudyViewPageStore this.coverageInformation, this.filteredSampleKeyToSample, this.filteredPatientKeyToPatient, - this.clinicalAttributes_customCharts + this.customAttributes ); private _numericGeneMolecularDataCache = new MobxPromiseCache< diff --git a/src/shared/components/plots/PlotsTab.tsx b/src/shared/components/plots/PlotsTab.tsx index b45456d5bd5..d1890336965 100644 --- a/src/shared/components/plots/PlotsTab.tsx +++ b/src/shared/components/plots/PlotsTab.tsx @@ -1176,7 +1176,7 @@ export default class PlotsTab extends React.Component { (self.horzSelection.dataType === CLIN_ATTR_DATA_TYPE || self.horzSelection.dataType === CUSTOM_ATTR_DATA_TYPE) ) { - // if vertical gene set option is "same as horizontal", and horizontal is clinical, then use the actual + // if vertical gene set option is "same as horizontal", and horizontal is clinical or custom, then use the actual // gene set option value instead of "Same gene" option value, because that would be slightly weird UX return self.horzSelection.selectedGenesetOption; } else { @@ -1251,7 +1251,7 @@ export default class PlotsTab extends React.Component { (self.horzSelection.dataType === CLIN_ATTR_DATA_TYPE || self.horzSelection.dataType === CUSTOM_ATTR_DATA_TYPE) ) { - // if vertical gene set option is "same as horizontal", and horizontal is clinical, then use the actual + // if vertical gene set option is "same as horizontal", and horizontal is clinical or custom, then use the actual // gene set option value instead of "Same gene" option value, because that would be slightly weird UX return self.horzSelection.selectedGenericAssayOption; } else { @@ -2585,7 +2585,7 @@ export default class PlotsTab extends React.Component { dataTypeIds.push(CLIN_ATTR_DATA_TYPE); } - if (this.customAttributeOptions.result!.length) { + if (!_.isEmpty(this.customAttributeOptions.result)) { dataTypeIds.push(CUSTOM_ATTR_DATA_TYPE); } @@ -2699,7 +2699,7 @@ export default class PlotsTab extends React.Component { ] = this.clinicalAttributeOptions.result!; } - if (this.customAttributeOptions.result!.length) { + if (!_.isEmpty(this.customAttributeOptions.result)) { // add custom attributes map[ CUSTOM_ATTR_DATA_TYPE diff --git a/src/shared/components/plots/PlotsTabUtils.tsx b/src/shared/components/plots/PlotsTabUtils.tsx index ee9fcbcf12e..23af98bf8ef 100644 --- a/src/shared/components/plots/PlotsTabUtils.tsx +++ b/src/shared/components/plots/PlotsTabUtils.tsx @@ -1663,7 +1663,7 @@ export function getAxisDescription( switch (selection.dataType) { case CUSTOM_ATTR_DATA_TYPE: const customAttr = - clinicalAttributeIdToClinicalAttribute[selection.dataSourceId!]; + customAttributeIdToClinicalAttribute[selection.dataSourceId!]; if (customAttr) { ret = customAttr.description; }