omnigenome 0.3.11a2__tar.gz → 0.4.0a0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- omnigenome-0.4.0a0/PKG-INFO +354 -0
- {omnigenome-0.3.11a2 → omnigenome-0.4.0a0}/omnigenome/__init__.py +71 -19
- omnigenome-0.4.0a0/omnigenome.egg-info/PKG-INFO +354 -0
- omnigenome-0.4.0a0/omnigenome.egg-info/SOURCES.txt +25 -0
- {omnigenome-0.3.11a2 → omnigenome-0.4.0a0}/setup.py +4 -6
- {omnigenome-0.3.11a2 → omnigenome-0.4.0a0}/setup_omnigenome.py +1 -1
- omnigenome-0.4.0a0/tests/test_attention_extraction.py +422 -0
- omnigenome-0.4.0a0/tests/test_autobench_autotrain.py +522 -0
- omnigenome-0.4.0a0/tests/test_autobench_hub_integration.py +250 -0
- omnigenome-0.4.0a0/tests/test_autoinfer_cli.py +480 -0
- omnigenome-0.4.0a0/tests/test_autotrain_hub_integration.py +273 -0
- omnigenome-0.4.0a0/tests/test_benchmark_download.py +0 -0
- omnigenome-0.4.0a0/tests/test_cli_commands.py +459 -0
- omnigenome-0.4.0a0/tests/test_cli_parameter_mapping.py +273 -0
- omnigenome-0.4.0a0/tests/test_example_notebooks.py +285 -0
- omnigenome-0.4.0a0/tests/test_genomic_embeddings.py +512 -0
- omnigenome-0.4.0a0/tests/test_hf_download.py +238 -0
- omnigenome-0.4.0a0/tests/test_rna_design.py +311 -0
- omnigenome-0.4.0a0/tests/test_structure_prediction.py +512 -0
- omnigenome-0.4.0a0/tests/test_token_classification.py +521 -0
- omnigenome-0.4.0a0/tests/test_training_workflows.py +567 -0
- omnigenome-0.3.11a2/PKG-INFO +0 -224
- omnigenome-0.3.11a2/omnigenome.egg-info/PKG-INFO +0 -224
- omnigenome-0.3.11a2/omnigenome.egg-info/SOURCES.txt +0 -15
- omnigenome-0.3.11a2/tests/test_dataset_patterns.py +0 -291
- omnigenome-0.3.11a2/tests/test_examples_syntax.py +0 -83
- omnigenome-0.3.11a2/tests/test_model_loading.py +0 -183
- omnigenome-0.3.11a2/tests/test_rna_functions.py +0 -255
- omnigenome-0.3.11a2/tests/test_training_patterns.py +0 -302
- {omnigenome-0.3.11a2 → omnigenome-0.4.0a0}/LICENSE +0 -0
- {omnigenome-0.3.11a2 → omnigenome-0.4.0a0}/omnigenome.egg-info/dependency_links.txt +0 -0
- {omnigenome-0.3.11a2 → omnigenome-0.4.0a0}/omnigenome.egg-info/entry_points.txt +0 -0
- {omnigenome-0.3.11a2 → omnigenome-0.4.0a0}/omnigenome.egg-info/requires.txt +0 -0
- {omnigenome-0.3.11a2 → omnigenome-0.4.0a0}/omnigenome.egg-info/top_level.txt +0 -0
- {omnigenome-0.3.11a2 → omnigenome-0.4.0a0}/setup.cfg +0 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: omnigenome
|
|
3
|
+
Version: 0.4.0a0
|
|
4
|
+
Summary: OmniGenome: A comprehensive toolkit for genome analysis.
|
|
5
|
+
Home-page: https://github.com/yangheng95/OmniGenBench
|
|
6
|
+
Author: Yang, Heng
|
|
7
|
+
Author-email: hy345@exeter.ac.uk
|
|
8
|
+
License: Apache-2.0
|
|
9
|
+
Platform: Windows
|
|
10
|
+
Platform: Linux
|
|
11
|
+
Platform: Mac OS-X
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: omnigenbench>=0.3.3
|
|
24
|
+
Requires-Dist: findfile>=2.0.0
|
|
25
|
+
Requires-Dist: autocuda>=0.16
|
|
26
|
+
Requires-Dist: metric-visualizer>=0.9.6
|
|
27
|
+
Requires-Dist: termcolor
|
|
28
|
+
Requires-Dist: gitpython
|
|
29
|
+
Requires-Dist: torch>=2.6.0
|
|
30
|
+
Requires-Dist: pandas
|
|
31
|
+
Requires-Dist: viennarna
|
|
32
|
+
Requires-Dist: scikit-learn
|
|
33
|
+
Requires-Dist: accelerate
|
|
34
|
+
Requires-Dist: transformers>=4.46.0
|
|
35
|
+
Requires-Dist: packaging
|
|
36
|
+
Requires-Dist: peft
|
|
37
|
+
Requires-Dist: dill
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: dill; extra == "dev"
|
|
40
|
+
Requires-Dist: pytest; extra == "dev"
|
|
41
|
+
Dynamic: author
|
|
42
|
+
Dynamic: author-email
|
|
43
|
+
Dynamic: classifier
|
|
44
|
+
Dynamic: description
|
|
45
|
+
Dynamic: description-content-type
|
|
46
|
+
Dynamic: home-page
|
|
47
|
+
Dynamic: license
|
|
48
|
+
Dynamic: license-file
|
|
49
|
+
Dynamic: platform
|
|
50
|
+
Dynamic: provides-extra
|
|
51
|
+
Dynamic: requires-dist
|
|
52
|
+
Dynamic: requires-python
|
|
53
|
+
Dynamic: summary
|
|
54
|
+
|
|
55
|
+
[//]: # ()
|
|
56
|
+
|
|
57
|
+
[//]: # (<h3 align="center">OmniGenBench provides an all-in-one solution for genomic foundation model finetuning, inference, deployment and automated benchmarking, designed for research and applications in genomics.</h3>)
|
|
58
|
+
|
|
59
|
+
<div align="center">
|
|
60
|
+
|
|
61
|
+
<a href="https://omnigenbenchdoc.readthedocs.io/en/latest/">
|
|
62
|
+
<img src="https://img.shields.io/readthedocs/omnigenbench?logo=readthedocs&logoColor=white" alt="Documentation Status" />
|
|
63
|
+
</a>
|
|
64
|
+
|
|
65
|
+
<a href="https://pypi.org/project/omnigenome/">
|
|
66
|
+
<img src="https://img.shields.io/pypi/v/omnigenome?color=blue&label=PyPI" alt="PyPI" />
|
|
67
|
+
</a>
|
|
68
|
+
|
|
69
|
+
<a href="https://pepy.tech/project/omnigenome">
|
|
70
|
+
<img src="https://static.pepy.tech/badge/omnigenome" alt="PyPI Downloads" />
|
|
71
|
+
</a>
|
|
72
|
+
|
|
73
|
+
<a href="https://pypi.org/project/omnigenbench/">
|
|
74
|
+
<img src="https://img.shields.io/pypi/pyversions/omnigenbench" alt="Python Versions (omnigenbench)" />
|
|
75
|
+
</a>
|
|
76
|
+
|
|
77
|
+
<a href="https://github.com/yangheng95/omnigenome/blob/main/LICENSE">
|
|
78
|
+
<img src="https://img.shields.io/github/license/yangheng95/omnigenome" alt="License" />
|
|
79
|
+
</a>
|
|
80
|
+
|
|
81
|
+
</div>
|
|
82
|
+
<h3 align="center">
|
|
83
|
+
<a href="#installation">📦 Installation</a>
|
|
84
|
+
<span> · </span>
|
|
85
|
+
<a href="#quick-start">🚀 Getting Started</a>
|
|
86
|
+
<span> · </span>
|
|
87
|
+
<a href="#supported-models">🧬 Model Support</a>
|
|
88
|
+
<span> · </span>
|
|
89
|
+
<a href="#benchmarks">📊 Benchmarks </a>
|
|
90
|
+
<span> · </span>
|
|
91
|
+
<a href="#tutorials">🧪 Application Tutorials</a>
|
|
92
|
+
<span> · </span>
|
|
93
|
+
<a href="https://arxiv.org/pdf/2505.14402">📚 Paper</a>
|
|
94
|
+
</h3>
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## 🔍 What You Can Do with OmniGenBench?
|
|
98
|
+
|
|
99
|
+
- 🧬 **Benchmark effortlessly** — Run automated and reproducible evaluations for genomic foundation models
|
|
100
|
+
- 🧠 **Understand your models** — Explore interpretability across diverse tasks and species
|
|
101
|
+
- ⚙️ **Run tutorials instantly** — Use click-to-run guides for genomic sequence modeling
|
|
102
|
+
- 🚀 **Fine-tune and infer efficiently** — Accelerated workflows for fine-tuning and inference on GFMs on downstream tasks
|
|
103
|
+
|
|
104
|
+
## Installation
|
|
105
|
+
|
|
106
|
+
### Requirements
|
|
107
|
+
Before installing OmniGenBench, ensure you have the following:
|
|
108
|
+
- **Python**: 3.10 or higher (3.12 recommended for best compatibility)
|
|
109
|
+
- **PyTorch**: 2.6.0 or higher (with CUDA support for GPU acceleration)
|
|
110
|
+
- **Transformers**: 4.46.0 or higher (HuggingFace library)
|
|
111
|
+
|
|
112
|
+
### PyPI Installation (Recommended)
|
|
113
|
+
Install the latest stable release from PyPI:
|
|
114
|
+
```bash
|
|
115
|
+
# Create dedicated conda environment (recommended)
|
|
116
|
+
conda create -n omnigen_env python=3.12
|
|
117
|
+
conda activate omnigen_env
|
|
118
|
+
|
|
119
|
+
# Install OmniGenBench
|
|
120
|
+
pip install omnigenbench -U
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Source Installation (For Development)
|
|
124
|
+
Clone the repository and install in editable mode for development:
|
|
125
|
+
```bash
|
|
126
|
+
git clone https://github.com/yangheng95/OmniGenBench.git
|
|
127
|
+
cd OmniGenBench
|
|
128
|
+
pip install -e .
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Note**: For RNA structure prediction and design features, ViennaRNA is required. Install via conda: `conda install -c bioconda viennarna`
|
|
132
|
+
|
|
133
|
+
## Quick Start
|
|
134
|
+
*OmniGenBench provides unified interfaces for model inference, automated benchmarking, and fine-tuning across 30+ genomic foundation models and 80+ standardized tasks.*
|
|
135
|
+
|
|
136
|
+
### Auto-inference via CLI
|
|
137
|
+
Run inference with fine-tuned models on genomic sequences:
|
|
138
|
+
```bash
|
|
139
|
+
# Single sequence inference (TF binding prediction)
|
|
140
|
+
ogb autoinfer \
|
|
141
|
+
--model yangheng/ogb_tfb_finetuned \
|
|
142
|
+
--sequence "ATCGATCGATCGATCG" \
|
|
143
|
+
--output-file predictions.json
|
|
144
|
+
|
|
145
|
+
# Batch inference from file (translation efficiency prediction)
|
|
146
|
+
ogb autoinfer \
|
|
147
|
+
--model yangheng/ogb_te_finetuned \
|
|
148
|
+
--input-file sequences.json \
|
|
149
|
+
--batch-size 64 \
|
|
150
|
+
--output-file results.json
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Auto-inference via Python API
|
|
154
|
+
Programmatic inference with three-line workflow:
|
|
155
|
+
```python
|
|
156
|
+
from omnigenbench import ModelHub
|
|
157
|
+
|
|
158
|
+
# Load fine-tuned model from HuggingFace Hub
|
|
159
|
+
model = ModelHub.load("yangheng/ogb_tfb_finetuned")
|
|
160
|
+
|
|
161
|
+
# Predict transcription factor binding (919 TFs, multi-label classification)
|
|
162
|
+
outputs = model.inference("ATCGATCGATCGATCGATCGATCGATCGATCG" * 10)
|
|
163
|
+
print(outputs)
|
|
164
|
+
# {'predictions': array([1, 0, 1, ...]),
|
|
165
|
+
# 'probabilities': array([0.92, 0.15, 0.87, ...])}
|
|
166
|
+
|
|
167
|
+
# Interpret results
|
|
168
|
+
import numpy as np
|
|
169
|
+
binding_sites = np.where(outputs['predictions'] == 1)[0]
|
|
170
|
+
print(f"Predicted binding: {len(binding_sites)}/919 transcription factors")
|
|
171
|
+
```
|
|
172
|
+
**More Examples**: See [Getting Started Guide](docs/GETTING_STARTED.md) and [AutoInfer Examples](examples/autoinfer_examples/) for advanced usage patterns.
|
|
173
|
+
|
|
174
|
+
### Auto-benchmark via CLI
|
|
175
|
+
Automated benchmarking with statistical rigor (multi-seed evaluation):
|
|
176
|
+
```bash
|
|
177
|
+
# Evaluate model on RGB benchmark (12 RNA tasks) with 3 random seeds
|
|
178
|
+
ogb autobench \
|
|
179
|
+
--model yangheng/OmniGenome-186M \
|
|
180
|
+
--benchmark RGB \
|
|
181
|
+
--seeds 0 1 2 \
|
|
182
|
+
--trainer accelerate
|
|
183
|
+
|
|
184
|
+
# Legacy command (still supported for backward compatibility)
|
|
185
|
+
# autobench --config_or_model "yangheng/OmniGenome-186M" --benchmark "RGB"
|
|
186
|
+
```
|
|
187
|
+
**Output**: Results include mean ± standard deviation for each metric (e.g., MCC: 0.742 ± 0.015, F1: 0.863 ± 0.009)
|
|
188
|
+
|
|
189
|
+
**Visualization**: See [AutoBench GIF](asset/AutoBench.gif) for workflow demonstration.
|
|
190
|
+
|
|
191
|
+
### Auto-benchmark via Python API
|
|
192
|
+
Programmatic benchmarking with flexible configuration:
|
|
193
|
+
```python
|
|
194
|
+
from omnigenbench import AutoBench
|
|
195
|
+
|
|
196
|
+
# Initialize benchmark
|
|
197
|
+
gfm = 'LongSafari/hyenadna-medium-160k-seqlen-hf'
|
|
198
|
+
benchmark = "RGB" # Options: RGB, BEACON, PGB, GUE, GB
|
|
199
|
+
bench_size = 8
|
|
200
|
+
seeds = [0, 1, 2, 3, 4] # Multi-seed for statistical rigor
|
|
201
|
+
|
|
202
|
+
# Run automated evaluation
|
|
203
|
+
bench = AutoBench(
|
|
204
|
+
benchmark=benchmark,
|
|
205
|
+
config_or_model=gfm,
|
|
206
|
+
overwrite=False # Skip completed tasks
|
|
207
|
+
)
|
|
208
|
+
bench.run(autocast=False, batch_size=bench_size, seeds=seeds)
|
|
209
|
+
```
|
|
210
|
+
**Advanced Usage**: See [Benchmarking with LoRA](examples/autobench_gfm_evaluation/benchmarking_with_lora.ipynb) for parameter-efficient fine-tuning during evaluation.
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
## Supported Models
|
|
214
|
+
|
|
215
|
+
OmniGenBench provides plug-and-play evaluation for **30+ genomic foundation models**, covering both **RNA** and **DNA** modalities across multiple species. All models integrate seamlessly with the framework's automated benchmarking and fine-tuning workflows.
|
|
216
|
+
|
|
217
|
+
### Representative Models
|
|
218
|
+
|
|
219
|
+
| Model | Params | Pre-training Corpus | Key Features |
|
|
220
|
+
|----------------|--------|--------------------------------------------|-------------------------------------------------------|
|
|
221
|
+
| **OmniGenome** | 186M | 54B plant RNA+DNA tokens | Multi-modal encoder, structure-aware, plant-specialized |
|
|
222
|
+
| **Agro-NT-1B** | 985M | 48 edible-plant genomes | Billion-scale DNA LM with NT-V2 k-mer vocabulary |
|
|
223
|
+
| **RiNALMo** | 651M | 36M ncRNA sequences | Largest public RNA LM with FlashAttention-2 |
|
|
224
|
+
| **DNABERT-2** | 117M | 32B DNA tokens, 136 species (BPE) | Second-generation DNA BERT with byte-pair encoding |
|
|
225
|
+
| **RNA-FM** | 96M | 23M ncRNA sequences | High performance on RNA structure prediction tasks |
|
|
226
|
+
| **RNA-MSM** | 96M | Multi-sequence alignments | MSA-based evolutionary modeling for RNA |
|
|
227
|
+
| **NT-V2** | 96M | 300B DNA tokens (850 species) | Hybrid k-mer vocabulary, cross-species |
|
|
228
|
+
| **HyenaDNA** | 47M | Human reference genome | Long-context (160k-1M tokens) autoregressive model |
|
|
229
|
+
| **SpliceBERT** | 19M | 2M pre-mRNA sequences | Fine-grained splice-site recognition |
|
|
230
|
+
| **Caduceus** | 1.9M | Human chromosomes | Ultra-compact reverse-complement equivariant DNA LM |
|
|
231
|
+
| **RNA-BERT** | 0.5M | 4,000+ ncRNA families (Rfam) | Compact RNA BERT with nucleotide-level masking |
|
|
232
|
+
|
|
233
|
+
**Complete Model List**: See Appendix E of the [paper](https://arxiv.org/pdf/2505.14402) for all 30+ supported models, including PlantRNA-FM, UTR-LM, MP-RNA, CALM, and more.
|
|
234
|
+
|
|
235
|
+
**Model Access**: All models are available on HuggingFace Hub and can be loaded with `ModelHub.load("model-name")`.
|
|
236
|
+
|
|
237
|
+
## Benchmarks
|
|
238
|
+
|
|
239
|
+
OmniGenBench supports **five curated benchmark suites** covering both **sequence-level** and **structure-level** genomics tasks across species. All benchmarks are automatically downloaded from HuggingFace Hub on first use.
|
|
240
|
+
|
|
241
|
+
| Suite | Focus | #Tasks / Datasets | Representative Tasks |
|
|
242
|
+
|--------------|-----------------------------|--------------------------|--------------------------------------------------------|
|
|
243
|
+
| **RGB** | RNA structure + function | 12 tasks (SN-level) | Secondary structure, solvent accessibility, degradation |
|
|
244
|
+
| **BEACON** | RNA (multi-domain) | 13 tasks | Base pairing, mRNA design, RNA contact prediction |
|
|
245
|
+
| **PGB** | Plant long-range DNA | 7 categories | PolyA signal, enhancer, chromatin, splice site (up to 50kb context) |
|
|
246
|
+
| **GUE** | DNA general understanding | 36 datasets (9 tasks) | TF binding, core promoter, enhancer, epigenetics |
|
|
247
|
+
| **GB** | Classic DNA classification | 9 datasets | Human/mouse enhancers, promoter variant classification |
|
|
248
|
+
|
|
249
|
+
**Evaluation Protocol**: All benchmarks follow standardized protocols with multi-seed evaluation (typically 3-5 runs) for statistical rigor. Results report mean ± standard deviation for each metric.
|
|
250
|
+
|
|
251
|
+
**Accessing Benchmarks**: Use `AutoBench(benchmark="RGB")` or `ogb autobench --benchmark RGB` to automatically download and evaluate on any suite.
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
## Tutorials
|
|
255
|
+
|
|
256
|
+
### RNA Design
|
|
257
|
+
|
|
258
|
+
RNA design is the inverse problem of RNA structure prediction: given a target secondary structure (in dot-bracket notation), design RNA sequences that fold into that structure. OmniGenBench provides both CLI and Python API for RNA sequence design using genetic algorithms enhanced with masked language modeling.
|
|
259
|
+
|
|
260
|
+
#### CLI Usage
|
|
261
|
+
```bash
|
|
262
|
+
# Basic RNA design for a simple hairpin structure
|
|
263
|
+
ogb rna_design --structure "(((...)))"
|
|
264
|
+
|
|
265
|
+
# Design with custom parameters for better results
|
|
266
|
+
ogb rna_design \
|
|
267
|
+
--structure "(((...)))" \
|
|
268
|
+
--model yangheng/OmniGenome-186M \
|
|
269
|
+
--mutation-ratio 0.3 \
|
|
270
|
+
--num-population 200 \
|
|
271
|
+
--num-generation 150 \
|
|
272
|
+
--output-file results.json
|
|
273
|
+
|
|
274
|
+
# Design complex structure (stem-loop-stem)
|
|
275
|
+
ogb rna_design \
|
|
276
|
+
--structure "(((..(((...)))..)))" \
|
|
277
|
+
--num-population 300 \
|
|
278
|
+
--num-generation 200 \
|
|
279
|
+
--output-file complex_design.json
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Note**: RNA design is now available through the unified `ogb` command interface.
|
|
283
|
+
|
|
284
|
+
#### Python API Usage
|
|
285
|
+
```python
|
|
286
|
+
from omnigenbench import OmniModelForRNADesign
|
|
287
|
+
|
|
288
|
+
# Initialize model
|
|
289
|
+
model = OmniModelForRNADesign(model="yangheng/OmniGenome-186M")
|
|
290
|
+
|
|
291
|
+
# Design sequences for target structure
|
|
292
|
+
sequences = model.design(
|
|
293
|
+
structure="(((...)))", # Target structure in dot-bracket notation
|
|
294
|
+
mutation_ratio=0.5, # Mutation rate for genetic algorithm
|
|
295
|
+
num_population=100, # Population size
|
|
296
|
+
num_generation=100 # Number of generations
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
print(f"Designed {len(sequences)} sequences:")
|
|
300
|
+
for seq in sequences[:5]:
|
|
301
|
+
print(f" {seq}")
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
**Key Features:**
|
|
305
|
+
- 🧬 Multi-objective genetic algorithm with MLM-guided mutations
|
|
306
|
+
- ⚡ Automatic GPU acceleration for large populations
|
|
307
|
+
- 📊 Real-time progress tracking with early termination
|
|
308
|
+
- 🎯 Returns multiple optimal solutions (up to 25 sequences)
|
|
309
|
+
- 💾 JSON output format for downstream analysis
|
|
310
|
+
|
|
311
|
+
**Common Structure Patterns:**
|
|
312
|
+
- Simple hairpin: `"(((...)))"`
|
|
313
|
+
- Stem-loop-stem: `"(((..(((...)))..)))"`
|
|
314
|
+
- Multi-loop: `"(((...(((...)))..(((...))).)))"`
|
|
315
|
+
- Long stem: `"((((((((....))))))))"`
|
|
316
|
+
|
|
317
|
+
The comprehensive tutorials of RNA Design can be found in:
|
|
318
|
+
- [RNA Design Examples](examples/rna_sequence_design/rna_design_examples.py) - Comprehensive examples
|
|
319
|
+
- [RNA Design README](examples/rna_sequence_design/README.md) - Detailed documentation
|
|
320
|
+
- [RNA Design Tutorial](examples/rna_sequence_design/RNA_Design_Tutorial.ipynb) - Interactive notebook
|
|
321
|
+
|
|
322
|
+
You can find a visual demo of RNA Design [here](asset/RNADesign-Demo.gif).
|
|
323
|
+
|
|
324
|
+
### RNA Secondary Structure Prediction
|
|
325
|
+
|
|
326
|
+
RNA secondary structure prediction is a fundamental problem in computational biology,
|
|
327
|
+
where the goal is to predict the secondary structure of an RNA sequence.
|
|
328
|
+
In this demo, we show how to use OmniGenBench to predict the secondary structure of RNA sequences using a pre-trained model.
|
|
329
|
+
The tutorials of RNA Secondary Structure Prediction can be found in
|
|
330
|
+
[Secondary_Structure_Prediction_Tutorial.ipynb](examples/rna_secondary_structure_prediction/00_quickstart_rna_ssp.ipynb)(examples/rna_secondary_structure_prediction/00.ipynb).
|
|
331
|
+
|
|
332
|
+
You can find a visual example of RNA Secondary Structure Prediction [here](asset/RNASSP-Demo.gif).
|
|
333
|
+
|
|
334
|
+
### More Tutorials
|
|
335
|
+
Please find more usage tutorials in [examples](examples).
|
|
336
|
+
|
|
337
|
+
## Citation
|
|
338
|
+
```bibtex
|
|
339
|
+
@article{yang2024omnigenbench,
|
|
340
|
+
title={OmniGenBench: A Modular Platform for Reproducible Genomic Foundation Models Benchmarking},
|
|
341
|
+
author={Heng Yang and Jack Cole, Yuan Li, Renzhi Chen, Geyong Min and Ke Li},
|
|
342
|
+
year={2024},
|
|
343
|
+
eprint={https://arxiv.org/abs/2505.14402},
|
|
344
|
+
archivePrefix={arXiv},
|
|
345
|
+
primaryClass={q-bio.GN},
|
|
346
|
+
url={https://arxiv.org/abs/2505.14402},
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
## License
|
|
350
|
+
OmniGenBench is licensed under the Apache License 2.0. See the LICENSE file for more information.
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
## Contribution
|
|
354
|
+
We welcome contributions to OmniGenBench! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request on GitHub.
|
|
@@ -29,7 +29,7 @@ import warnings
|
|
|
29
29
|
|
|
30
30
|
warnings.warn(
|
|
31
31
|
"The 'omnigenome' package is deprecated, please use omnigenbench package instead. "
|
|
32
|
-
"e.g., from
|
|
32
|
+
"e.g., from omnigenbench import * -> from omnigenbench import *\n"
|
|
33
33
|
"All imports from omnigenome will be redirected to omnigenbench. ",
|
|
34
34
|
DeprecationWarning,
|
|
35
35
|
)
|
|
@@ -59,6 +59,7 @@ try:
|
|
|
59
59
|
OmniDatasetForSequenceRegression,
|
|
60
60
|
OmniDatasetForTokenClassification,
|
|
61
61
|
OmniDatasetForTokenRegression,
|
|
62
|
+
OmniDatasetForMultiLabelClassification,
|
|
62
63
|
)
|
|
63
64
|
|
|
64
65
|
# Import metric classes
|
|
@@ -99,6 +100,15 @@ try:
|
|
|
99
100
|
OmniModelForAugmentation,
|
|
100
101
|
)
|
|
101
102
|
|
|
103
|
+
from omnigenbench.src.model.baselines import (
|
|
104
|
+
OmniCNNBaseline,
|
|
105
|
+
OmniRNNBaseline,
|
|
106
|
+
OmniBPNetBaseline,
|
|
107
|
+
OmniBasenjiBaseline,
|
|
108
|
+
OmniDeepSTARRBaseline,
|
|
109
|
+
OmniGenericBaseline,
|
|
110
|
+
)
|
|
111
|
+
|
|
102
112
|
# Import LoRA model
|
|
103
113
|
from omnigenbench.src.lora.lora_model import OmniLoraModel
|
|
104
114
|
|
|
@@ -115,27 +125,37 @@ try:
|
|
|
115
125
|
from omnigenbench.src.trainer.accelerate_trainer import AccelerateTrainer
|
|
116
126
|
|
|
117
127
|
# Import hub utilities
|
|
118
|
-
from omnigenbench.utility.hub_utils import (
|
|
128
|
+
from omnigenbench.src.utility.hub_utils import (
|
|
119
129
|
download_benchmark,
|
|
120
130
|
download_model,
|
|
121
131
|
download_pipeline,
|
|
122
132
|
query_models_info,
|
|
123
133
|
)
|
|
124
|
-
from omnigenbench.utility import hub_utils
|
|
134
|
+
from omnigenbench.src.utility import hub_utils
|
|
125
135
|
|
|
126
136
|
# Import hub classes
|
|
127
|
-
from omnigenbench.utility.model_hub.model_hub import ModelHub
|
|
128
|
-
from omnigenbench.utility.dataset_hub.dataset_hub import load_benchmark_datasets
|
|
129
|
-
from omnigenbench.utility.pipeline_hub.pipeline import Pipeline
|
|
130
|
-
from omnigenbench.utility.pipeline_hub.pipeline_hub import PipelineHub
|
|
137
|
+
from omnigenbench.src.utility.model_hub.model_hub import ModelHub
|
|
138
|
+
from omnigenbench.src.utility.dataset_hub.dataset_hub import load_benchmark_datasets
|
|
139
|
+
from omnigenbench.src.utility.pipeline_hub.pipeline import Pipeline
|
|
140
|
+
from omnigenbench.src.utility.pipeline_hub.pipeline_hub import PipelineHub
|
|
131
141
|
|
|
132
142
|
# Import module utilities
|
|
133
143
|
from omnigenbench.src.model.module_utils import OmniPooling
|
|
134
|
-
from omnigenbench.utility.ensemble import VoteEnsemblePredictor
|
|
144
|
+
from omnigenbench.src.utility.ensemble import VoteEnsemblePredictor
|
|
135
145
|
|
|
136
146
|
# For backward compatibility version 0.2.7alpha and earlier
|
|
137
147
|
from omnigenbench.auto.config.auto_config import AutoBenchConfig
|
|
138
148
|
|
|
149
|
+
# Import explainer classes
|
|
150
|
+
from omnigenbench.src.explainability.epistasis.explainer import EpistasisExplainer
|
|
151
|
+
from omnigenbench.src.explainability.sequence_logo.explainer import (
|
|
152
|
+
SequenceLogoExplainer,
|
|
153
|
+
)
|
|
154
|
+
from omnigenbench.src.explainability.visualization_2d.explainer import (
|
|
155
|
+
Visualization2DExplainer,
|
|
156
|
+
)
|
|
157
|
+
from omnigenbench.src.explainability.attention.explainer import AttentionExplainer
|
|
158
|
+
|
|
139
159
|
# Create backward compatibility aliases
|
|
140
160
|
OmniGenomeTokenizer = OmniTokenizer
|
|
141
161
|
OmniGenomeKmersTokenizer = OmniKmersTokenizer
|
|
@@ -167,6 +187,7 @@ try:
|
|
|
167
187
|
|
|
168
188
|
# Define __all__ for explicit exports
|
|
169
189
|
__all__ = [
|
|
190
|
+
"__version__",
|
|
170
191
|
"load_benchmark_datasets",
|
|
171
192
|
"OmniDataset",
|
|
172
193
|
"OmniModel",
|
|
@@ -203,6 +224,44 @@ try:
|
|
|
203
224
|
"print_args",
|
|
204
225
|
"env_meta_info",
|
|
205
226
|
"RNA2StructureCache",
|
|
227
|
+
"OmniDatasetForSequenceClassification",
|
|
228
|
+
"OmniDatasetForSequenceRegression",
|
|
229
|
+
"OmniDatasetForTokenClassification",
|
|
230
|
+
"OmniDatasetForTokenRegression",
|
|
231
|
+
"OmniDatasetForMultiLabelClassification",
|
|
232
|
+
"OmniTokenizer",
|
|
233
|
+
"OmniKmersTokenizer",
|
|
234
|
+
"OmniSingleNucleotideTokenizer",
|
|
235
|
+
"OmniBPETokenizer",
|
|
236
|
+
"OmniDataset",
|
|
237
|
+
"OmniMetric",
|
|
238
|
+
"OmniModel",
|
|
239
|
+
"OmniLoraModel",
|
|
240
|
+
"OmniModelForSequenceClassification",
|
|
241
|
+
"OmniModelForMultiLabelSequenceClassification",
|
|
242
|
+
"OmniModelForTokenClassification",
|
|
243
|
+
"OmniModelForSequenceRegression",
|
|
244
|
+
"OmniModelForTokenRegression",
|
|
245
|
+
"OmniModelForStructuralImputation",
|
|
246
|
+
"OmniModelForMatrixRegression",
|
|
247
|
+
"OmniModelForMatrixClassification",
|
|
248
|
+
"OmniModelForMLM",
|
|
249
|
+
"OmniModelForSeq2Seq",
|
|
250
|
+
"OmniModelForRNADesign",
|
|
251
|
+
"OmniModelForEmbedding",
|
|
252
|
+
"OmniModelForAugmentation",
|
|
253
|
+
"OmniPooling",
|
|
254
|
+
"download_benchmark",
|
|
255
|
+
"download_model",
|
|
256
|
+
"download_pipeline",
|
|
257
|
+
"query_models_info",
|
|
258
|
+
"hub_utils",
|
|
259
|
+
"OmniCNNBaseline",
|
|
260
|
+
"OmniRNNBaseline",
|
|
261
|
+
"OmniBPNetBaseline",
|
|
262
|
+
"OmniBasenjiBaseline",
|
|
263
|
+
"OmniDeepSTARRBaseline",
|
|
264
|
+
"OmniGenericBaseline",
|
|
206
265
|
# OmniGenome* aliases for backward compatibility
|
|
207
266
|
"OmniGenomeTokenizer",
|
|
208
267
|
"OmniGenomeKmersTokenizer",
|
|
@@ -234,19 +293,12 @@ try:
|
|
|
234
293
|
"bench_command",
|
|
235
294
|
"run_train",
|
|
236
295
|
"train_command",
|
|
296
|
+
"EpistasisExplainer",
|
|
297
|
+
"SequenceLogoExplainer",
|
|
298
|
+
"Visualization2DExplainer",
|
|
299
|
+
"AttentionExplainer",
|
|
237
300
|
]
|
|
238
301
|
|
|
239
302
|
except ImportError as e:
|
|
240
|
-
import warnings
|
|
241
|
-
|
|
242
|
-
warnings.warn(
|
|
243
|
-
f"Failed to import omnigenbench modules: {e}. "
|
|
244
|
-
"Please ensure omnigenbench is properly installed.\n"
|
|
245
|
-
"You can install it with: pip install omnigenbench\n"
|
|
246
|
-
"and replace all 'omnigenome' with 'omnigenbench' in your code.\n"
|
|
247
|
-
"e.g., from omnigenome import * -> from omnigenbench import *",
|
|
248
|
-
ImportWarning,
|
|
249
|
-
)
|
|
250
|
-
|
|
251
303
|
# Minimal fallback to prevent complete failure
|
|
252
304
|
__all__ = []
|