SACGF / variantgrid

VariantGrid public repo
Other
23 stars 2 forks source link

KeyError: 'indel' #1132

Open davmlaw opened 1 month ago

davmlaw commented 1 month ago

View details in Rollbar: https://app.rollbar.com/a/jimmy.andrews/fix/item/VariantGrid/5326

Traceback (most recent call last):
  File "/opt/variantgrid/env/lib/python3.11/site-packages/celery/app/trace.py", line 477, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/variantgrid/env/lib/python3.11/site-packages/celery/app/trace.py", line 760, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/variantgrid/annotation/tasks/annotate_variants.py", line 77, in annotate_variants
    import_vcf_annotations(annotation_run)
  File "/opt/variantgrid/annotation/vcf_files/import_vcf_annotations.py", line 38, in import_vcf_annotations
    bulk_inserter.process_entry(v)
  File "/opt/variantgrid/annotation/vcf_files/bulk_vep_vcf_annotation_inserter.py", line 615, in process_entry
    raise e
  File "/opt/variantgrid/annotation/vcf_files/bulk_vep_vcf_annotation_inserter.py", line 587, in process_entry
    variant_data = self.vep_to_db_dict(vep_transcript_data, self.variant_only_columns)
  File "/opt/variantgrid/annotation/vcf_files/bulk_vep_vcf_annotation_inserter.py", line 352, in vep_to_db_dict
    self.sv_overlap_processor.process(raw_db_data)
  File "/opt/variantgrid/annotation/vcf_files/bulk_vep_vcf_annotation_inserter.py", line 840, in process
    required_substring = self._get_required_substring(raw_db_data["variant_class"])
  File "/opt/variantgrid/annotation/vcf_files/bulk_vep_vcf_annotation_inserter.py", line 829, in _get_required_substring
    required_substring = EXPECTED_NAME[variant_class]
KeyError: 'indel'
davmlaw commented 1 month ago

VEP Variant class - indel = A sequence alteration which included an insertion and a deletion, affecting 2 or more bases.

I originally wrote the SV pipeline to only be symbolic variants, but we also put very long non-symbolic variants through it, so I suspect it is one of those. To find out what variant this is, we could run:

zgrep "indel" /data/annotation/test_annotation_scratch/dump_13811_structural_variant.vep_annotated_GRCh37.vcf.gz

The qustion is - for long non-symbolic indels, do we want to look at their overlap with gnomadSV?

For a delisn, you could either regard neither a del nor an ins as the same type, or both a del and an ins.

I think we'll go with both, and let the user decide whether to care, can always remove it later

davmlaw commented 1 month ago

Not really user testable - basically doesn't crash

EmmaTudini commented 3 weeks ago

Re-opening for Shariant testing This was a bug with annotations introduced 2024-08-07 in dev, never made it to prod. Should be testable by importing an indel c.HGVS with many changes bases. (Should be tested as part of a larger variant resolution task)