From b85823b2263e5b4eb1f94254b9ba8cfac3a72afb Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Thu, 8 Aug 2024 12:03:04 +0930 Subject: [PATCH] issue #971 - summary stats for vep 112 --- .../0115_one_off_vep_column_fields_vep112.py | 12 +++++----- ..._one_off_update_vep_112_conservation_sv.py | 22 +++++++++++++++++++ annotation/models/models.py | 3 ++- 3 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 annotation/migrations/0116_one_off_update_vep_112_conservation_sv.py diff --git a/annotation/migrations/0115_one_off_vep_column_fields_vep112.py b/annotation/migrations/0115_one_off_vep_column_fields_vep112.py index e92dba949..98dc59da5 100644 --- a/annotation/migrations/0115_one_off_vep_column_fields_vep112.py +++ b/annotation/migrations/0115_one_off_vep_column_fields_vep112.py @@ -35,7 +35,7 @@ def _one_off_vep_112_summary_stats_fields(apps, schema_editor): {'column': 'phastcons_30_way_mammalian_max', 'variant_grid_column_id': 'phastcons_30_way_mammalian', 'genome_build_id': 'GRCh38', - 'pipeline_type': 'S', + 'pipeline_type': None, 'category': 'C', 'source_field': 'max', 'source_field_processing_description': 'max() for indels', @@ -50,7 +50,7 @@ def _one_off_vep_112_summary_stats_fields(apps, schema_editor): {'column': 'phastcons_100_way_vertebrate_max', 'variant_grid_column_id': 'phastcons_100_way_vertebrate', 'genome_build_id': None, - 'pipeline_type': 'S', + 'pipeline_type': None, 'category': 'C', 'source_field': 'max', 'source_field_processing_description': 'max() for indels', @@ -65,7 +65,7 @@ def _one_off_vep_112_summary_stats_fields(apps, schema_editor): {'column': 'phylop_100_way_vertebrate_max', 'variant_grid_column_id': 'phylop_100_way_vertebrate', 'genome_build_id': None, - 'pipeline_type': 'S', + 'pipeline_type': None, 'category': 'C', 'source_field': 'max', 'source_field_processing_description': 'max() for indels', @@ -80,7 +80,7 @@ def _one_off_vep_112_summary_stats_fields(apps, schema_editor): {'column': 'phastcons_46_way_mammalian_max', 'variant_grid_column_id': 'phastcons_46_way_mammalian', 'genome_build_id': 'GRCh37', - 'pipeline_type': 'S', + 'pipeline_type': None, 'category': 'C', 'source_field': 'max', 'source_field_processing_description': 'max() for indels', @@ -95,7 +95,7 @@ def _one_off_vep_112_summary_stats_fields(apps, schema_editor): {'column': 'phylop_46_way_mammalian_max', 'variant_grid_column_id': 'phylop_46_way_mammalian', 'genome_build_id': 'GRCh37', - 'pipeline_type': 'S', + 'pipeline_type': None, 'category': 'C', 'source_field': 'max', 'source_field_processing_description': 'max() for indels', @@ -110,7 +110,7 @@ def _one_off_vep_112_summary_stats_fields(apps, schema_editor): {'column': 'phylop_30_way_mammalian_max', 'variant_grid_column_id': 'phylop_30_way_mammalian', 'genome_build_id': 'GRCh38', - 'pipeline_type': 'S', + 'pipeline_type': None, 'category': 'C', 'source_field': 'max', 'source_field_processing_description': 'max() for indels', diff --git a/annotation/migrations/0116_one_off_update_vep_112_conservation_sv.py b/annotation/migrations/0116_one_off_update_vep_112_conservation_sv.py new file mode 100644 index 000000000..5bdef5601 --- /dev/null +++ b/annotation/migrations/0116_one_off_update_vep_112_conservation_sv.py @@ -0,0 +1,22 @@ +# Generated by Django 4.2.10 on 2024-08-08 02:28 + +from django.db import migrations + +def _one_off_update_vep_112_conservation_sv(apps, schema_editor): + """ + These were accidentally left as short/standard variant only due to copy/paste + I have modified the migration 0115 - so can delete this if squishing migrations + """ + ColumnVEPField = apps.get_model('annotation', 'ColumnVEPField') + ColumnVEPField.objects.filter(min_vep_version=112).update(pipeline_type=None) + + +class Migration(migrations.Migration): + + dependencies = [ + ('annotation', '0115_one_off_vep_column_fields_vep112'), + ] + + operations = [ + migrations.RunPython(_one_off_update_vep_112_conservation_sv) + ] diff --git a/annotation/models/models.py b/annotation/models/models.py index 9b1c5e9f7..c044eb291 100644 --- a/annotation/models/models.py +++ b/annotation/models/models.py @@ -1298,7 +1298,8 @@ def has_pathogenicity(self) -> bool: @property def has_conservation(self) -> bool: - return self.is_standard_annotation + """ Thanks to summary stats we can now do this in VEP112 """ + return self.is_standard_annotation or self.version.vep >= 112 @property def has_splicing(self) -> bool: