Skip to content

Commit

Permalink
fix issue with incorrect data being passed causing crashes with some …
Browse files Browse the repository at this point in the history
…data type options
  • Loading branch information
Bryan Lai authored and inodb committed Jan 5, 2024
1 parent 6c05ee8 commit 1f3b315
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
4 changes: 4 additions & 0 deletions src/pages/resultsView/ResultsViewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ export default class ResultsViewPage extends React.Component<
driverAnnotationSettings={
store.driverAnnotationSettings
}
studyIdToStudy={store.studyIdToStudy.result}
structuralVariants={
store.structuralVariants.result
}
hugoGeneSymbols={store.hugoGeneSymbols}
selectedGenericAssayEntitiesGroupByMolecularProfileId={
store.selectedGenericAssayEntitiesGroupByMolecularProfileId
Expand Down
1 change: 0 additions & 1 deletion src/pages/resultsView/plots/PlotsFeature.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1916,7 +1916,6 @@ export default class PlotsTab extends React.Component<IPlotsTabProps, {}> {
await: () => [this.props.genes],
invoke: () => {
return Promise.resolve(
// this.props.genes.result!.filter(g => g.hugoGeneSymbol === 'KRAS').map(gene => ({
this.props.genes.result!.map(gene => ({
value: gene.entrezGeneId,
label: gene.hugoGeneSymbol,
Expand Down
6 changes: 3 additions & 3 deletions src/pages/studyView/StudyViewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,8 @@ export default class StudyViewPage extends React.Component<
.queriedPhysicalStudyIds
}
molecularProfilesWithData={
this.store.molecularProfiles
this.store
.molecularProfilesInStudies
}
molecularProfilesInStudies={
this.store
Expand Down Expand Up @@ -795,8 +796,7 @@ export default class StudyViewPage extends React.Component<
.driverAnnotationSettings
}
studyIdToStudy={
this.store.everyStudyIdToStudy
.result
this.store.studyIdToStudy.result
}
structuralVariants={
this.store.structuralVariants
Expand Down
27 changes: 19 additions & 8 deletions src/pages/studyView/StudyViewPageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5325,6 +5325,17 @@ export class StudyViewPageStore
default: [],
});

readonly studyIdToStudy = remoteData(
{
await: () => [this.queriedPhysicalStudies],
invoke: () =>
Promise.resolve(
_.keyBy(this.queriedPhysicalStudies.result, x => x.studyId)
),
},
{}
);

readonly queriedSampleIdentifiers = remoteData<SampleIdentifier[]>({
await: () => [
this.filteredPhysicalStudies,
Expand Down Expand Up @@ -11222,7 +11233,7 @@ export class StudyViewPageStore

readonly structuralVariants = remoteData<StructuralVariant[]>({
await: () => [
this.allGenes,
this.plotsSelectedGenes,
this.samples,
this.studyToStructuralVariantMolecularProfile,
this.entrezGeneIdToGeneAll,
Expand All @@ -11232,7 +11243,7 @@ export class StudyViewPageStore
_.isEmpty(
this.studyToStructuralVariantMolecularProfile.result
) ||
_.isEmpty(this.allGenes.result)
_.isEmpty(this.plotsSelectedGenes.result)
) {
return [];
}
Expand Down Expand Up @@ -11262,18 +11273,18 @@ export class StudyViewPageStore
// Set all SVs that are queried at the gene level.
// The gene1::gene2 orientation does not come into play here.
const entrezGeneIds = _.map(
this.allGenes.result,
this.plotsSelectedGenes.result,
(gene: Gene) => gene.entrezGeneId
);
// Set all SVs that are queried at the gene1::gene2 orientation level.
const structuralVariantQueries = [].map(sv =>
createStructuralVariantQuery(sv, this.allGenes.result!)
);
// // Set all SVs that are queried at the gene1::gene2 orientation level.
// const structuralVariantQueries = this.structVarQueries.map(sv =>
// createStructuralVariantQuery(sv, this.plotsSelectedGenes.result!)
// );

return await internalClient.fetchStructuralVariantsUsingPOST({
structuralVariantFilter: {
entrezGeneIds,
structuralVariantQueries,
structuralVariantQueries: [],
sampleMolecularIdentifiers,
molecularProfileIds: [],
},
Expand Down

0 comments on commit 1f3b315

Please sign in to comment.