-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1224 - VEP - structural variants too long to annotate
- Loading branch information
Showing
6 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
annotation/migrations/0124_alter_variantannotation_vep_skipped_reason.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.2.18 on 2025-01-28 23:32 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('annotation', '0123_one_off_fix_annotation_sv_c_hgvs'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='variantannotation', | ||
name='vep_skipped_reason', | ||
field=models.CharField(blank=True, choices=[('c', 'Unknown Contig'), ('i', 'Incomplete'), ('u', 'Unknown'), ('l', 'Too Long')], max_length=1, null=True), | ||
), | ||
] |
31 changes: 31 additions & 0 deletions
31
annotation/migrations/0125_one_off_historical_vep_too_long.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Generated by Django 4.2.18 on 2025-01-29 00:48 | ||
import logging | ||
|
||
from django.db import migrations | ||
from django.db.models.functions import Abs | ||
|
||
|
||
def _one_off_historical_vep_too_long(apps, schema_editor): | ||
Variant = apps.get_model("snpdb", "Variant") | ||
VariantAnnotation = apps.get_model("annotation", "VariantAnnotation") | ||
|
||
VEP_SKIPPED_UNKNOWN = 'u' | ||
VEP_SKIPPED_TOO_LONG = 'l' | ||
|
||
qs = Variant.objects.filter(svlen__isnull=False).annotate(abs_svlen=Abs("svlen")) | ||
qs_long_variants = qs.filter(abs_svlen__gte=10_000_000) | ||
qs_qa_long = VariantAnnotation.objects.filter(variant__in=qs_long_variants, | ||
vep_skipped_reason=VEP_SKIPPED_UNKNOWN) | ||
if ret := qs_qa_long.update(vep_skipped_reason=VEP_SKIPPED_TOO_LONG): | ||
logging.info("Updated %d VEP skipped variants to TOO_LONG ", ret) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('annotation', '0124_alter_variantannotation_vep_skipped_reason'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(_one_off_historical_vep_too_long) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters