Schedule icon
Fail icon
Loop icon
Get icon
Script icon
Docker icon
Log icon
If icon
SlackIncomingWebhook icon
Set icon

Monitor ClinVar genes for variant classification changes

Track ClinVar germline classification changes for BRCA1, TP53 and other genes with Kestra. KV snapshots, incremental scans, Slack alerts on real changes only.

Categories
Data

Teams that follow a gene panel need to know when a ClinVar germline classification changes, for example from "Uncertain significance" to "Likely pathogenic". This blueprint keeps a compact snapshot per gene and reports only the differences.

How it works

  1. A weekly schedule (Tuesday, after ClinVar's Monday update) starts the flow. validate_genes rejects malformed gene entries before any request.
  2. A Loop handles one gene at a time. compare_snapshots (Python) pages through NCBI ESearch, reads ESummary in batches of 200 and retries with backoff.
  3. The first run is a full scan that stores a baseline and sends nothing. Later runs fetch only records whose ClinVar modification date ([mdat]) is newer than the last checkpoint minus overlap_days. Every reconcile_days a full scan runs instead and logs how many of its changes fall outside that date window.
  4. notify_changes posts to Slack, then save_snapshot stores the snapshot and checkpoint. After a failure the old checkpoint stays, so the next run covers the same period again. Alerts are at-least-once.

What you get

  • Slack messages that separate reclassifications from new variants, with old and new classification, review status and a link.
  • No alert on quiet weeks, and a failure alert when NCBI or Slack fails.
  • A mistyped gene, corrupted snapshot, changed query or unsummarisable record stops the run instead of producing false alerts.

Who it's for

  • Bioinformatics and clinical genomics research teams and their platform engineers.

Why orchestrate this with Kestra

  • Scheduling, KV state, secret masking, a concurrency limit and failure alerts come from the platform.

Prerequisites

  • Docker for the Python task (python:3.12-slim, no extra packages) and outbound HTTPS to eutils.ncbi.nlm.nih.gov.
  • A full scan of BRCA1 (about 16,000 records) takes several minutes. Kestra documents no KV size limit; the task fails above 8 MB.
  • Research monitoring, not clinical advice. The date filter is not yet validated against real ClinVar updates, so keep the periodic full scan.

Secrets

  • SLACK_WEBHOOK_URL: Slack incoming webhook for alerts (needed when notify_slack is true).
  • NCBI_API_KEY: optional, only read when use_ncbi_api_key is true.

Quick start

  1. Add the SLACK_WEBHOOK_URL secret, or set notify_slack to false to read results in the logs.
  2. Execute twice: genes log BASELINE, then NO CHANGES.
  3. Then run with fail_if_snapshot_missing set to true, so a lost snapshot stops the run.

How to extend

  • Narrow the scope with extra_query or classifications_to_monitor, or add an email or Teams alert.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.