File size: 9,882 Bytes
4d43445
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
---
frameworks:
- TensorFlow
language:
- en
license: apache-2.0
tags:
- OneScience
- bioscience
- RNA
- mRNA-half-life-prediction
- Saluki
- DCU
tasks:
- regression

---

<p align="center">
  <strong>
    <span style="font-size: 30px;">Saluki</span>
  </strong>
</p>

# 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](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-022-02811-x)

# 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/model0` and `data1/model1` use a shared model architecture with independent output heads;
- Training uses MSE loss, L2 regularization, and the Adam optimizer.

The default configuration is located at:

```text
conf/params.json
```

The model input shape is:

```text
(batch, 12288, 6)
```

The output shape of a single regression head is:

```text
(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](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home)

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

```bash
python -m pip install -U huggingface_hub

hf download OneScience-Group/Saluki --local-dir ./Saluki
cd Saluki
```

### Install the OneScience Base Environment

```bash
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:

```bash
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](https://zenodo.org/records/6326409)
- Archive: `datasets.zip`
- Official MD5: `45f0d6bd3857eb19e04eb5be2bb47451`

The corresponding dataset and weight directory structure in the Hugging Face model package is:

```text
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.

```bash
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.

```bash
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:

```text
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.

```bash
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:

```text
conf/params.json
```

to a new relative configuration file and set:

```text
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:

```text
statistics.json
tfrecords/
```

New datasets can follow the relative directory organization used by:

```text
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](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-022-02811-x)
- Saluki paper reproduction code: https://github.com/vagarwal87/saluki_paper
- Basenji official implementation: https://github.com/calico/basenji
- Official dataset: [Zenodo 6326409](https://zenodo.org/records/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.