RNA splice site usage prediction model adapted for Ascend NPU.
DeltaSplice predicts splice site usage probabilities for human RNA sequences using a deep dilated CNN ensemble. The model takes one-hot encoded nucleotide sequences as input and outputs per-position probabilities for three classes:
| Index | Class | Description |
|---|---|---|
| 0 | no_splice | Position is not a splice site |
| 1 | acceptor | Position is a splice acceptor site |
| 2 | donor | Position is a splice donor site |
(seq_len, 4)(seq_len, 3)pip install torch numpyFor Ascend NPU, ensure CANN toolkit and torch_npu are installed:
pip install torch_npu# From FASTA file
python inference.py input.fasta -o results.npz
# From raw sequence
python inference.py --sequence ACGTACGTACGTACGTACGT -o results.csv
# Specify device
python inference.py input.fasta -o results.csv --device npuimport numpy as np
import torch
from inference import load_model, encode_sequence, predict_sequence
# Load model
model, device = load_model()
# Encode sequence
seq = "ACGTACGTACGT" * 100
one_hot = encode_sequence(seq)
# Run prediction
probs = predict_sequence(model, one_hot, device)
# probs shape: (len(seq), 3) — per-position [no_splice, acceptor, donor] probabilities--format npz)Compressed numpy archive containing:
{name}_probabilities: float32 array (seq_len, 3){name}_acceptor_max: scalar — max acceptor probability in sequence{name}_donor_max: scalar — max donor probability in sequence{name}_splice_probability: scalar — mean max(acceptor, donor) across positionssequence,position,no_splice,acceptor,donor
seq1,1,0.998,0.001,0.001
seq1,2,0.995,0.003,0.002
...The model is implemented in pure PyTorch (deltasplice_model.py) without dependency on the multimolecule or transformers packages. Key components:
DeltaSpliceEmbedding — one-hot encoding + context paddingDeltaSpliceEncoder — 24-layer dilated CNN + BatchNormDeltaSpliceLayer — individual conv block (BN → ReLU → Conv1d → BN → ReLU → Dropout → Conv1d + residual)DeltaSpliceReferenceProjection — projects target/reference features for delta predictionDeltaSplicePredictionHead — 64→256→3 softmax headDeltaSpliceModule — single ensemble member (encoder + 3 heads)DeltaSpliceModel — full ensemble model (5 members + embedding)State dict keys match the original multimolecule checkpoint format exactly (1815 keys, strict loading verified).
| Stage | Description | Status |
|---|---|---|
| Stage A | Dummy forward pass (random weights, seq_len=30000) | ✅ Passed |
| Stage B | Real weight forward pass (pretrained, seq_len=30000) | ✅ Passed |
| Inference | End-to-end inference with inference.py | ✅ Passed |
Environment:
If using this model, please cite the original DeltaSplice paper:
@article{delong2024deltasplice,
title={DeltaSplice: A unified deep learning model for RNA splicing},
...
}This adapted model follows the same license as the original multimolecule/deltasplice-human model.