Skip to content

Commit

Permalink
wip(browser): add type to represent gen anc and chromosome
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyhgrant committed May 17, 2024
1 parent 669dee1 commit b323738
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions browser/src/VariantPage/VariantPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import VariantRelatedVariants from './VariantRelatedVariants'
import VariantSiteQualityMetrics from './VariantSiteQualityMetrics'
import VariantTranscriptConsequences from './VariantTranscriptConsequences'
import { URLBuilder } from '../DatasetSelector'
import { PopulationId } from '@gnomad/dataset-metadata/gnomadPopulations'
import { PopulationIdAndChromosome } from '@gnomad/dataset-metadata/gnomadPopulations'
import { Filter } from '../QCFilter'

const Section = styled.section`
Expand Down Expand Up @@ -143,7 +143,7 @@ export type Histogram = {
}

export type Population = {
id: PopulationId
id: PopulationIdAndChromosome
ac: number
an: number
ac_hemi: number | null
Expand Down
2 changes: 2 additions & 0 deletions dataset-metadata/gnomadPopulations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export const GNOMAD_POPULATION_NAMES = {

export type PopulationId = keyof typeof GNOMAD_POPULATION_NAMES

export type PopulationIdAndChromosome = PopulationId | `${PopulationId}_XX` | `${PopulationId}_XY`

export const populationName = (populationId: string) =>
textOrMissingTextWarning('genetic ancestry group name', GNOMAD_POPULATION_NAMES, populationId)

Expand Down

0 comments on commit b323738

Please sign in to comment.