Auto-launch analysis templates by variant caller / VCF source, and per extraction / specimen / patient
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with analysis/models/models_analysis.py:AutoLaunchAnalysisTemplate and analysis/tasks/auto_analysis_tasks.py:auto_run_analyses_for_vcf, then read SampleNode/SampleSourceLevel and AnalysisVariable to see how launch levels map to template variables. Follow seqauto/upload_links.py and patients/tasks/extraction_matching_tasks.py for late group membership, and VCFSourceSettings for source matching. Done means the new criteria and launch level are visible on analysis/views/views.py:analysis_templates_auto_launch, with a per-group run dedupe model and tests covering complete, error and re-sequencing cases.
Written by the indexing model from the issue text.
Description
🤖 Written by Claude
Problem
Auto-launched analysis templates are matched only by enrichment kit and a sample-name regex (analysis/models/models_analysis.py:AutoLaunchAnalysisTemplate), and they launch once per sample on VCF import (analysis/tasks/auto_analysis_tasks.py:auto_run_analyses_for_vcf).
A DRAGEN TSO 500 case arrives as several files across two arms: DNA small variants, gene-level CNV, exon CNV, RNA fusions and RNA splice calls. All share the kit and name their samples alike. Today each file gets its own analysis from the same template. What we want is one analysis per case, with a SampleNode above sample level that holds every arm. SampleNode already supports this (SampleSourceLevel: Sample / Extraction / Specimen / Patient). The two arms of a TSO 500 pair meet at the Specimen: the CombinedVariantOutput import creates the pair's Specimen with a DNA and an RNA Extraction under it.
Proposal
Matching
Add two optional criteria to an auto-launch rule. As with the existing ones, blank means "anything".
- Variant caller(s): match on the
SingleSampleVCF.variant_callerthe pipeline registered, which already says what kind of file each one is (e.g.TSO_dragen_cnv_caller,TSO_fusion_caller). This is for deployments posting through the seqauto API. - VCF source regex: match against
VCF.source(the##sourceheader), the wayVCFSourceSettingsdoes. This is for deployments uploading through the upload page, where there is no SingleSampleVCF.
Launch level
A rule has a launch level: Sample (today's behaviour), Extraction, Specimen or Patient. The template's SampleNode makes the matching field (sample / extraction / specimen / patient) its AnalysisVariable. AnalysisVariable already handles any FK, so no new template mechanism is needed. Sample-level and group-level rules are independent: a deployment configures whichever it wants, and both may fire for the same sample.
When a group launches
- Expected files: the
SingleSampleVCFs registered against the group'sSequencingSamples on one sequencing run. - Launch: once every expected file has a VCF that imported successfully. The check runs on VCF import success and also when a sample is linked to its extraction (
seqauto/upload_links.py,patients/tasks/extraction_matching_tasks.py), since group membership can arrive after the VCFs. - Any expected file in an error state: no launch. That is deliberate: an incomplete case analysis is worse than none, and a missing analysis forces the import to be fixed. It should be visible why it didn't launch (e.g. an event log entry), not silent.
- Re-sequencing: a later run on the same specimen/patient is its own completeness set and gets its own analysis. An analysis already reported from doesn't change underneath anyone.
- Uploads with no SingleSampleVCF (upload page): there is no expected set, so the group launches on its first matching VCF, and later VCFs in the group reload it (as re-imports already do via
reload_auto_analyses_for_vcf).
Dedupe
A run record per (template, group object, sequencing run), alongside SampleAnalysisTemplateRun / CohortAnalysisTemplateRun, so each template runs once per group per run.
Notes
- For a TSO 500 deployment the expected setup is: a Specimen-level rule matched on kit + callers, with source left blank.
- The auto-launch test page (
analysis/views/views.py:analysis_templates_auto_launch) should show the new criteria and the launch level. - Related but separate: #687 (batch running a template over a VCF's samples).
- 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