Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix plots tab related data loading on initial study view load #4958

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
improve conditionality
Bryan Lai authored and alisman committed Jan 16, 2025
commit 3cd850f42b71c9ba13882a1852cb8e01b8d17d2a
2 changes: 1 addition & 1 deletion src/pages/studyView/StudyViewPage.tsx
Original file line number Diff line number Diff line change
@@ -855,7 +855,7 @@ export default class StudyViewPage extends React.Component<
structuralVariants={
this.store.structuralVariants
}
hugoGeneSymbols={
allHugoGeneSymbols={
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Bryan, sorry it took me SO long to respond. This is quite confusing to have a property hugeGeneSymbols AND allHugeGeneSymbols. Lets think if there's some better we can handle this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The basic problem is that we need to wait for the gene symbols to load but we only want to do that when the tab is actually showing. We can handle that more elegantly with some kind of loading wrapper. Maybe we can do a pair programming session and figure it out.

this.store.allHugoGeneSymbols
}
selectedGenericAssayEntitiesGroupByMolecularProfileId={
16 changes: 8 additions & 8 deletions src/shared/components/plots/PlotsTab.tsx
Original file line number Diff line number Diff line change
@@ -330,7 +330,8 @@ export interface IPlotsTabProps {
driverAnnotationSettings: DriverAnnotationSettings;
studyIdToStudy?: MobxPromiseUnionTypeWithDefault<_.Dictionary<CancerStudy>>;
structuralVariants?: MobxPromiseUnionType<StructuralVariant[]>;
hugoGeneSymbols: string[] | MobxPromiseUnionTypeWithDefault<string[]>;
hugoGeneSymbols?: string[];
allHugoGeneSymbols?: MobxPromiseUnionTypeWithDefault<string[]>;
selectedGenericAssayEntitiesGroupByMolecularProfileId: {
[molecularProfileId: string]: string[];
};
@@ -3812,15 +3813,16 @@ export default class PlotsTab extends React.Component<IPlotsTabProps, {}> {
}
let genericAssayOptionsCount: number = 0;
let filteredGenericAssayOptionsCount: number = 0;
const hugoGeneSymbols: string[] = this.props.hugoGeneSymbols
? this.props.hugoGeneSymbols
: this.props.allHugoGeneSymbols!.result;
if (vertical && this.vertGenericAssayOptions.result) {
genericAssayOptions =
this.makeGenericAssayGroupOptions(
this.vertGenericAssayOptions.result,
selectedEntities,
this._vertGenericAssaySearchText,
Array.isArray(this.props.hugoGeneSymbols)
? this.props.hugoGeneSymbols
: this.props.hugoGeneSymbols.result,
hugoGeneSymbols,
this.horzSelection.selectedGeneOption?.label,
GENERIC_ASSAY_CONFIG.genericAssayConfigByType[
axisSelection.dataType!
@@ -3848,9 +3850,7 @@ export default class PlotsTab extends React.Component<IPlotsTabProps, {}> {
this.horzGenericAssayOptions.result,
selectedEntities,
this._horzGenericAssaySearchText,
Array.isArray(this.props.hugoGeneSymbols)
? this.props.hugoGeneSymbols
: this.props.hugoGeneSymbols.result,
hugoGeneSymbols,
this.vertSelection.selectedGeneOption?.label,
GENERIC_ASSAY_CONFIG.genericAssayConfigByType[
axisSelection.dataType!
@@ -3893,7 +3893,7 @@ export default class PlotsTab extends React.Component<IPlotsTabProps, {}> {
options = options.filter(stringCompare).slice(0, 10);
const genes = await fetchGenes(options.map(o => o.label));
const coverageInformationPromise = getCoverageInformation(
this.props.genePanelDataForAllProfiles?.result || [],
this.props.genePanelDataForAllProfiles!.result!,
this.props.sampleKeyToSample.result!,
this.props.patients.result!,
genes