Skip to main content
Contig

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.

Release Status License Python Built with uv Powered by Nextflow PRs welcome

Quickstart · Usage · How it works · Architecture · Vision · Roadmap · Contributing


A real Contig terminal session: a pipeline run hits an out-of-memory failure, Contig self-heals it, verifies QC to a PASS verdict, and confirms the signed, reproducible record.

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", and contig show --explain names 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, or tumour VAF and somatic call-set size for tumour–normal runs). Pass --fail-on-verdict to make a FAIL exit non-zero and gate a script or CI step on the verdict. Verification is scoped honestly per assay and never over-claims: a check earns a FAIL band only where a grossly-wrong value is distinguishable from unusual-but-real science — so an empty call set FAILs, while a low-purity tumour's VAF stays a WARN, and UNVERIFIED never masquerades as either.
  • 📦 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.

Contig self-heals a stale aligner index: STAR_ALIGN fails on an incompatible index, Contig diagnoses missing_index, rebuilds the index from the reference into a scratch dir, redirects the retry, and returns PASS.

A verdict you can trust — independent checks, honestly scoped per assay.

Contig verify shows a multi-layered verdict: QC thresholds, structural checks, cross-tool concordance against a second caller, biological plausibility (Ti/Tv, het/hom), and output-integrity re-hashing, all passing.

Watch and steer, or run headless — live progress and an approval gate for risky fixes.

Contig watch streams a live run: running state and elapsed time, a task progress bar, a self-heal attempt that needs approval, the run paused at the approval gate, and contig approve resuming it.

Gets better as it runs — every failure compounds into a versioned corpus.

Contig's learning loop: eval-detector accuracy trending 0.80 to 1.00 across corpus versions, corpus-promote adding a real failure to the golden corpus, and coverage across 14 classes, learned from real failures independent of any model.

📦 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 wired · QC pack
Germline variant calling (research) nf-core/sarek Ti/Tv & het/hom ratios, variant count, coverage, sex check wired · QC pack
Somatic variant calling (tumor–normal, research) nf-core/sarek Strelka2-vs-Mutect2 concordance, VAF distribution, somatic variant count, 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.

Built test-first. The moat is execution, verification, and reproducibility, the part that gets better as models improve.

Release files for contig 0.61.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for contig 0.61.0
File Size Uploaded
contig-0.61.0.tar.gz 5.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for contig 0.61.0
File Interpreter ABI Platform
contig-0.61.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 MB

Release files / contig-0.61.0.tar.gz

Download URL contig-0.61.0.tar.gz
Size 5.8 MB
Tags Source
SHA-256 checksum
How to use checksums
02e9f54c5115f3c7fae083d0fca8ca6ec1e2e9ae6ef3367553686d113cd4364e
BLAKE2b-256 checksum
How to use checksums
dae4d4daffc9d35b06fdcb975a432f97b147be7af24fe3f0b7f8f76b04170854
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / contig-0.61.0-py3-none-any.whl

Download URL contig-0.61.0-py3-none-any.whl
Size 435.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f7ab817698d85ab4f9e23e33700f7aade0af787a51f70ecfa4e96b0d11a3924
BLAKE2b-256 checksum
How to use checksums
b9d27077a166007745055b9e0fe50df86d4a51b34fdb4c45202c6e7fe5f127b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

0.62.0

2 release files

This release

0.61.0 This release

2 release files

0.60.0

2 release files

0.59.0

2 release files

0.55.1

2 release files

0.55.0

2 release files

0.54.0

2 release files

0.53.0

2 release files

0.49.0

2 release files

0.48.0

2 release files

0.47.0

2 release files

0.46.0

2 release files

0.45.0

2 release files

0.44.0

2 release files

0.43.0

2 release files

0.42.0

2 release files

0.41.0

2 release files

0.40.0

2 release files

0.39.0

2 release files

0.38.0

2 release files

0.37.0

2 release files

0.36.0

2 release files

0.35.0

2 release files

0.34.0

2 release files

0.33.0

2 release files

0.32.0

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.29.0

2 release files

0.28.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page