Skip to content

Commit

Permalink
Get gnomADv2 new fields to be applied by VEP
Browse files Browse the repository at this point in the history
  • Loading branch information
davmlaw committed Dec 7, 2023
1 parent 6e6407c commit c57c3ee
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 10 deletions.
11 changes: 6 additions & 5 deletions annotation/migrations/0082_new_vep_110_columns_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@


def _new_vep_110_annotation(apps, _schema_editor):
VEP_CUSTOM_GNOMAD_2 = 'g'
VEP_CUSTOM_GNOMAD_3 = 'n'
VEP_CUSTOM_GNOMAD_4 = 'o'

Expand All @@ -26,23 +27,23 @@ def _new_vep_110_annotation(apps, _schema_editor):
{'column': 'gnomad2_ac', 'variant_grid_column_id': 'gnomad_ac',
'genome_build_id': 'GRCh37', 'pipeline_type': 'S', 'category': 'F', 'source_field': 'AC',
'source_field_processing_description': 'Sum of exome AC + genome AC',
'vep_custom': 'g', 'source_field_has_custom_prefix': True},
'vep_custom': VEP_CUSTOM_GNOMAD_2, 'source_field_has_custom_prefix': True},
{'column': 'gnomad2_popmax_ac', 'variant_grid_column_id': 'gnomad_popmax_ac',
'genome_build_id': 'GRCh37', 'pipeline_type': 'S', 'category': 'F', 'source_field': 'AC_popmax',
'source_field_processing_description': 'Sum of exome AC_popmax + genome AC_popmax',
'vep_custom': 'g', 'source_field_has_custom_prefix': True},
'vep_custom': VEP_CUSTOM_GNOMAD_2, 'source_field_has_custom_prefix': True},
{'column': 'gnomad2_an', 'variant_grid_column_id': 'gnomad_an',
'genome_build_id': 'GRCh37', 'pipeline_type': 'S', 'category': 'F', 'source_field': 'AN',
'source_field_processing_description': 'Sum of exome AN + genome AN',
'vep_custom': 'g', 'source_field_has_custom_prefix': True},
'vep_custom': VEP_CUSTOM_GNOMAD_2, 'source_field_has_custom_prefix': True},
{'column': 'gnomad2_popmax_an', 'variant_grid_column_id': 'gnomad_popmax_an',
'genome_build_id': 'GRCh37', 'pipeline_type': 'S', 'category': 'F', 'source_field': 'AN_popmax',
'source_field_processing_description': 'Sum of exome AN_popmax + genome AN_popmax',
'vep_custom': 'g', 'source_field_has_custom_prefix': True},
'vep_custom': VEP_CUSTOM_GNOMAD_2, 'source_field_has_custom_prefix': True},
{'column': 'gnomad2_nonpar', 'variant_grid_column_id': 'gnomad_non_par',
'genome_build_id': 'GRCh37', 'pipeline_type': 'S', 'category': 'F', 'source_field': 'nonpar',
'source_field_processing_description': 'nonpar from genomes',
'vep_custom': 'g', 'source_field_has_custom_prefix': True},
'vep_custom': VEP_CUSTOM_GNOMAD_2, 'source_field_has_custom_prefix': True},

