Agentic bioinformatics analyst: Layer 2 execution/verification/reproducibility engine
Project description
Contig
An agentic bioinformatics analyst: it runs the analysis, fixes what breaks, and proves the result.
Contig takes raw sequencing data all the way to a verified, reproducible answer: it selects and runs the right pipeline on your own compute, diagnoses and self-heals failures, verifies the output, and writes a portable record anyone can reproduce.
Quickstart · Usage · How it works · Architecture · Vision · Roadmap · Contributing
A real terminal capture (offline demo): a run that OOMs → self-heals → passes QC to a PASS verdict → a signed, verified record.
Why Contig
Producing an end-to-end analysis from raw sequencing data needs a rare pairing of domain biology and computational engineering. Roughly 74% of wet-lab scientists have no programming experience (2507.20122), and frontier models still reach only ~17% on real bioinformatics analysis (BixBench, 2503.00096). Turning English into a workflow is the easy, crowded part. Running it, fixing it, and proving it is the unsolved part, and that's Contig.
- 🧬 Goal → pipeline, vetted. Describe your goal in plain language; Contig proposes a curated pipeline + params to approve, and flags problems (no replicates, single-end, missing reference) before a multi-hour run.
- 🩹 Self-healing runs. When a step fails (OOM, a missing index it can build, version mismatch, malformed input), Contig diagnoses it, applies a safe patch, and retries, showing you the repair chain. A risky fix pauses the run for your approval instead of guessing.
- ✅ Verified outputs. Every run ends in an honest verdict (
PASS/WARN/FAIL/UNVERIFIED) backed by real checks, never a bare "done", andcontig show --explainnames the exact checks that drove it. The verdict draws on several independent layers: QC-metric thresholds, structural and integrity checks on the output files, cross-tool concordance (a second independent tool corroborates a germline call set:contig verify --concordance-vcf), and biological-plausibility checks (assay-aware sanity such as the Ti/Tv and het/hom ratios for germline variants). Verification is scoped honestly per assay and never over-claims. - 📦 Reproducible by default. Each run pins inputs (checksums), pipeline revision, params, and tool versions into a portable record. Reproduce any past run with one command or one click. Your reads never leave your machine; only hashes are recorded.
- 📈 Gets better as it runs. Every recovered failure becomes a labeled data point in a versioned failure corpus that compounds, independent of any single model, and a tracked accuracy trend shows the detector improving.
- 🖥 Watch and steer, or run headless. A local dashboard streams live task progress and the self-heal feed, and lets you approve patches, cancel, resume, and reproduce runs; the same controls are CLI commands for scripts and servers.
- ☁️ Same run, laptop or cloud. One command lands unchanged on Docker locally or AWS Batch in your own account, via Nextflow's native executors.
🎥 A closer look
Four things no incumbent does, each a real command on your own compute.
Self-heal a broken step — diagnose the failure, patch it, retry, unattended.
A verdict you can trust — independent checks, honestly scoped per assay.
Watch and steer, or run headless — live progress and an approval gate for risky fixes.
Gets better as it runs — every failure compounds into a versioned corpus.
📦 Installation
Pick whichever fits your machine (each release ships all four):
# Python (any OS with Python 3.12+)
pipx install contig # or: uvx contig --help
# Standalone binary (no Python needed): download from the latest release
# https://github.com/haqaliz/contig/releases/latest
# contig-linux-x86_64 | contig-macos-arm64 | contig-macos-x86_64 | contig-windows-x86_64.exe
chmod +x contig-macos-arm64 && ./contig-macos-arm64 --help
# Container (Docker Hub or GitHub Container Registry, same image)
docker run --rm haqaliz/contig:latest --help
docker run --rm ghcr.io/haqaliz/contig:latest --help
# Homebrew (macOS / Linux)
brew install haqaliz/contig/contig
From source, with uv:
git clone https://github.com/haqaliz/contig.git && cd contig
uv sync && uv run contig --help
Running a real pipeline also needs Nextflow, a Java runtime (JAVA_HOME), and a running container runtime. The CLI and its self-contained commands (plan, show, verify, benchmark, eval-detector, ...) work without them. Full prerequisites are in docs/USAGE.md, and the release process is in RELEASING.md.
🚀 Quickstart
Try it in 30 seconds, no data of your own (uses nf-core/rnaseq's bundled test profile):
contig run --run-id smoke # run → self-heal → verify → reproduce
contig show smoke # verdict + provenance + repair chain
Run on your data: plan first, then run against a reference:
contig plan --goal "find differentially expressed genes" \
--input samplesheet.csv --genome GRCh38 # propose a pipeline to approve
contig run --run-id my-analysis \
--input samplesheet.csv --genome GRCh38 # or: --fasta ref.fa --gtf genes.gtf
Running from a source checkout instead of an install? Prefix each command with
uv run(e.g.uv run contig run --run-id smoke).
Prefer a screen? The local dashboard launches runs and shows live progress, the self-heal feed, verdict explanations, and the detector trend:
cd dashboard && npm install && npm run dev # http://localhost:3000 (localhost-only, no auth)
The full sample-sheet format, cloud backends, the reproducible bundle, the live controls, and the failure-corpus workflow are all in docs/USAGE.md.
🔍 How it works
Contig is built around Layer 2 (the run-and-verify engine) and consumes Layer-1 workflow generation as a replaceable commodity.
goal + data ──▶ plan ──▶ run ──▶ ⚠ failure? ──▶ self-heal ──▶ verify ──▶ verdict + record
(vet) (your diagnose → (patch & (QC (PASS/WARN/
compute) classify retry) checks) FAIL/UNVERIFIED)
| Verdict | Meaning |
|---|---|
PASS |
Ran to completion and every QC check passed |
WARN |
Completed, but a QC check is borderline; look before you trust it |
FAIL |
A task or QC check failed; do not trust the output |
UNVERIFIED |
Completed, but nothing checked it, so we won't claim it's correct |
Supported analyses
| Goal | Pipeline | QC checks | Maturity |
|---|---|---|---|
| RNA-seq differential expression | nf-core/rnaseq |
alignment/assignment rate, library-size skew, replicate checks | validated end-to-end |
| Single-cell RNA-seq | nf-core/scrnaseq |
estimated cells, median genes per cell, reads in cells, mito fraction | wired · QC pack |
| Germline variant calling (research) | nf-core/sarek |
Ti/Tv & het/hom ratios, coverage | wired · QC pack |
| Somatic variant calling (tumor–normal, research) | nf-core/sarek |
Strelka2-vs-Mutect2 concordance, VAF distribution, panel-of-normals | wired · QC pack |
| Methylation (bisulfite) | nf-core/methylseq |
bisulfite conversion rate, mapping efficiency, duplication | wired · QC pack |
| 16S amplicon (microbiome) | nf-core/ampliseq |
DADA2 read retention, ASV count, sample read depth | wired · QC pack |
| Shotgun metagenomics | nf-core/mag |
assembly N50, bin completeness, contamination | wired · QC pack |
contig plan routes to the right one and declines goals it has no curated pipeline for rather than inventing a workflow. The same run → self-heal → verify → reproduce engine serves every assay above. Maturity is honest: nf-core/rnaseq is exercised end-to-end (including the self-heal loop) in CI; the others ship a curated pipeline + assay-aware QC pack and are being hardened toward the same end-to-end bar (see docs/ROADMAP.md).
📚 Documentation
| Document | What's in it |
|---|---|
| docs/USAGE.md | Full CLI reference, your-own-data walkthrough, the dashboard, live controls (watch, approve, cancel, resume), cloud backends, reproduce/share, failure corpus |
| CONTRIBUTING.md | Dev setup, package management (uv), tests, project layout, how to contribute |
| VISION.md | The narrative thesis, the moat, why now, non-goals |
| docs/RESEARCH_FINDINGS.md | The validated evidence base behind the bet |
| docs/ROADMAP.md | Phased plan from validation to MVP and beyond |
| docs/product/PRODUCT_SPEC.md | Product surface, flows, and behavior |
| docs/technical/ARCHITECTURE.md | The agentic execution/verification system design |
| docs/business/ | Market analysis, business model, go-to-market |
Some documents are placeholders being filled in during the validation phase.
🛠 Status & roadmap
MVP engine built; in early access. The Layer-2 core (run → capture → self-heal → verify → reproduce) works end-to-end on nf-core/rnaseq, built test-first, as a CLI and a local dashboard (launch, live progress, the self-heal approval gate, verdict explainability, one-click reproduce, and the detector-accuracy trend). Not yet built: an LLM-backed planner (the goal→pipeline matcher is deterministic and replaceable today), more assays, hosted multi-user access (the dashboard is localhost-only today), and live-tested slurm/gcp_batch/k8s backends (the mapping layer is in place; local and aws_batch are wired). See docs/ROADMAP.md.
🤝 Contributing
Contributions are welcome: code, curated pipelines, QC checks, and especially failure cases for the corpus. Start with CONTRIBUTING.md, then open an issue or a pull request.
📄 License
Apache License 2.0 — permissive, with an explicit patent and trademark grant. Use, modify, and redistribute Contig, including commercially, under its terms. Contributions are accepted under the same license (see CONTRIBUTING.md). Contig orchestrates third-party pipelines (nf-core, Nextflow) that carry their own licenses; see NOTICE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file contig-0.30.0.tar.gz.
File metadata
- Download URL: contig-0.30.0.tar.gz
- Upload date:
- Size: 4.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
783491045b42f92c8f04450d3956e508eaa35d9ae2109c26b567166459d5b2d7
|
|
| MD5 |
835496f6d94789532c94800f41a33e06
|
|
| BLAKE2b-256 |
dfc219e4856c9841d2a5d52dccb1a45bb6eb1a969a089de577fb4e93e9e1ef41
|
Provenance
The following attestation bundles were made for contig-0.30.0.tar.gz:
Publisher:
release.yml on haqaliz/contig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
contig-0.30.0.tar.gz -
Subject digest:
783491045b42f92c8f04450d3956e508eaa35d9ae2109c26b567166459d5b2d7 - Sigstore transparency entry: 2145772069
- Sigstore integration time:
-
Permalink:
haqaliz/contig@97c589980ecc0d6153e4495359496ad2d04f8cf8 -
Branch / Tag:
refs/tags/v0.30.0 - Owner: https://github.com/haqaliz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@97c589980ecc0d6153e4495359496ad2d04f8cf8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file contig-0.30.0-py3-none-any.whl.
File metadata
- Download URL: contig-0.30.0-py3-none-any.whl
- Upload date:
- Size: 249.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
094576890ed8a3899fcb0561ab8c1d7593bca0aae7106def34eabcd480ff346e
|
|
| MD5 |
34815b41a351236e02891b93d1731aa9
|
|
| BLAKE2b-256 |
e8c2e22d7ef70950e18733c62a11ce3ed7645a128ce16373f4dc42d7d59e37de
|
Provenance
The following attestation bundles were made for contig-0.30.0-py3-none-any.whl:
Publisher:
release.yml on haqaliz/contig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
contig-0.30.0-py3-none-any.whl -
Subject digest:
094576890ed8a3899fcb0561ab8c1d7593bca0aae7106def34eabcd480ff346e - Sigstore transparency entry: 2145772074
- Sigstore integration time:
-
Permalink:
haqaliz/contig@97c589980ecc0d6153e4495359496ad2d04f8cf8 -
Branch / Tag:
refs/tags/v0.30.0 - Owner: https://github.com/haqaliz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@97c589980ecc0d6153e4495359496ad2d04f8cf8 -
Trigger Event:
push
-
Statement type: