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

Add v3 SV dataset #1209

Merged
merged 24 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
488c6e4
Add pipeline to build v3 SVs
phildarnowsky-broad Apr 10, 2023
9d5786f
Add configuration to allow export of v3 SVs to Elasticsearch
phildarnowsky-broad May 4, 2023
677a338
Characterize v2 SV GraphQL queries
phildarnowsky-broad Jun 8, 2023
1018480
Refactor SV queries to make it easier to add v3 SVs
phildarnowsky-broad Jun 13, 2023
d1c5091
Add support for v3 SVs to GraphQL API
phildarnowsky-broad Jun 14, 2023
e79dd0d
Add gnomad_sv_r3 as a valid dataset ID to metadata
phildarnowsky-broad Jun 16, 2023
b98979b
Add v3 SVs option to main Searchbox
phildarnowsky-broad Jun 16, 2023
08903e8
Eliminate PropTypes from StructuralVariantPage
phildarnowsky-broad Jun 20, 2023
fe97f25
Characterize StructuralVariantPage
phildarnowsky-broad Jun 21, 2023
da82e58
Characterize isStructuralVariantId
phildarnowsky-broad Jun 21, 2023
c9fdd45
Search recognizes V3 SV ID format
phildarnowsky-broad Jun 21, 2023
65f25c0
Add new consequences for v3 SVs
phildarnowsky-broad Jun 22, 2023
c46a5b3
Display SV IDs in all upper case
phildarnowsky-broad Jun 22, 2023
116a6ef
Add helpers for missing copy
phildarnowsky-broad Jul 6, 2023
79775d8
Add new pop names to v3 SV table
phildarnowsky-broad Jun 23, 2023
641892f
Add v3 SVs to dataset selector
phildarnowsky-broad Oct 12, 2023
48a2141
Default structural variants to coloring by type, not consequence
phildarnowsky-broad Aug 10, 2023
4b55f54
Add assortment of missing copy for v3 SVs
phildarnowsky-broad Oct 16, 2023
16c3ad9
Add reference genome header for v3 SVs to dataset selector
phildarnowsky-broad Oct 16, 2023
6e6e873
Fill in actual sample count for v3 SVs
phildarnowsky-broad Oct 16, 2023
901a65b
Make ESlint happy
phildarnowsky-broad Oct 16, 2023
e6cf2dd
Type a few things
phildarnowsky-broad Oct 26, 2023
41fc7c5
Fix a typo
phildarnowsky-broad Oct 26, 2023
d890f3b
Change user-facing references to dataset to say "v4 SVs"
phildarnowsky-broad Oct 26, 2023
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
26 changes: 15 additions & 11 deletions browser/help/topics/structural-variants/sv-effect-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: sv-effect-overview
title: 'Genic consequences of structural variants'
---

