Skip to content

Commit

Permalink
fix(browser): use joint data in variant page ancestry table
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyhgrant committed May 9, 2024
1 parent f2d2606 commit 58ea66b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 11 additions & 3 deletions browser/src/VariantPage/GnomadPopulationsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ type OwnGnomadPopulationsTableProps = {
datasetId: DatasetId
exomePopulations: Population[]
genomePopulations: Population[]
jointPopulations: Population[] | null
showHemizygotes?: boolean
showHomozygotes?: boolean
}
Expand Down Expand Up @@ -102,14 +103,21 @@ 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,
}).filter((mergedAncestry) => (mergedAncestry.id as string) !== '')

const mergedPopulationsWithNames = addPopulationNames(mergedPopulations)
const mergedNestedPopulationsWithNames = nestPopulations(mergedPopulationsWithNames)
Expand Down
2 changes: 2 additions & 0 deletions browser/src/VariantPage/VariantPopulationFrequencies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
/>
</TableWrapper>
Expand Down Expand Up @@ -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'}
/>
</TableWrapper>
Expand Down

0 comments on commit 58ea66b

Please sign in to comment.