LegNet¶
The altar-legnet binding runs human LegNet checkpoints as scalable Altar model jobs. It is intended for
short-regulatory-sequence and MPRA activity effects, complementary to genomic track models such as Enformer,
Borzoi, ChromBPNet, and Cherimoya.
Scientific contract¶
Each hg38 SNV is placed at index 100 of a 200 bp genomic context (100 upstream bases, the variant, and 99
downstream bases). The runtime reconstructs the published training construct by placing the 5′
AGGACCGGATCAACT adapter before that context and the 3′ CATTGCGTGAACCGA adapter after it, producing the
230 bp tensor expected by the human LegNet architecture. The primary result contains:
| Field | Meaning |
|---|---|
ref_activity |
predicted activity of the reference construct |
alt_activity |
predicted activity of the alternate construct |
activity_delta |
signed alt_activity - ref_activity |
average_reverse=true averages forward and reverse-complement predictions, matching the upstream FASTA and
one-hot prediction helpers when a checkpoint was trained with reverse augmentation. It is part of scientific
configuration and therefore changes cache identity.
Resources and cell types¶
The checkpoint and its matching training JSON are separate ResourceReference values with mandatory SHA-256
digests. The runtime accepts compatible K562, HepG2, WTC11, or custom checkpoints; the binding does not hardcode
a model host. legnet-resources fetch-official prepares the WTC11 example committed in the official
autosome-ru/human_legnet repository. legnet-resources package validates and packages other resource pairs.
Chorus's LegNet adapter was inspected for its three-cell resource layout, the 200 bp genomic window, and MPRA flank behavior. Altar independently implements the official raw-PyTorch architecture and reconstructs the published training oligo; it does not import Chorus, use Chorus normalization CDFs, or inherit Chorus's interactive execution model. This construct intentionally differs from the official repository's separate ASB helper, which uses a bare 231 bp genomic window and shift ensembling.
The runtime uses the validated adapter orientations from the published training oligo when computing
ref_activity, alt_activity, and activity_delta.
Scale and current limits¶
LegNet is CPU-friendly, so the portable plan requests a 4 GB CPU worker rather than forcing GPU placement. Altar's outer scoring batches remain independently retryable, while the runtime processes each file in bounded 1,024-variant inference batches and streams rows directly to TSV.
The current binding supports SNVs only. The official human LegNet allele-specific evaluation path is SNV-based, so
Altar doesn't choose unvalidated insertion/deletion anchoring semantics. The manifest declares SNV-only
variant eligibility: batch preparation filters out and reports indels
and multi-nucleotide variants, and the runtime still rejects them in a hand-staged batch. The raw
|activity_delta| >= 0.5 prioritization default is a screening rule, not a calibrated probability. Cohort- or
assay-specific percentile calibration belongs in a separately versioned downstream stage.