We annotated each SV for multiple potential genic effects using an approach described in [the gnomAD SV paper](https://broad.io/gnomad_sv). In brief, this approach considers SV size, class, position, and overlap with exons from canonical transcripts of [GENCODE v19](https://www.gencodegenes.org/human/release_19.html) protein-coding genes.
We annotated each SV for multiple potential genic effects using an approach described in [the gnomAD SV paper](https://broad.io/gnomad_sv). In brief, this approach considers SV size, class, position, and overlap with exons from canonical transcripts of [GENCODE v19](https://www.gencodegenes.org/human/release_19.html) protein-coding genes.

### Representation in the gnomAD Browser

Expand All @@ -13,16 +13,20 @@ The functional consequence per SV was determined in the order below:

### Main functional consequences

1. ![](https://placehold.it/15/D43925/000000?text=+) **Predicted loss-of-function (pLoF)**: SV is predicted to delete the gene or truncate the gene product.
2. ![](https://placehold.it/15/7459B2/000000?text=+) **Intragenic exonic duplication (IED)**: SV is predicted to result in duplicated exons within the gene, without extending beyond the boundaries of the open reading frame.
3. ![](https://placehold.it/15/2376B2/000000?text=+) **Copy gain (CG)**: SV is predicted to result in an entire additional intact copy of the gene.
1. ![](https://placehold.it/15/D43925/000000?text=+) **Predicted loss-of-function (pLoF)**: SV is predicted to delete the gene or truncate the gene product.
2. ![](https://placehold.it/15/7459B2/000000?text=+) **Intragenic exonic duplication (IED)**: SV is predicted to result in duplicated exons within the gene, without extending beyond the boundaries of the open reading frame. (New in gnomAD v4)
3. **Partial exon duplication (PED)**: SV is predicted to duplicate part of one or more exons without resulting in a whole-gene copy gain. (New in gnomAD v4)
4. ![](https://placehold.it/15/2376B2/000000?text=+) **Copy gain (CG)**: SV is predicted to result in an entire additional intact copy of the gene.

### Other consequences

4. **MCNV overlap**: MCNV overlaps one or more protein-coding exons; exact consequence depends on the number of copies and their orientation.
5. **Partial duplication**: SV is predicted to partially duplicate the gene while leaving the original copy of the gene intact.
6. **UTR**: SV does not directly disrupt coding sequence, but overlaps one of the gene's untranslated regions (UTRs).
7. **Promoter**: SV does not directly disrupt coding sequence or promoter, but is within 2kb of the gene's transcription start site.
8. **Inversion span**: gene is entirely spanned by an inversion SV without being directly disrupted.
9. **Intronic**: SV does not directly disrupt coding sequence, but is wholly contained within an intron.
10. **Intergenic**: SV does not meet any of the above categories.
4. **Transcription start site duplication**: SV is predicted to result in a duplication of a transcription start site but not result in any other, more severe consequences. (New in gnomAD v4).
5. **MCNV overlap**: MCNV overlaps one or more protein-coding exons; exact consequence depends on the number of copies and their orientation.

6. **Partial duplication**: SV is predicted to partially duplicate the gene while leaving the original copy of the gene intact.
7. **Exonic breakend**: breakend localizes to exonic locus, but consequence is unclear as SV is incompletely resolved. (New in gnomAD v4).
8. **UTR**: SV does not directly disrupt coding sequence, but overlaps one of the gene's untranslated regions (UTRs).
9. **Promoter**: SV does not directly disrupt coding sequence or promoter, but is within 2kb of the gene's transcription start site.
10. **Inversion span**: gene is entirely spanned by an inversion SV without being directly disrupted.
11. **Intronic**: SV does not directly disrupt coding sequence, but is wholly contained within an intron.
12. **Intergenic**: SV does not meet any of the above categories.
Original file line number Diff line number Diff line change
Expand Up @@ -6510,6 +6510,42 @@ exports[`ConstraintTable with "gnomad_sv_r2_1_non_neuro" dataset selected with a
</p>
`;

exports[`ConstraintTable with "gnomad_sv_r4" dataset selected and gene with available constraint has no unexpected changes 1`] = `
<p>
Constraint not yet available for gnomAD v3.
</p>
`;

exports[`ConstraintTable with "gnomad_sv_r4" dataset selected and transcript with available constraint has no unexpected changes 1`] = `
<p>
Constraint not yet available for gnomAD v3.
</p>
`;

exports[`ConstraintTable with "gnomad_sv_r4" dataset selected with a minimal gene has no unexpected changes 1`] = `
<p>
Constraint not yet available for gnomAD v3.
</p>
`;

exports[`ConstraintTable with "gnomad_sv_r4" dataset selected with a minimal transcript has no unexpected changes 1`] = `
<p>
Constraint not yet available for gnomAD v3.
</p>
`;

exports[`ConstraintTable with "gnomad_sv_r4" dataset selected with a mitochondrial gene has no unexpected changes 1`] = `
<p>
Constraint not yet available for gnomAD v3.
</p>
`;

exports[`ConstraintTable with "gnomad_sv_r4" dataset selected with a mitochondrial transcript has no unexpected changes 1`] = `
<p>
Constraint not yet available for gnomAD v3.
</p>
`;

exports[`ConstraintTable with exac dataset and gene with available constraints has no unexpected changes 1`] = `
[
<table
Expand Down
20 changes: 20 additions & 0 deletions browser/src/DatasetSelector.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,24 @@ forAllDatasets('DataSelector with "%s" dataset selected', (datasetId) => {
)
expect(tree).toMatchSnapshot()
})

test('has no unexpected changes when showing all possible datasets', () => {
const tree = renderer.create(
withDummyRouter(
<DatasetSelector
selectedDataset={datasetId}
datasetOptions={{
includeShortVariants: true,
includeStructuralVariants: true,
includeExac: true,
includeGnomad2: true,
includeGnomad2Subsets: true,
includeGnomad3: true,
includeGnomad3Subsets: true,
}}
/>
)
)
expect(tree).toMatchSnapshot()
})
})
68 changes: 36 additions & 32 deletions browser/src/DatasetSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
hasShortVariants,
hasStructuralVariants,
referenceGenome,
shortVariantDatasetId,
structuralVariantDatasetId,
} from '@gnomad/dataset-metadata/metadata'

const NavigationMenuWrapper = styled.ul`
Expand Down Expand Up @@ -124,7 +126,6 @@ const SubNavigationLink = styled.a`
}
`.withComponent(Link)


const ItemDescription = styled.div`
margin-top: 0.125em;
margin-left: 5px;
Expand All @@ -148,13 +149,13 @@ type ChildDataset = {
}

type Props = {
items: ({
items: {
id: string
isActive?: boolean
label: string
url: string | any
children: ChildDataset[]
})[]
}[]
}

type State = any
Expand Down Expand Up @@ -394,27 +395,29 @@ class NavigationMenu extends Component<Props, State> {
).map((childReferenceGenome) => (
<li key={childReferenceGenome}>
<GroupedNav>{childReferenceGenome}</GroupedNav>
{item.children
.filter((childItem) => childItem.childReferenceGenome === childReferenceGenome)
.map((childItem) => (
<li key={childItem.id}>
<SubNavigationLink
data-item={childItem.id}
to={childItem.url}
onBlur={this.onBlur}
onClick={() => {
this.setState({ expandedItem: null })
this.focusItem(item.id)
}}
onKeyDown={this.onKeyDownSubMenuItem}
>
{childItem.label}
{childItem.description && (
<ItemDescription>{childItem.description}</ItemDescription>
)}
</SubNavigationLink>
</li>
))}
{item.children
.filter(
(childItem) => childItem.childReferenceGenome === childReferenceGenome
)
.map((childItem) => (
<li key={childItem.id}>
<SubNavigationLink
data-item={childItem.id}
to={childItem.url}
onBlur={this.onBlur}
onClick={() => {
this.setState({ expandedItem: null })
this.focusItem(item.id)
}}
onKeyDown={this.onKeyDownSubMenuItem}
>
{childItem.label}
{childItem.description && (
<ItemDescription>{childItem.description}</ItemDescription>
)}
</SubNavigationLink>
</li>
))}
</li>
))}
</SubNavigationMenu>
Expand Down Expand Up @@ -444,10 +447,8 @@ const DatasetSelector = withRouter(({ datasetOptions, history, selectedDataset }
search: queryString.stringify({ dataset: datasetId }),
})

const defaultTopLevelShortVariantDataset = includeGnomad2 ? 'gnomad_r2_1' : 'gnomad_r3'
const topLevelShortVariantDataset = hasShortVariants(selectedDataset)
? selectedDataset
: defaultTopLevelShortVariantDataset
const topLevelShortVariantDataset = shortVariantDatasetId(selectedDataset)
const topLevelStructuralVariantDataset = structuralVariantDatasetId(selectedDataset)

let datasets: any = []

Expand Down Expand Up @@ -580,10 +581,6 @@ const DatasetSelector = withRouter(({ datasetOptions, history, selectedDataset }
}

if (includeStructuralVariants) {
const topLevelStructuralVariantDataset = hasStructuralVariants(selectedDataset)
? selectedDataset
: 'gnomad_sv_r2_1'

datasets.push(
{
id: 'current_sv_dataset',
Expand All @@ -596,6 +593,13 @@ const DatasetSelector = withRouter(({ datasetOptions, history, selectedDataset }
isActive: hasStructuralVariants(selectedDataset),
label: 'More datasets',
children: [
{
id: 'gnomad_sv_r4',
label: labelForDataset('gnomad_sv_r4'),
url: datasetLink('gnomad_sv_r4'),
description: `${sampleCounts.gnomad_sv_r4.total.toLocaleString()} samples`,
childReferenceGenome: referenceGenome('gnomad_sv_r4'),
},
{
id: 'gnomad_sv_r2_1',
label: labelForDataset('gnomad_sv_r2_1'),
Expand Down
14 changes: 10 additions & 4 deletions browser/src/GenePage/StructuralVariantsInGene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { referenceGenome } from '@gnomad/dataset-metadata/metadata'
import Query from '../Query'
import { filterStructuralVariantsInZoomRegion } from '../RegionViewer/filterVariantsInZoomRegion'
import StructuralVariants from '../StructuralVariantList/StructuralVariants'
import { StructuralVariant } from '../StructuralVariantPage/StructuralVariantPage'

type OwnProps = {
datasetId: string
Expand Down Expand Up @@ -61,15 +62,20 @@ const StructuralVariantsInGene = ({ datasetId, gene, zoomRegion, ...rest }: Prop
success={(data: any) => data.gene && data.gene.structural_variants}
>
{({ data }: any) => {
const structural_variants = filterStructuralVariantsInZoomRegion(
data.gene.structural_variants,
zoomRegion
).map((variant: StructuralVariant) => ({
...variant,
variant_id: variant.variant_id.toUpperCase(),
}))

return (
<StructuralVariants
{...rest}
context={gene}
exportFileName={`gnomad_structural_variants_${gene.gene_id}`}
variants={filterStructuralVariantsInZoomRegion(
data.gene.structural_variants,
zoomRegion
)}
variants={structural_variants}
/>
)
}}
Expand Down
Loading
Loading