Metadata-Version: 2.5
Name: altar-enformer
Version: 0.3.0
Summary: Enformer model binding for large-scale Altar variant scoring
Project-URL: Documentation, https://kundajelab.github.io/altar/
Author: Riya Sinha
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: altar<0.4,>=0.3.0
Provides-Extra: prepare
Requires-Dist: kagglehub<2,>=1; extra == 'prepare'
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.24; extra == 'test'
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# Altar Enformer binding

`altar-enformer` is the lightweight control-plane binding for high-throughput Enformer variant scoring. It
registers `ENFORMER` in Altar's canonical model-plugin group and has no TensorFlow dependency.

One Altar model instance contains immutable SavedModel and target-metadata resources plus a fixed selection
of Enformer's 5,313 human output tracks. A job is partitioned upstream into deterministic scoring batches;
the binding emits one independently retryable container task per batch. The runtime loads the model once per
task, microbatches reference/alternate sequence pairs, and writes:

- one primary row per variant, containing the track with the largest absolute SAD; and
- a `track_effects` detail row for every selected `(variant, track)` pair, preserving reference and alternate
  activity, SAD, and SADR.

SAD and SADR follow the definitions in the [Basenji variant scorer linked by DeepMind's Enformer
release](https://github.com/calico/basenji/blob/738321c85f8925ae6ac318a6cd4901a42ea6bc3f/bin/basenji_sad.py):
`SAD = sum(alt) - sum(ref)` and `SADR = log2(sum(alt) + 1) - log2(sum(ref) + 1)` across the model's 896 output
bins. DeepMind's simpler [`EnformerScoreVariantsRaw`
notebook](https://github.com/google-deepmind/deepmind-research/blob/master/enformer/enformer-usage.ipynb) divides SAD
by the constant 896 by taking means; that does not change per-variant track ranking. `SAR` is a different Basenji
statistic—the sum of per-bin log ratios—and is intentionally not emitted under the wrong name. Track selection,
weight bytes, metadata bytes, runtime image, and hg38 reference identity are all durable inputs.

Scoring semantics 2.0 selects the primary track by absolute SAD, the main published Enformer variant-effect
score, and renames the former `sar`/`top_track_sar` fields to `sadr`/`top_track_sadr`. Existing primary scores
must be regenerated. Existing complete `track_effects` rows are sufficient for a later storage-layer migration
because their numeric `sar` values already contained SADR; Altar itself does not mutate deployed result stores.

The corresponding TensorFlow 2.13 / Python 3.10 executor lives under `runtimes/enformer` with its own lockfile
and immutable image lifecycle.
