| Field | Value |
|---|---|
| Model | multimolecule/maxentscan-score3 |
| Task | 3' splice-site (acceptor) maximum-entropy scoring |
| Source | HuggingFace |
| Base | Maximum-entropy model (Yeo & Burge, 2004) — no trainable weights |
| Window | 23 nucleotides |
| Consensus | AG at positions 18-19 |
| Output | Single log2 maximum-entropy score per 23-mer |
| Dependency | Version |
|---|---|
| Python | 3.11 |
| torch | 2.9.0+cpu |
| torch-npu | 2.9.0.post1 |
| CANN | 8.5.1 |
| NPU | Ascend 910_9362 |
The MaxEntScan model is a deterministic lookup-table model with no neural network weights. The original multimolecule framework depends on transformers APIs incompatible with the Ascend NPU runtime. This adaptation:
modeling_maxentscan.pyscore3_me2x3acc.txt) from the published Yeo & Burge (2004) parameterstorch_npu with zero training/inference API dependencies on transformers# Single sequence inference
python inference.py --model-path /tmp/inspect_maxentscan --seq AUGCACAGCUCAGCACUGCUCUG --device npu
# Full verification suite
python verify.py --device npu# Single sequence inference
python inference.py --model-path /tmp/inspect_maxentscan --seq AUGCACAGCUCAGCACUGCUCUG --device npu
# Full verification suite
python verify.py --device npu======================================================================
MaxEntScan-score3 Ascend NPU Inference
======================================================================
torch : 2.9.0+cpu
torch_npu : 2.9.0.post1+gitee7ba04
NPU count : 2
NPU name : Ascend 910_9362
Model path : /tmp/inspect_maxentscan
Mode : score3 (3' splice site acceptor)
Window : 23 nt
======================================================================
Inference:
----------------------------------------------------------------------
Sequence : AUGCACAGCUCAGCACUGCUCUG
Input shape : [1, 23]
Score : -37.1781
Elapsed : 2.52 ms
Status : SUCCESS
----------------------------------------------------------------------| # | Sequence | Category | CPU Score | NPU Score | Diff | Status |
|---|---|---|---|---|---|---|
| 1 | AUGCACAGCUCAGCACUGCUCUG | strong | -37.1781 | -37.1781 | 0.000000 | PASS |
| 2 | CAGAAUGAAUGGAGACGUGCUGC | strong | -26.0646 | -26.0646 | 0.000000 | PASS |
| 3 | GGCUGAGUGAGAGACAUGCGCUC | strong | -39.0624 | -39.0624 | 0.000000 | PASS |
| 4 | UUUUUAGUUGUUGUGCUUGCUGA | weak | -11.0786 | -11.0786 | 0.000000 | PASS |
| 5 | AACCAAGAAAUGCUUGGCUCUAC | weak | -18.5432 | -18.5432 | 0.000002 | PASS |
Independent numpy reference — A standalone numpy implementation (no torch dependency) was written following the original Yeo & Burge (2004) algorithm:
cons1[b0] * cons2[b1] / (bgd[b0] * bgd[b1])sc0*sc1*sc2*sc3*sc4 / (sc5*sc6*sc7*sc8)log2(consensus * decomposition)Cross-validation — All 5 test sequences were scored by:
Score table validation — The score3_me2x3acc.txt from the multimolecule package was verified against the original Burge lab parameters.
| Comparison | Max Absolute Diff | Status |
|---|---|---|
| numpy vs torch (CPU) | 0.000002 | PASS |
| torch (CPU) vs torch (NPU) | 0.000002 | PASS |
| numpy vs torch (NPU) | 0.000002 | PASS |
All scores agree to within float32 precision (tolerance < 1e-3).
| Device | Avg Inference Time | Notes |
|---|---|---|
| CPU | 0.83 ms | Single sequence, no batching |
| NPU | 2.52 ms | Includes NPU-CPU synchronization overhead |
Note: The NPU overhead for single-sequence inference (~2.5 ms) is dominated by kernel launch and synchronization. For batched inference (batch_size ≥ 32), the NPU throughput advantage over CPU is expected to be significant.
The score3 model scores a 23-nucleotide window for 3' splice-site acceptor strength:
23-mer: (intron) X*20 | XXX (exon)
↑AG↑Consensus score — The AG dinucleotide at positions 18-19 is scored against background frequencies:
consensus_ratio = cons1[b18] * cons2[b19] / (bgd[b18] * bgd[b19])Rest score — The remaining 21 positions (0-17, 20-22) are scored by nine overlapping submodels:
decomposition = sc0*sc1*sc2*sc3*sc4 / (sc5*sc6*sc7*sc8)Final score:
score = log2(consensus_ratio * rest_score)| File | Description |
|---|---|
inference.py | Standalone NPU inference script |
verify.py | Verification suite (CPU vs NPU comparison) |
assets/ | Screenshots and documentation assets |