Re-sending a single-sample VCF through the backend API leaves the old VCF linked to the sequencing run alongside the new one
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 64/100
Research direction
Read seqauto/upload_links.py, especially create_backend_vcf_links and link_samples_and_vcfs_to_sequencing, to trace how the old upload link is lost before the run VCF is removed. Add a test that sends the same caller's file twice and checks the sequencing run has only one VCF for that caller.
Written by the indexing model from the issue text.
Description
🤖 Written by Claude
Problem
When a pipeline re-sends a single-sample VCF through the backend API (same registered SingleSampleVCF path, new content), the earlier VCF from that caller is meant to be unlinked from the sequencing run and replaced. It isn't: the run ends up with both VCFs for the same caller. Anything built from the run then shows both sets of calls. For example, a Specimen-level auto-launched analysis (#2898) lists both the old and the new VCF in its sample node.
Found in agent testing of #2898 (https://github.com/SACGF/variantgrid/issues/2898#issuecomment-7187938517): after re-sending one arm's CNV file, VCFFromSequencingRun held both VCFs for that caller. This predates #2898: the code has worked this way since #2490.
Cause
seqauto/upload_links.py:create_backend_vcf_links runs first and calls BackendVCF.objects.update_or_create(single_sample_vcf=..., defaults={"uploaded_vcf": <new upload>}). That repoints the one BackendVCF from the old upload to the new one.
seqauto/upload_links.py:link_samples_and_vcfs_to_sequencing then looks for the earlier VCF to remove with vcf__uploadedvcf__backendvcf__single_sample_vcf__variant_caller=.... The old VCF's UploadedVCF no longer has a BackendVCF, so the query only finds the new one (or nothing), and the old VCFFromSequencingRun stays.
Proposed
Find the VCF being replaced without going through the BackendVCF that was just repointed. Either read the BackendVCF's previous uploaded_vcf before the update, or match VCFFromSequencingRun rows by the sequencing sample and the SingleSampleVCF's variant caller as recorded on the row. Add a test that sends one file twice and checks the run is left with one VCF for that caller.
Related: #1192 (reload a VCF in place, a separate feature).
- Dominant language
- Python
- Stars
- 31
- Forks
- 4
- Avg merge
- 4h 52m
- Merged PRs (30d)
- 183
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SACGF/variantgrid
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
SACGF/variantgrid#2964 · 1 comment ·
Maintainers usually reply within 1 day
-
Genome build now duplicated in "imported as" on allele pagePossibly taken @TheMadBug claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
SACGF/variantgrid#2950 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
SACGF/variantgrid#2865 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SACGF/variantgrid#2647 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
SACGF/variantgrid#2341 · 3 comments ·
Maintainers usually reply within 1 day
All issues in SACGF/variantgrid
Similar issues
-
Test: to_hijri() accepts datetime.datetime and uses only the date partPossibly taken A pull request linked to this issue is open or already merged. Opengood first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 · 3 comments ·
Maintainers usually reply within 1 day
-
polish
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresPossibly taken @AshutoshSingh840 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
UKGovernmentBEIS/control-arena#992 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Maintainers usually reply within 1 day