g
gcw_coj3XaOd/deltasplice-human
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

DeltaSplice-Human

RNA splice site usage prediction model adapted for Ascend NPU.

  • Source model: multimolecule/deltasplice-human
  • Architecture: 24-layer dilated Convolutional Neural Network (ensemble of 5)
  • Task: Per-position splice site probability prediction (no_splice / acceptor / donor)
  • Target platform: Ascend NPU (CANN 8.5.1, torch_npu)

Model Description

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:

IndexClassDescription
0no_splicePosition is not a splice site
1acceptorPosition is a splice acceptor site
2donorPosition is a splice donor site

Architecture Details

  • Input: One-hot encoded RNA/DNA (A, C, G, T), shape (seq_len, 4)
  • Context window: 30,000 nt flanking context on each side
  • Encoder: 24 dilated CNN layers with kernel sizes 11→85 and dilations 1→32
  • Hidden dimension: 64
  • Ensemble: 5 independently trained seed models averaged at inference
  • Prediction heads: Each ensemble member has site, usage, and delta prediction heads (64→256→3 with ReLU)
  • Output: Softmax-normalized probabilities per position, shape (seq_len, 3)

Parameters

  • Total parameters: ~40.4M
  • Model weights: ~154.8 MB (pytorch_model.bin)
  • Dropout: 0.3
  • Batch normalization: eps=1e-5, momentum=0.1

Installation

pip install torch numpy

For Ascend NPU, ensure CANN toolkit and torch_npu are installed:

pip install torch_npu

Usage

Command-line inference

# 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 npu

Python API

import 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

Output Format

NPZ format (--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 positions

CSV format (default)

sequence,position,no_splice,acceptor,donor
seq1,1,0.998,0.001,0.001
seq1,2,0.995,0.003,0.002
...

Model Implementation

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 padding
  • DeltaSpliceEncoder — 24-layer dilated CNN + BatchNorm
  • DeltaSpliceLayer — individual conv block (BN → ReLU → Conv1d → BN → ReLU → Dropout → Conv1d + residual)
  • DeltaSpliceReferenceProjection — projects target/reference features for delta prediction
  • DeltaSplicePredictionHead — 64→256→3 softmax head
  • DeltaSpliceModule — 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).


NPU Validation

StageDescriptionStatus
Stage ADummy forward pass (random weights, seq_len=30000)✅ Passed
Stage BReal weight forward pass (pretrained, seq_len=30000)✅ Passed
InferenceEnd-to-end inference with inference.py✅ Passed

Environment:

  • Platform: Ascend 910B
  • CANN: 8.5.1
  • torch_npu: 2.1.0
  • PyTorch: 2.1.0
  • Python: 3.11

Citation

If using this model, please cite the original DeltaSplice paper:

@article{delong2024deltasplice,
  title={DeltaSplice: A unified deep learning model for RNA splicing},
  ...
}

License

This adapted model follows the same license as the original multimolecule/deltasplice-human model.