Sample QC status (pass/warn/fail) with a warning on analyses that use a failed sample

Open
#2,816 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start by reading snpdb/models/models_cohort_stats.py, seqauto/views.py:view_sample_qc_tab, and analysis/views/views_node.py:node_snp_matrix to trace the existing QC signals and where sample and analysis details are shown. Done means a per-sample pass/warn/fail status uses the listed signals and configurable thresholds, appears on sample pages and grids, and warns on analyses and nodes that use samples with warnings or failures.

Written by the indexing model from the issue text.

Description

🤖 Written by Claude

Problem

A negative analysis result only means something if the sample passed QC, but nothing in VariantGrid says whether a sample passed. The signals exist and are scattered:

  • CohortGenotypeStats (snpdb/models/models_cohort_stats.py) has SNP/indel and het/hom counts and chrx_sex_guess, shown as "Detected Sex" on the sample page
  • The family wizard warns when the proband's sex doesn't match (proband_sex_mismatch.js), but only there
  • Ti/Tv is computed only on a node's SNP matrix (analysis/views/views_node.py:node_snp_matrix), not per sample
  • The sample page's QC tab (seqauto/views.py:view_sample_qc_tab) shows the sequencing pipeline's QC when the sample came from a sequencing run, as raw values

So a contaminated sample, one with the wrong sex, or one uploaded against the wrong build can go through an analysis without anyone being told.

Suggestion

  • A pass / warn / fail QC status per sample, computed from the signals above: detected sex vs the recorded sex on the patient/sample, Ti/Tv, het/hom ratio, variant counts, and the seqauto QC when it is there
  • Thresholds configurable per enrichment kit (exome, panel and WGS have different expected counts and ratios)
  • The status on the sample page and the sample grids
  • A warning on an analysis (and on the node) when a source sample has failed or warned, so the person reviewing a negative result sees it

Related: #1748 (seqauto run/QC pages), #1125 (QC graphs).

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SACGF/variantgrid

All issues in SACGF/variantgrid

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.