diff --git a/browser/src/VariantPage/GnomadPopulationsTable.tsx b/browser/src/VariantPage/GnomadPopulationsTable.tsx index e27e2701f..fd47c3c1e 100644 --- a/browser/src/VariantPage/GnomadPopulationsTable.tsx +++ b/browser/src/VariantPage/GnomadPopulationsTable.tsx @@ -74,6 +74,7 @@ type OwnGnomadPopulationsTableProps = { datasetId: DatasetId exomePopulations: Population[] genomePopulations: Population[] + jointPopulations: Population[] | null showHemizygotes?: boolean showHomozygotes?: boolean } @@ -102,14 +103,24 @@ export class GnomadPopulationsTable extends Component< } render() { - const { datasetId, exomePopulations, genomePopulations, showHemizygotes, showHomozygotes } = - this.props + const { + datasetId, + exomePopulations, + genomePopulations, + jointPopulations, + showHemizygotes, + showHomozygotes, + } = this.props const { includeExomes, includeGenomes } = this.state const mergedPopulations = mergeExomeGenomeAndJointPopulationData({ exomePopulations: includeExomes ? exomePopulations : [], genomePopulations: includeGenomes ? genomePopulations : [], - }) + jointPopulations, + // @ts-expect-error: silence TS's warning -- there is no legitimate "" id in + // PopulationId, but the source array from joint population has a summary value + // with an id of "", filter it out here to display the correct values + }).filter((mergedAncestry) => mergedAncestry.id !== '') const mergedPopulationsWithNames = addPopulationNames(mergedPopulations) const mergedNestedPopulationsWithNames = nestPopulations(mergedPopulationsWithNames) diff --git a/browser/src/VariantPage/VariantPopulationFrequencies.tsx b/browser/src/VariantPage/VariantPopulationFrequencies.tsx index 9030ce58c..4c30390f3 100644 --- a/browser/src/VariantPage/VariantPopulationFrequencies.tsx +++ b/browser/src/VariantPage/VariantPopulationFrequencies.tsx @@ -53,6 +53,7 @@ const VariantPopulationFrequencies = ({ datasetId, variant }: Props) => { datasetId={datasetId} exomePopulations={exomePopulations} genomePopulations={genomePopulations} + jointPopulations={variant.joint ? variant.joint.populations : null} showHemizygotes={variant.chrom === 'X' || variant.chrom === 'Y'} /> @@ -143,6 +144,7 @@ const VariantPopulationFrequencies = ({ datasetId, variant }: Props) => { datasetId={datasetId} exomePopulations={variant.exome ? variant.exome.populations : []} genomePopulations={variant.genome ? variant.genome.populations : []} + jointPopulations={variant.joint ? variant.joint.populations : null} showHemizygotes={variant.chrom === 'X' || variant.chrom === 'Y'} />