Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable STRs in v4 #1305

Merged
merged 5 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions browser/src/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,21 @@ export default () => (
</ListItem>
{/* @ts-expect-error TS(2746) FIXME: This JSX tag's 'children' prop expects a single ch... Remove this comment to see the full error message */}
<ListItem>
{/* @ts-expect-error TS(2786) FIXME: 'ExternalLink' cannot be used as a JSX component. */}
<ExternalLink href="https://gnomad.broadinstitute.org/short-tandem-repeats?dataset=gnomad_r3">
Short tandem repeat
</ExternalLink>{' '}
<Link
preserveSelectedDataset={false}
to={{
pathname: '/short-tandem-repeats',
search: queryString.stringify({ dataset: 'gnomad_r4' }),
}}
>
Short tandem repeat{' '}
</Link>
locus:{' '}
<Link
preserveSelectedDataset={false}
to={{
pathname: 'short-tandem-repeat/ATXN1',
search: queryString.stringify({ dataset: 'gnomad_r3' }),
search: queryString.stringify({ dataset: 'gnomad_r4' }),
}}
>
ATXN1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ exports[`RegionPageContainer with dataset gnomad_r4 queries API with correct par
variables={
{
"chrom": "12",
"includeShortTandemRepeats": false,
"includeShortTandemRepeats": true,
"referenceGenome": "GRCh38",
"shortTandemRepeatDatasetId": "gnomad_r3",
"start": 345,
Expand Down
4 changes: 2 additions & 2 deletions browser/src/ShortTandemRepeatsPage/ShortTandemRepeatsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'

import { BaseTable, ExternalLink, Page } from '@gnomad/ui'

import { DatasetId, labelForDataset } from '@gnomad/dataset-metadata/metadata'
import { DatasetId, hasShortTandemRepeats, labelForDataset } from '@gnomad/dataset-metadata/metadata'
import DocumentTitle from '../DocumentTitle'
import GnomadPageHeading from '../GnomadPageHeading'
import Link from '../Link'
Expand Down Expand Up @@ -133,7 +133,7 @@ const ShortTandemRepeatsPageContainer = ({ datasetId }: ShortTandemRepeatsPageCo
>
Pathogenic Short Tandem Repeats
</GnomadPageHeading>
{datasetId === 'gnomad_r3' ? (
{hasShortTandemRepeats(datasetId) ? (
<Query
operationName={operationName}
query={query}
Expand Down
11 changes: 5 additions & 6 deletions browser/src/__snapshots__/HomePage.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -444,19 +444,18 @@ exports[`Home Page has no unexpected changes 1`] = `
className="c7"
>
<a
className="c9"
href="https://gnomad.broadinstitute.org/short-tandem-repeats?dataset=gnomad_r3"
rel="noopener noreferrer"
target="_blank"
className="-Link c8"
href="/short-tandem-repeats?dataset=gnomad_r4"
onClick={[Function]}
>
Short tandem repeat

</a>

locus:

<a
className="-Link c8"
href="short-tandem-repeat/ATXN1?dataset=gnomad_r3"
href="short-tandem-repeat/ATXN1?dataset=gnomad_r4"
onClick={[Function]}
>
ATXN1
Expand Down
8 changes: 4 additions & 4 deletions dataset-metadata/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ const metadataForDataset = (datasetId: DatasetId): DatasetMetadata => ({
transcriptsHaveExomeCoverage: !datasetId.startsWith('gnomad_r3') && datasetId !== 'gnomad_sv_r4',
referenceGenome:
datasetId.startsWith('gnomad_r3') ||
datasetId.startsWith('gnomad_r4') ||
datasetId === 'gnomad_sv_r4' ||
datasetId === 'gnomad_cnv_r4'
datasetId.startsWith('gnomad_r4') ||
datasetId === 'gnomad_sv_r4' ||
datasetId === 'gnomad_cnv_r4'
? 'GRCh38'
: 'GRCh37',
genesHaveGenomeCoverage: !datasetId.startsWith('gnomad_cnv'),
Expand Down Expand Up @@ -245,7 +245,7 @@ const metadataForDataset = (datasetId: DatasetId): DatasetMetadata => ({
hasRelatedVariants: datasetId !== 'gnomad_r2_1',
showAllIndividualsInAgeDistributionByDefault: datasetId !== 'exac',
hasExons: !datasetId.startsWith('gnomad_sv'),
hasShortTandemRepeats: datasetId.startsWith('gnomad_r3') || datasetId === 'gnomad_sv_r4',
hasShortTandemRepeats: datasetId.startsWith('gnomad_r3') || datasetId.startsWith('gnomad_r4') || datasetId === "gnomad_sv_r4",
hasMitochondrialGenomeCoverage: !(datasetId === 'exac' || datasetId.startsWith('gnomad_r2')),
hasMitochondrialVariants: !(datasetId === 'exac' || datasetId.startsWith('gnomad_r2')),
hasNonCodingReadData: !(datasetId === 'exac' || datasetId.startsWith('gnomad_r2')),
Expand Down
1 change: 1 addition & 0 deletions graphql-api/src/queries/short-tandem-repeat-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { fetchAllSearchResults } from './helpers/elasticsearch-helpers'

const SHORT_TANDEM_REPEAT_INDICES = {
gnomad_r3: 'gnomad_v3_short_tandem_repeats',
gnomad_r4: 'gnomad_v3_short_tandem_repeats',
}

const SUMMARY_FIELDS = [
Expand Down
Loading