Skip to content

Commit

Permalink
Do not fetch structural variants data when there are no applicable sa…
Browse files Browse the repository at this point in the history
…mples
  • Loading branch information
Gaofei Zhao committed Dec 10, 2021
1 parent 4f02917 commit ab9c6ea
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/pages/resultsView/ResultsViewPageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3177,17 +3177,24 @@ export class ResultsViewPageStore
[] as StructuralVariantFilter['sampleMolecularIdentifiers']
);

const data = {
entrezGeneIds: _.map(
this.genes.result,
(gene: Gene) => gene.entrezGeneId
),
sampleMolecularIdentifiers: filters,
} as StructuralVariantFilter;
// filters can be an empty list
// when all selected samples are coming from studies that don't have structural variant profile
// in this case, we should not fetch structural variants data
if (_.isEmpty(filters)) {
return [];
} else {
const data = {
entrezGeneIds: _.map(
this.genes.result,
(gene: Gene) => gene.entrezGeneId
),
sampleMolecularIdentifiers: filters,
} as StructuralVariantFilter;

return await client.fetchStructuralVariantsUsingPOST({
structuralVariantFilter: data,
});
return await client.fetchStructuralVariantsUsingPOST({
structuralVariantFilter: data,
});
}
},
});

Expand Down

0 comments on commit ab9c6ea

Please sign in to comment.