Duplicate Allele causes VariantAllele integrity error upon merging
- Dominant language
- Python
- Stars
- 30
- Forks
- 3
- Avg merge
- 9h 28m
- Merged PRs (30d)
- 42
Description
Very rare have only seen once but 21:44521550 G>A (GRCh37) ended up making 2x alleles due to an unknown race condition while importing as variant tags, which triggers a liftover that died in merge with:
```
File "/home/dlawrence/localwork/variantgrid/upload/vcf/bulk_allele_linking_vcf_processor.py", line 88, in merge_alleles
allele_1.merge(self.liftover.conversion_tool, allele_2)
[2021-06-17 20:41:35,706: ERROR/ForkPoolWorker-2] User: dlawrence, upload/import_I_failed: duplicate key value violates unique constraint "snpdb_variantallele_variant_id_genome_build__27987e1 ... niq"
DETAIL: Key (variant_id, genome_build_id, allele_id)=(6868329, GRCh37, 11570) already exists.
```
The alleles were made in the same second, miliseconds apart: 654692 vs 654711
Values were:
```
In [8]: v.variantallele_set.all().values()
Out[8]: ), 'modified': datetime.datetime(2021, 5, 26, 5, 36, 8, 654692, tzinfo=), 'variant_id': 6868329, 'genome_build_id': 'GRCh37', 'allele_id': 11571, 'origin': 'D', 'conversion_tool': '', 'error': {'region': '[44521549,44521550)', 'message': 'Cannot align NC_000021.8 [44521549,44521550). ', 'errorType': 'NoConsistentAlignment', 'inputLine': 'NC_000021.8:g.44521550G>A', 'description': 'Given allele cannot be mapped in consistent way to reference genome.', 'sequenceName': 'NC_000021.8'}}, {'id': 25646, 'created': datetime.datetime(2021, 5, 26, 5, 36, 8, 654711, tzinfo=), 'modified': datetime.datetime(2021, 5, 26, 5, 36, 8, 654715, tzinfo=), 'variant_id': 6868329, 'genome_build_id': 'GRCh37', 'allele_id': 11570, 'origin': 'D', 'conversion_tool': '', 'error': {'region': '[44521549,44521550)', 'message': 'Cannot align NC_000021.8 [44521549,44521550). ', 'errorType': 'NoConsistentAlignment', 'inputLine': 'NC_000021.8:g.44521550G>A', 'description': 'Given allele cannot be mapped in consistent way to reference genome.', 'sequenceName': 'NC_000021.8'}}]
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.