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
|
| 13 |
+
- 1M<n<10M
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# semRfam
|
| 17 |
+
|
| 18 |
+
The tokenizable multimodal RNA dataset used to train
|
| 19 |
+
[**yakRNA Design**](https://github.com/YousufAKhan/yakRNA), a semantic
|
| 20 |
+
multimodal RNA composer. Every record pairs an RNA sequence with three
|
| 21 |
+
companion modalities drawn from its Rfam family, which is what lets a model be
|
| 22 |
+
conditioned on structure, consensus, or function at generation time.
|
| 23 |
+
|
| 24 |
+
| | |
|
| 25 |
+
|---|---|
|
| 26 |
+
| Source | [Rfam 15.0](https://rfam.org) (released 2024-09) |
|
| 27 |
+
| Records | 3,978,586 |
|
| 28 |
+
| Families | 4,028 |
|
| 29 |
+
| Format | single HDF5 file, one row per sequence |
|
| 30 |
+
| Size | ~2.2 GB |
|
| 31 |
+
| License | CC0 1.0 (inherited from Rfam) |
|
| 32 |
+
|
| 33 |
+
## Files
|
| 34 |
+
|
| 35 |
+
| File | Size | Contents |
|
| 36 |
+
|---|---|---|
|
| 37 |
+
| `semRfam.h5` | ~2.2 GB | the records: `sequence`, `ss`, `consensus`, `go_terms`, `rfam_id`, `sequence_id`, each a 1-D array of UTF-8 byte strings |
|
| 38 |
+
| `family_lookup.json` | ~49 MB | Rfam family → list of row indices, used to build family-diverse batches |
|
| 39 |
+
| `family_splits.json` | ~35 MB | the exact family-level train/val/test split used for the released model |
|
| 40 |
+
|
| 41 |
+
## The four modalities
|
| 42 |
+
|
| 43 |
+
For row *i*, the four fields are aligned position-by-position (GO terms being
|
| 44 |
+
per-family rather than per-position):
|
| 45 |
+
|
| 46 |
+
- **`sequence`** — the RNA sequence with alignment gaps removed, in `A/C/G/U/N`.
|
| 47 |
+
- **`ss`** — the family's WUSS `#=GC SS_cons` consensus structure, projected
|
| 48 |
+
onto the positions this sequence actually occupies.
|
| 49 |
+
- **`consensus`** — the family's `#=GC RF` consensus line, projected the same
|
| 50 |
+
way. Case is meaningful (upper = highly conserved).
|
| 51 |
+
- **`go_terms`** — comma-separated GO terms attached to the family by Rfam's
|
| 52 |
+
`rfam2go` mapping; empty for families with no GO annotation.
|
| 53 |
+
|
| 54 |
+
Because `ss` and `consensus` are projections of the family consensus onto each
|
| 55 |
+
sequence, `len(sequence) == len(ss) == len(consensus)` for every row.
|
| 56 |
+
|
| 57 |
+
## Splits
|
| 58 |
+
|
| 59 |
+
Splits are by **family**, so no Rfam family appears in more than one split:
|
| 60 |
+
|
| 61 |
+
| Split | Families | Sequences |
|
| 62 |
+
|---|---|---|
|
| 63 |
+
| train | 3,625 | 3,846,938 |
|
| 64 |
+
| val | 201 | 57,920 |
|
| 65 |
+
| test | 202 | 73,728 |
|
| 66 |
+
|
| 67 |
+
Note: the released yakRNA checkpoint was trained with
|
| 68 |
+
`data.use_all_data_for_training: true`, meaning the val/test families were also
|
| 69 |
+
included in training; the split is published so that held-out evaluation is
|
| 70 |
+
reproducible for anyone who wants it. `family_splits.json` also records the
|
| 71 |
+
split seed and the data-processing config.
|
| 72 |
+
|
| 73 |
+
## Usage
|
| 74 |
+
|
| 75 |
+
```bash
|
| 76 |
+
git clone https://github.com/YousufAKhan/yakRNA.git && cd yakRNA
|
| 77 |
+
pip install -r requirements-training.txt
|
| 78 |
+
python data_processing/download_rfam.py --stage prebuilt # downloads this dataset
|
| 79 |
+
python rna_gen/rna_gen_training.py --config configs/train_single_gpu.yaml
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
That places the files where the training configs expect them
|
| 83 |
+
(`training_data/processed/`). See
|
| 84 |
+
[TRAINING.md](https://github.com/YousufAKhan/yakRNA/blob/main/TRAINING.md) for
|
| 85 |
+
the objective, the config reference, and how to fine-tune from the released
|
| 86 |
+
checkpoint.
|
| 87 |
+
|
| 88 |
+
Reading it directly:
|
| 89 |
+
|
| 90 |
+
```python
|
| 91 |
+
import h5py
|
| 92 |
+
from huggingface_hub import hf_hub_download
|
| 93 |
+
|
| 94 |
+
path = hf_hub_download("MasterYster/semRfam", "semRfam.h5", repo_type="dataset")
|
| 95 |
+
with h5py.File(path) as f:
|
| 96 |
+
print(f["rfam_id"][0].decode(), f["sequence"][0].decode())
|
| 97 |
+
print(f["ss"][0].decode())
|
| 98 |
+
print(f["consensus"][0].decode())
|
| 99 |
+
print(f["go_terms"][0].decode())
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
## How it was built
|
| 103 |
+
|
| 104 |
+
1. Rfam 15.0 full-region sequences, per family.
|
| 105 |
+
2. Each family realigned to its covariance model with Infernal 1.1.4
|
| 106 |
+
`cmalign --outformat Pfam`.
|
| 107 |
+
3. Alignment gaps stripped from each sequence, with `SS_cons` and `RF` sliced to
|
| 108 |
+
the retained positions so all three stay in register.
|
| 109 |
+
4. GO terms joined per family from `rfam2go`.
|
| 110 |
+
5. Written to HDF5, one row per sequence.
|
| 111 |
+
|
| 112 |
+
The pipeline is in the yakRNA repository
|
| 113 |
+
(`data_processing/download_rfam.py --stage full-all` followed by
|
| 114 |
+
`data_processing/rfam_data_preprocessing.py --stage all`). Note that rerunning
|
| 115 |
+
it today yields a *similar* but not identical dataset: Rfam full-region
|
| 116 |
+
membership changes between releases and search runs. This dataset is the
|
| 117 |
+
snapshot the released model was actually trained on.
|
| 118 |
+
|
| 119 |
+
## Citation
|
| 120 |
+
|
| 121 |
+
```bibtex
|
| 122 |
+
@software{yakrna2026,
|
| 123 |
+
author = {Khan, Yousuf},
|
| 124 |
+
title = {yakRNA Design: A semantic multimodal RNA composer},
|
| 125 |
+
year = {2026},
|
| 126 |
+
url = {https://github.com/YousufAKhan/yakRNA}
|
| 127 |
+
}
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
Rfam: Ontiveros-Palacios et al., *Rfam 15: RNA families database in 2025*,
|
| 131 |
+
Nucleic Acids Research (2025). Rfam data is released under
|
| 132 |
+
[CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/).
|