File size: 2,312 Bytes
0ed1e82
 
 
 
 
 
 
 
 
 
 
 
 
360d0d6
0ed1e82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
tags:
- biology
- rna
- utr
- sequence-generation
library_name: transformers
---

# cUTRGen

cUTRGen is a CDS-conditioned encoder–decoder model for UTR sequence generation, functional prediction and design. This repository provides pretrained and reinforcement-learning-optimized generators for 5′ and 3′ UTRs, together with the paired policies for full-length mRNA design with a fixed CDS.

Code and usage examples: [HIM-AIM/cUTRGen](https://github.com/HIM-AIM/cUTRGen).

## Checkpoints

| Directory | Model |
|---|---|
| `c5UTRGen-pretrained/` | Pretrained 5′ UTR generator |
| `c5UTRGen-RL/` | RL-optimized 5′ UTR generator |
| `c3UTRGen-pretrained/` | Pretrained 3′ UTR generator |
| `c3UTRGen-RL/` | RL-optimized 3′ UTR generator |
| `full-length-RL/policy_5utr/` | 5′ UTR policy from joint optimization |
| `full-length-RL/policy_3utr/` | 3′ UTR policy from joint optimization |

Each checkpoint includes `config.json` and `model.safetensors`. Keep `generation_config.json` with its checkpoint when supplied. Use the custom tokenization and generation code in the corresponding code module.

## Download

From the cloned code repository, download the weights into the adjacent weights directory:

```python
from huggingface_hub import snapshot_download

snapshot_download(
    repo_id="ZhweCheng/cUTRGen",
    local_dir="../cUTRGen_weights",
)
```

To download one model only, add `allow_patterns=["c5UTRGen-pretrained/*"]`, replacing the directory name as needed. For joint generation, download both `full-length-RL/policy_5utr/*` and `full-length-RL/policy_3utr/*`.

## Generate UTRs

Install the dependencies specified by the relevant module. From the code repository root:

```sh
python c5UTRGen/generate.py --model ../cUTRGen_weights/c5UTRGen-pretrained --cds ATGGCTGAAGGTTTCAAACCGGACTAA --count 3
python c3UTRGen/generate.py --model ../cUTRGen_weights/c3UTRGen-pretrained --cds ATGGCTGAAGGTTTCAAACCGGACTAA --count 3
python full-length/generate.py --model ../cUTRGen_weights/full-length-RL --cds ATGGCTGAAGGTTTCAAACCGGACTAA --count 4
```

Use the corresponding `c5UTRGen-RL` or `c3UTRGen-RL` directory for single-end RL-generated UTRs. Full-length generation requires both jointly optimized policies; `--count 4` samples four candidates per end and returns sixteen combinations.