# gnomAD 4 - issue #938
{'column': 'gnomad4_ac', 'source_field_has_custom_prefix': True, 'min_vep_columns_version': 3,
Expand Down
33 changes: 33 additions & 0 deletions annotation/migrations/0086_gnomad2_xy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 4.1.4 on 2023-12-07 11:48

from django.db import migrations

from library.django_utils import bulk_insert_class_data


def _gnomad2xy(apps, _schema_editor):
VEP_CUSTOM_GNOMAD_2 = 'g'
FREQUENCY_DATA = 'F'

COLUMN_VEP_FIELD = [
{'column': 'gnomad2_xy_ac', 'source_field_has_custom_prefix': True, 'min_vep_columns_version': 3,
'vep_custom': VEP_CUSTOM_GNOMAD_2, 'variant_grid_column_id': 'gnomad_xy_ac', 'source_field': 'AC_male',
'category': FREQUENCY_DATA, 'genome_build_id': 'GRCh37'},
{'column': 'gnomad2_xy_af', 'source_field_has_custom_prefix': True, 'min_vep_columns_version': 3,
'vep_custom': VEP_CUSTOM_GNOMAD_2, 'variant_grid_column_id': 'gnomad_xy_af', 'source_field': 'AF_male',
'category': FREQUENCY_DATA, 'genome_build_id': 'GRCh37'},
{'column': 'gnomad2_xy_an', 'source_field_has_custom_prefix': True, 'min_vep_columns_version': 3,
'vep_custom': VEP_CUSTOM_GNOMAD_2, 'variant_grid_column_id': 'gnomad_xy_an', 'source_field': 'AN_male',
'category': FREQUENCY_DATA, 'genome_build_id': 'GRCh37'},
]
bulk_insert_class_data(apps, "annotation", [("ColumnVEPField", COLUMN_VEP_FIELD)])


class Migration(migrations.Migration):
dependencies = [
("annotation", "0085_alter_dbnsfpgeneannotationversion_options_and_more"),
]

operations = [
migrations.RunPython(_gnomad2xy)
]
2 changes: 1 addition & 1 deletion variantgrid/settings/components/default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
"dbscsnv": "annotation_data/GRCh38/dbscSNV1.1_GRCh38.txt.gz",
"gnomad2": "annotation_data/GRCh38/gnomad2.1.1_GRCh38_combined_af.vcf.bgz",
"gnomad3": "annotation_data/GRCh38/gnomad3.1_GRCh38_merged.vcf.bgz",
"gnomad4": "annotation_data/GRCh38/gnomad4.0_GRCh38_combined_af.vcf.bgz",
"gnomad4": "annotation_data/GRCh38/gnomad4.0.GRCh38.combined_af.vcf.bgz",
"mastermind": "annotation_data/GRCh38/mastermind_cited_variants_reference-2022.04.02-grch38.vcf.gz",
"mave": "annotation_data/GRCh38/MaveDB_variants.tsv.gz",
"maxentscan": "annotation_data/all_builds/maxentscan",
Expand Down
13 changes: 9 additions & 4 deletions variantgrid/settings/env/vgtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,26 @@


ANNOTATION[BUILD_GRCH37].update({
"columns_version": 2,
"columns_version": 3,
"reference_fasta": os.path.join(_ANNOTATION_FASTA_BASE_DIR, "GCF_000001405.25_GRCh37.p13_genomic.fna.gz"),
})

ANNOTATION[BUILD_GRCH38].update({
"columns_version": 2,
"columns_version": 3,
"enabled": True,
"reference_fasta": os.path.join(_ANNOTATION_FASTA_BASE_DIR, "GCF_000001405.39_GRCh38.p13_genomic.fna.gz"),
})


ANNOTATION[BUILD_GRCH37]["vep_config"].update({
"dbnsfp": "annotation_data/GRCh37/dbNSFP4.3a.grch37.stripped.gz",
"cosmic": "annotation_data/GRCh37/Cosmic_GenomeScreensMutant_v99_GRCh37.vcf.gz",
"dbnsfp": "annotation_data/GRCh37/dbNSFP4.5a.grch37.stripped.gz",
"mastermind": "annotation_data/GRCh37/mastermind_cited_variants_reference-2023.10.02-grch37.vcf.gz",
})
ANNOTATION[BUILD_GRCH38]["vep_config"].update({
"dbnsfp": "annotation_data/GRCh38/dbNSFP4.3a.grch38.stripped.gz",
"cosmic": "annotation_data/GRCh38/Cosmic_GenomeScreensMutant_v99_GRCh38.vcf.gz",
"dbnsfp": "annotation_data/GRCh38/dbNSFP4.5a.grch38.stripped.gz",
"mastermind": "annotation_data/GRCh38/mastermind_cited_variants_reference-2023.10.02-grch38.vcf.gz",
})

ANNOTATION_VCF_DUMP_DIR = os.path.join(ANNOTATION_REFERENCE_BASE_DIR, 'scratch')
Expand Down

0 comments on commit c57c3ee

Please sign in to comment.