Saluki
Model Introduction
Saluki is a deep learning model for predicting mammalian mRNA half-life. The model takes full-length mRNA sequences as input and jointly encodes the first codon frame and splice-site information. It uses convolutional neural networks and gated recurrent units to learn sequence features associated with mRNA stability.
Paper: The genetic and biochemical determinants of mRNA degradation rates in mammals
Model Description
The main computational architecture of Saluki is as follows:
- The input sequence length is 12,288, with 6 channels at each position;
- The first 4 channels represent the RNA nucleotide sequence;
- The 5th channel marks the first reading frame of codons within the coding region;
- The 6th channel marks splice sites;
- Multiple one-dimensional convolution and max-pooling layers are used to extract local sequence features;
- A GRU aggregates long-range contextual information;
- A fully connected layer outputs the predicted mRNA half-life score;
data0/model0anddata1/model1use a shared model architecture with independent output heads;- Training uses MSE loss, L2 regularization, and the Adam optimizer.
The default configuration is located at:
conf/params.json
The model input shape is:
(batch, 12288, 6)
The output shape of a single regression head is:
(batch, 1)
Use Cases
| Use Case | Description |
|---|---|
| mRNA half-life prediction | Predict relative mRNA stability from full-length mRNA sequences, coding-frame information, and splice-site features. |
| Official test-set evaluation | Evaluate the model on the official Saluki TFRecord test datasets using MSE, Pearson correlation, and R². |
| Dual-task training | Jointly train two output heads using data0 and data1. |
| Model compatibility validation | Verify that TensorFlow can construct and execute the Saluki model in the OneScience DTK/DCU environment. |
| Sequence feature analysis | Provide a base model for downstream gradient analysis, in silico mutagenesis, and motif analysis. |
Usage
1. OneCode
You can use the OneCode online environment for an intelligent one-click AI4S programming experience:
Try OneCode for AI4S Programming
2. Manual Installation
Hardware Requirements
- Running on DCU in the OneScience DTK environment is recommended;
- The current adaptation has been validated on BW DCU;
- Both single-device inference and training are supported;
- At least 8 GB of device memory is recommended.
Download the Model Package
Install the Hugging Face command-line tool and download the model repository:
python -m pip install -U huggingface_hub
hf download OneScience-Group/Saluki --local-dir ./Saluki
cd Saluki
Install the OneScience Base Environment
conda create -n onescience311 python=3.11 -y
conda activate onescience311
python -m pip install "onescience[bio-dcu]" \
-i http://mirrors.onescience.ai:3141/pypi/simple/ \
--trusted-host mirrors.onescience.ai
Upgrade DTK and TensorFlow
The current Saluki adaptation requires a newer DTK and TensorFlow combination than the legacy OneScience default environment.
Before running Saluki, upgrade the platform DTK toolchain to DTK 26.04, and then install the corresponding DTK TensorFlow 2.18.0 package.
DTK is provided as part of the platform compiler and runtime environment. Switch to DTK 26.04 according to the SCNet platform configuration, and then install the required TensorFlow package and additional Saluki dependencies with:
python -m pip install --no-deps -r requirements.txt
Weights and Data Preparation
The official dataset and pretrained weights originate from:
- Dataset record: Zenodo 6326409
- Archive:
datasets.zip - Official MD5:
45f0d6bd3857eb19e04eb5be2bb47451
The corresponding dataset and weight directory structure in the Hugging Face model package is:
conf/data/f0_c0/
├── data0/
│ ├── statistics.json
│ └── tfrecords/
│ ├── train-*.tfr
│ ├── valid-*.tfr
│ └── test-*.tfr
└── data1/
├── statistics.json
└── tfrecords/
├── train-*.tfr
├── valid-*.tfr
└── test-*.tfr
weight/f0_c0/
├── model0_best.h5
└── model1_best.h5
Quick Inference
model0 / data0
Purpose: Use output head 0 and the official model0 weights to generate one mRNA half-life prediction score for each sample in the data0 test set.
The score represents the relative mRNA stability predicted from nucleotide sequence, coding-frame information, and splice-site features. In general, a higher score corresponds to a longer predicted half-life.
The value is a regression target learned according to the official data0 target preprocessing procedure and should not be interpreted directly as hours.
The output also includes the true target values, predicted values, MSE, Pearson correlation coefficient, and R². Lower MSE and higher Pearson correlation and R² indicate better agreement between predictions and experimental targets.
python scripts/predict.py \
conf/data/f0_c0/data0 \
weight/f0_c0/model0_best.h5 \
--head 0 \
--out-dir output/f0_c0/model0
model1 / data1
Purpose: Use output head 1 and the official model1 weights to generate one mRNA half-life prediction score for each sample in the data1 test set.
The score represents relative mRNA stability under the data1 target definition. In general, a higher score corresponds to a longer predicted half-life.
Because data0 and data1 use independent output heads and target systems, their raw prediction scores should not be directly compared without considering the corresponding dataset definitions.
The output includes true targets, predictions, MSE, Pearson correlation coefficient, and R², which measure prediction error, ranking consistency, and the proportion of target variance explained by the model.
python scripts/predict.py \
conf/data/f0_c0/data1 \
weight/f0_c0/model1_best.h5 \
--head 1 \
--out-dir output/f0_c0/model1
Each output directory contains:
predictions.h5
metrics.json
predictions.h5 stores the prediction values and target values.
metrics.json stores:
- Number of samples;
- Output shape;
- Data type;
- NaN/Inf validation results;
- MSE;
- Pearson correlation coefficient;
- R².
Full-Dataset Training
The default configuration contains two output heads. Therefore, both data0 and data1 should be provided during training.
Purpose: Jointly read the training and validation TFRecord datasets from data0 and data1, optimize the shared one-dimensional convolution and GRU feature-extraction backbone together with the two independent regression heads, and learn mappings from the 6-channel mRNA representation to the half-life target scores of the two datasets.
During training, the validation loss is used to select and save the best model0 and model1 weights as well as recovery checkpoints.
These checkpoints can be used for subsequent inference, continued training, and comparison across training epochs.
python scripts/train.py \
conf/data/f0_c0/data0 \
conf/data/f0_c0/data1 \
--params conf/params.json \
--out-dir output/f0_c0/train
The training entry point performs:
- Real TFRecord dataset loading;
- Forward propagation;
- MSE and L2 loss computation;
- Backward propagation;
- Adam parameter updates;
- Validation;
- Checkpoint saving.
A single epoch should only be used to validate the training pipeline and should not be expected to reproduce the final accuracy reported in the paper.
To validate one complete training epoch, copy:
conf/params.json
to a new relative configuration file and set:
train_epochs_min = 1
train_epochs_max = 1
patience = 0
Do not overwrite the default parameter file so that the standard training configuration remains available.
Custom Data
Custom datasets must be converted into the compressed TFRecord format used by Saluki.
Each sample must provide:
- RNA nucleotide sequence;
- Actual sequence length;
- Codon first-reading-frame track;
- Splice-site track;
- Regression target.
Each dataset directory must contain:
statistics.json
tfrecords/
New datasets can follow the relative directory organization used by:
conf/data/f0_c0/
OneScience Official Resources
| Platform | OneScience Main Repository | Skills Repository |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
Citation and License
- Saluki paper: Agarwal and Kelley, Genome Biology, 2022
- Saluki paper reproduction code: https://github.com/vagarwal87/saluki_paper
- Basenji official implementation: https://github.com/calico/basenji
- Official dataset: Zenodo 6326409
- The Basenji/Saluki code included in this model package is provided under the Apache License 2.0.
- Model weights, datasets, source code, and third-party resources remain subject to their respective original licenses, copyright notices, and terms of use.
中文说明
模型简介
Saluki 是用于预测哺乳动物 mRNA 半衰期的深度学习模型。它以全长 mRNA 序列作为输入,联合编码密码子第一阅读框和剪接位点信息,并利用卷积神经网络和门控循环单元学习与 mRNA 稳定性相关的序列特征。
模型描述
Saluki 的主要计算架构如下。
- 输入序列长度为 12,288,每个位置有 6 个通道。
- 前 4 个通道表示 RNA 核苷酸序列。
- 第 5 个通道标记编码区内的密码子第一阅读框。
- 第 6 个通道标记剪接位点。
- 使用多层一维卷积和最大池化提取局部序列特征。
- 使用 GRU 聚合长距离上下文信息。
- 使用全连接层输出 mRNA 半衰期预测分数。
data0/model0和data1/model1共用模型架构,使用独立输出头。- 训练采用 MSE 损失、L2 正则化和 Adam 优化器。
默认配置位于以下位置。
conf/params.json
模型输入形状如下。
(batch, 12288, 6)
单个回归头的输出形状如下。
(batch, 1)
使用场景
| 使用场景 | 说明 |
|---|---|
| mRNA 半衰期预测 | 根据全长 mRNA 序列、编码框信息和剪接位点特征预测相对 mRNA 稳定性。 |
| 官方测试集评估 | 在官方 Saluki TFRecord 测试数据集上使用 MSE、Pearson 相关性及 R² 评估模型。 |
| 双任务训练 | 使用 data0 和 data1 联合训练两个输出头。 |
| 模型兼容性验证 | 验证 TensorFlow 能否在 OneScience DTK/DCU 环境中构建和运行 Saluki 模型。 |
| 序列特征分析 | 为下游梯度分析、计算机模拟突变和基序分析提供基础模型。 |
使用方法
1. OneCode
可以通过 OneCode 在线环境体验智能一键 AI4S 编程。
2. 手动安装
硬件要求
- 建议在 OneScience DTK 环境下使用 DCU 运行。
- 当前适配已在 BW DCU 上验证。
- 支持单设备推理(inference)和训练。
- 建议具备至少 8 GB 设备内存。
下载模型包
安装 Hugging Face 命令行工具并下载模型仓库。
python -m pip install -U huggingface_hub
hf download OneScience-Group/Saluki --local-dir ./Saluki
cd Saluki
安装 OneScience 基础环境
conda create -n onescience311 python=3.11 -y
conda activate onescience311
python -m pip install "onescience[bio-dcu]" \
-i http://mirrors.onescience.ai:3141/pypi/simple/ \
--trusted-host mirrors.onescience.ai
升级 DTK 和 TensorFlow
当前 Saluki 适配所需的 DTK 和 TensorFlow 组合比 OneScience 原有默认环境中的版本更新。
运行 Saluki 前,将平台 DTK 工具链升级到 DTK 26.04,再安装对应的 DTK TensorFlow 2.18.0 软件包。
DTK 随平台编译器和运行环境提供。按 SCNet 平台配置切换至 DTK 26.04,再用以下命令安装所需的 TensorFlow 软件包及 Saluki 附加依赖。
python -m pip install --no-deps -r requirements.txt
权重与数据准备
官方数据集和预训练权重来自以下来源。
- 数据集记录 Zenodo 6326409
- 压缩包为
datasets.zip - 官方 MD5 为
45f0d6bd3857eb19e04eb5be2bb47451
Hugging Face 模型包中相应的数据集和权重目录结构如下。
conf/data/f0_c0/
├── data0/
│ ├── statistics.json
│ └── tfrecords/
│ ├── train-*.tfr
│ ├── valid-*.tfr
│ └── test-*.tfr
└── data1/
├── statistics.json
└── tfrecords/
├── train-*.tfr
├── valid-*.tfr
└── test-*.tfr
weight/f0_c0/
├── model0_best.h5
└── model1_best.h5
快速推理
model0 / data0
用途 使用输出头 0 和官方 model0 权重,为 data0 测试集的每个样本生成一个 mRNA 半衰期预测分数。
该分数表示根据核苷酸序列、编码框信息及剪接位点特征预测的相对 mRNA 稳定性。分数越高通常表示预测半衰期越长。
此值是按官方 data0 目标预处理流程学习得到的回归目标,不应直接解读为小时。
输出还包括真实目标值、预测值、MSE、Pearson 相关系数和 R²。MSE 越低,Pearson 相关系数和 R² 越高,表示预测与实验目标越一致。
python scripts/predict.py \
conf/data/f0_c0/data0 \
weight/f0_c0/model0_best.h5 \
--head 0 \
--out-dir output/f0_c0/model0
model1 / data1
用途 使用输出头 1 和官方 model1 权重,为 data1 测试集的每个样本生成一个 mRNA 半衰期预测分数。
该分数表示 data1 目标定义下的相对 mRNA 稳定性。分数越高通常表示预测半衰期越长。
由于 data0 和 data1 使用独立的输出头和目标体系,不应在忽略相应数据集定义的情况下直接比较原始预测分数。
输出包括真实目标、预测值、MSE、Pearson 相关系数和 R²,用于衡量预测误差、排序一致性以及模型所解释的目标方差比例。
python scripts/predict.py \
conf/data/f0_c0/data1 \
weight/f0_c0/model1_best.h5 \
--head 1 \
--out-dir output/f0_c0/model1
每个输出目录包含以下文件。
predictions.h5
metrics.json
predictions.h5 保存预测值及目标值。
metrics.json 保存以下内容。
- 样本数
- 输出形状
- 数据类型
- NaN/Inf 验证结果
- MSE
- Pearson 相关系数
- R²。
全量数据集训练
默认配置包含两个输出头,因此训练时应同时提供 data0 和 data1。
用途 联合读取 data0 和 data1 的训练及验证 TFRecord 数据集,优化共享的一维卷积与 GRU 特征提取主干及两个独立回归头,学习 6 通道 mRNA 表征到两个数据集半衰期目标分数的映射。
训练期间,使用验证损失选取并保存最佳 model0 和 model1 权重,以及用于恢复的模型权重(检查点)(checkpoint)。
这些模型权重(检查点)可用于后续推理、继续训练和跨训练轮次比较。
python scripts/train.py \
conf/data/f0_c0/data0 \
conf/data/f0_c0/data1 \
--params conf/params.json \
--out-dir output/f0_c0/train
训练入口执行以下操作。
- 加载真实 TFRecord 数据集。
- 前向传播。
- 计算 MSE 和 L2 损失。
- 反向传播。
- 使用 Adam 更新参数。
- 验证。
- 保存模型权重(检查点)。
单轮训练仅用于验证训练管线,不应预期复现论文报告的最终精度。
要验证一个完整训练轮次,请复制以下文件。
conf/params.json
将其复制为新的相对路径配置文件,并设置以下内容。
train_epochs_min = 1
train_epochs_max = 1
patience = 0
请勿覆盖默认参数文件,以保留标准训练配置。
自定义数据
自定义数据集必须转换成 Saluki 使用的压缩 TFRecord 格式。
每个样本必须提供以下内容。
- RNA 核苷酸序列
- 实际序列长度
- 密码子第一阅读框轨道
- 剪接位点轨道
- 回归目标
每个数据集目录必须包含以下内容。
statistics.json
tfrecords/
新数据集可以沿用下列配置使用的相对目录组织方式。
conf/data/f0_c0/
OneScience 官方资源
| 平台 | OneScience 主仓库 | Skills 仓库 |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
引用与许可证
- Saluki 论文 Agarwal and Kelley, Genome Biology, 2022
- Saluki 论文复现代码 https://github.com/vagarwal87/saluki_paper
- Basenji 官方实现 https://github.com/calico/basenji
- 官方数据集 Zenodo 6326409
- 本模型包所附的 Basenji/Saluki 代码采用 Apache License 2.0 授权。
- 模型权重、数据集、源代码及第三方资源仍受各自原始许可证、版权声明和使用条款约束。
- Downloads last month
- 27