Skip to main content

promoterai-torch

PyPI Tests PyPI Downloads

A PyTorch port of PromoterAI v1 from Illumina — a deep learning model that predicts the regulatory impact of promoter DNA variants on gene expression.

Install

Python 3.10–3.14 are supported.

pip install promoterai-torch        # or: uv add promoterai-torch

The core package scores variants, extracts embeddings, runs inference and converts the official Keras models (no TensorFlow needed). Optional extras:

Extra Enables
train Preprocess data, train from scratch, or fine-tune
wandb Weights & Biases logging (combine with train)
interpret DeepLIFT/SHAP references and logo plots (tangermeme)

PyPI's torch supports NVIDIA GPUs of compute capability 7.5+ (Turing and newer). For older GPUs (Maxwell, Pascal, Volta) or CPU-only machines, see docs/installation.md. For a development checkout, see CONTRIBUTING.md.

Convert a pretrained Keras model

Download a pretrained PromoterAI SavedModel from Illumina/PromoterAI and convert it (architecture parameters are inferred from the SavedModel):

promoterai-torch convert \
    --keras_model models/promoterAI_v1_hg38_mm10_finetune \
    --output models/promoterAI_v1_hg38_mm10_finetune.pt \
    --input_length 20480 --output_length 4096   # stored in the checkpoint

Score variants

Given a variant TSV with columns chrom, pos, ref, alt, strand:

promoterai-torch score \
    --model_checkpoint models/promoterAI_v1_hg38_mm10_finetune.pt \
    --var_file variants.tsv \
    --fasta_file hg38.fa \
    --input_length 20480

Scores in [−1, 1] are written to variants.{model_name}.tsv (or --output). Thresholds: ±0.1 (weak), ±0.2 (moderate), ±0.5 (strong). Substitutions are scored incrementally by default: each site's reference runs once and each alt recomputes only what its edit can reach, exactly (5x faster on TERT promoter SNVs). Indels use full passes; --no-incremental forces full passes for all.

Predict tracks and extract embeddings

import torch
from promoterai_torch.dataset import onehot_encode
from promoterai_torch.utils import load_pretrained

model, args = load_pretrained("models/promoterAI_v1_hg38_mm10_finetune.pt")
model.eval()

seq = "ACGT" * (args["input_length"] // 4)   # your 20,480-bp sequence
x = torch.from_numpy(onehot_encode(seq)).unsqueeze(0)   # (1, L, 4)

with torch.no_grad():
    tracks = model(x)             # one (1, output_length, n_tracks) tensor per species head
    embeddings = model.encode(x)  # (1, L, model_dim), the final block's output

Tracks are arcsinh-scale signal: 498 for the human head (histone marks, TF ChIP-seq, ATAC-seq, RNA-seq) and 472 for the mouse head.

DeepLIFT/SHAP attribution

With the interpret extra, deep_lift_shap gives the same attributions as tangermeme's, but the full model fits on a 10 GB GPU (tangermeme needs ~65 GB):

from promoterai_torch.attribution import deep_lift_shap

# X: (N, 4, input_length) one-hot, channels-first
attributions = deep_lift_shap(model.to("cuda"), X, n_shuffles=20, random_state=0)

See docs/attribution.md for the mouse head, custom targets (windows, track weights, contrasts), compile=True, precision on Ampere+ GPUs, and benchmarks.

SFSWAP DeepLIFTSHAP

Numerical equivalence

This port produces near-identical scores and regulatory track predictions to the original TensorFlow/Keras implementation, matching the published AUROCs. See docs/numerical-equivalence.md for benchmark reproduction steps, per-variant concordance results, and full-track comparison scripts.

SFSWAP scatter

Training models

Fine-tuning or training from scratch using the built-in scripts requires the train extra described in Install (with an optional wandb extra for wandb.ai integration. See docs/training.md for data preprocessing, training from scratch, fine-tuning on variants, and multi-GPU usage.

Development

See CONTRIBUTING.md for setting up a local development environment and running the test suite.

Reference

Jaganathan, Ersaro, Novakovsky et al. Science (2025) Predicting expression-altering promoter mutations with deep learning. doi:10.1126/science.ads7373

He, Kundaje. Genomics x AI Blog (2026) promoterai-torch: a PyTorch port of Illumina's PromoterAI. doi:10.5281/zenodo.23038831

Original TF implementation: Illumina/PromoterAI

Citation metadata for this software is available in CITATION.cff.

Metadata

Release files for promoterai-torch 0.5.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 promoterai-torch 0.5.0
File Size Uploaded Provenance Actions
promoterai_torch-0.5.0.tar.gz 171.2 kB With provenance Details for promoterai_torch-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for promoterai-torch 0.5.0
File Interpreter ABI Platform Actions
promoterai_torch-0.5.0-py3-none-any.whl Python 3 none any Details for promoterai_torch-0.5.0-py3-none-any.whl

Total release size: 240.0 kB

Release files / promoterai_torch-0.5.0.tar.gz

Download URL promoterai_torch-0.5.0.tar.gz
Size 171.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9d68d8457ff55563c19bc6057f16e3d0855c82e24fb3b0a9f78b78d12f338277
BLAKE2b-256 checksum
How to use checksums
ef6b9d556166a377ed68c556a82a12d963200ca604924bcea896d8df432e7dc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

Release files / promoterai_torch-0.5.0-py3-none-any.whl

Download URL promoterai_torch-0.5.0-py3-none-any.whl
Size 68.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43db6626f1ad4e9a2ac774b486137ef4c5f5f3a5f2779313b21aa534215fbfba
BLAKE2b-256 checksum
How to use checksums
40ae8fbaf2a044a5a44f20910618a861718fb0fd7bbfa86540eb51a400f68334
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 10, 2026.

Transparency log

Security for promoterai-torch 0.5.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for promoterai_torch-0.5.0.tar.gz

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 Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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