omnigenome 0.3.22a0__py3-none-any.whl → 0.3.24a0__py3-none-any.whl

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.

Potentially problematic release.


This version of omnigenome might be problematic. Click here for more details.

@@ -0,0 +1,354 @@
1
+ Metadata-Version: 2.4
2
+ Name: omnigenome
3
+ Version: 0.3.24a0
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
+ [//]: # (![favicon.png](asset/favicon.png))
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 --model_name_or_path "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
+ model_name_or_path=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/Secondary_Structure_Prediction_Tutorial.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.
@@ -0,0 +1,7 @@
1
+ omnigenome/__init__.py,sha256=2JNoPrnv-1lYXkBiuHBYVXp1OJiRD8c9j65qFeXJtQY,9436
2
+ omnigenome-0.3.24a0.dist-info/licenses/LICENSE,sha256=oQoefBV6siHctF0ET-OO3EaSZgtqGtf-wdIAmokS8iY,11560
3
+ omnigenome-0.3.24a0.dist-info/METADATA,sha256=02jVbily5lRdBnVrK6raLl6XNzODYp1arc7nRLFVlTc,15484
4
+ omnigenome-0.3.24a0.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
5
+ omnigenome-0.3.24a0.dist-info/entry_points.txt,sha256=uu40UgMPxY65ASdRbrhkwH94r7CIYgyG_iDBmqFQbD8,84
6
+ omnigenome-0.3.24a0.dist-info/top_level.txt,sha256=LVFxm_WPaxjj9KnAqdW94W4D4lbOk30gdsaKlJiSzTo,11
7
+ omnigenome-0.3.24a0.dist-info/RECORD,,
@@ -1,253 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: omnigenome
3
- Version: 0.3.22a0
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
- [//]: # (![favicon.png]&#40;asset/favicon.png&#41;)
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/omnigenome" alt="Python Version" />
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 OmniGenoBench, you need to install the following dependencies:
108
- - Python 3.10+
109
- - PyTorch 2.5+
110
- - Transformers 4.46.0+
111
-
112
- ### PyPI Installation
113
- To install OmniGenoBench, you can use pip:
114
- ```bash
115
- pip install omnigenbench -U
116
- ```
117
-
118
- ### Source Installation
119
- Or you can clone the repository and install it from source:
120
- ```bash
121
- git clone https://github.com/yangheng95/OmniGenBench.git
122
- cd OmniGenBench
123
- pip install -e .
124
- ```
125
-
126
- ## Quick Start
127
- `OmniGenBench is available for diverse models and benchmark suites, please refer to the following sections for more details.`
128
-
129
- ### Auto-inference via CLI
130
- Run inference with fine-tuned models on genomic sequences:
131
- ```bash
132
- # Single sequence inference
133
- ogb autoinfer --model yangheng/ogb_tfb_finetuned --sequence "ATCGATCGATCGATCG" --output-file predictions.json
134
-
135
- # Batch inference from file
136
- ogb autoinfer --model yangheng/ogb_te_finetuned --input-file sequences.json --batch-size 64 --output-file results.json
137
-
138
- # Legacy command (still supported)
139
- autoinfer --model yangheng/ogb_tfb_finetuned --sequence "ATCGATCGATCG"
140
- ```
141
-
142
- ### Auto-inference via Python API
143
- Or use the Python API for programmatic inference:
144
- ```python
145
- from omnigenbench import ModelHub
146
-
147
- model = ModelHub.load("yangheng/ogb_tfb_finetuned")
148
- outputs = model.inference("ATCGATCGATCGATCGATCGATCGATCGATCG")
149
- print(outputs) # {'predictions': array([1, 0, 1, ...]), 'probabilities': array([0.92, 0.15, ...])}
150
- ```
151
- You can find more examples in the [Getting Started Guide](docs/GETTING_STARTED.md) and [AutoInfer Examples](examples/autoinfer_examples/).
152
-
153
- ### Auto-benchmark via CLI
154
- The following command will download the model from the Hugging Face model hub and run the benchmark on the RGB benchmark:
155
- ```bash
156
- # New unified command
157
- ogb autobench --model yangheng/OmniGenome-186M --benchmark RGB --trainer accelerate
158
-
159
- # Legacy command (still supported)
160
- autobench --model_name_or_path "yangheng/OmniGenome-186M" --benchmark "RGB" --trainer accelerate
161
- ```
162
- You can find a visualization of AutoBench [here](asset/AutoBench.gif).
163
-
164
- ### Auto-benchmark via Python API
165
- Or you can use the following python code to run the auto-benchmark:
166
- ```python
167
- from omnigenbench import AutoBench
168
- gfm = 'LongSafari/hyenadna-medium-160k-seqlen-hf'
169
- # benchmark could be "RGB", "GB", "PGB", "GUE", which will be downloaded from the Hugging Face model hub
170
- benchmark = "RGB"
171
- bench_size = 8
172
- seeds = [0, 1, 2, 3, 4]
173
- bench = AutoBench(benchmark=benchmark, model_name_or_path=gfm, overwrite=False)
174
- bench.run(autocast=False, batch_size=bench_size, seeds=seeds)
175
- ```
176
- You can find an example of AutoBench via Python API [here](examples/autobench_gfm_evaluation/benchmarking_with_lora.ipynb).
177
-
178
-
179
- ## Supported Models
180
-
181
-
182
- OmniGenBench provides plug-and-play evaluation for over **30 genomic foundation models**, covering both **RNA** and **DNA** modalities. The following are highlights:
183
-
184
- | Model | Params | Pre-training Corpus | Highlights |
185
- |----------------|--------|--------------------------------------------|-----------------------------------------------------|
186
- | **OmniGenome** | 186M | 54B plant RNA+DNA tokens | Multi-modal, structure-aware encoder |
187
- | **Agro-NT-1B** | 985M | 48 edible-plant genomes | Billion-scale DNA LM w/ NT-V2 k-mer vocab |
188
- | **RiNALMo** | 651M | 36M ncRNA sequences | Largest public RNA LM; FlashAttention-2 |
189
- | **DNABERT-2** | 117M | 32B DNA tokens, 136 species (BPE) | Byte-pair encoding; 2nd-gen DNA BERT |
190
- | **RNA-FM** | 96M | 23M ncRNA sequences | High performance on RNA structure tasks |
191
- | **RNA-MSM** | 96M | Multi-sequence alignments | MSA-based evolutionary RNA LM |
192
- | **NT-V2** | 96M | 300B DNA tokens (850 species) | Hybrid k-mer vocabulary |
193
- | **HyenaDNA** | 47M | Human chromosomes | Long-context autoregressive model (1Mb) |
194
- | **SpliceBERT** | 19M | 2M pre-mRNA sequences | Fine-grained splice-site recognition |
195
- | **Caduceus** | 1.9M | Human chromosomes | Ultra-compact DNA LM (RC-equivariant) |
196
- | **RNA-BERT** | 0.5M | 4,000+ ncRNA families | Small BERT with nucleotide masking |
197
- | *...and more* | — | See Appendix E of the paper | Includes PlantRNA-FM, UTR-LM, MP-RNA, CALM, etc. |
198
-
199
- ## Benchmarks
200
-
201
- OmniGenBench supports five curated benchmark suites covering both **sequence-level** and **structure-level** genomics tasks across species.
202
-
203
- | Suite | Focus | #Tasks / Datasets | Sample Tasks |
204
- |--------------|-----------------------------|--------------------------|------------------------------------------------------|
205
- | **RGB** | RNA structure + function | 12 tasks (SN-level) | RNA secondary structure, SNMR, degradation prediction |
206
- | **BEACON** | RNA (multi-domain) | 13 tasks | Base pairing, mRNA design, RNA contact maps |
207
- | **PGB** | Plant long-range DNA | 7 categories | PolyA, enhancer, chromatin access, splice site |
208
- | **GUE** | DNA general tasks | 36 datasets (9 tasks) | TF binding, core promoter, enhancer detection |
209
- | **GB** | Classic DNA classification | 9 datasets | Human/mouse enhancer, promoter variant classification|
210
-
211
-
212
- ## Tutorials
213
-
214
- ### RNA Design
215
- RNA design is a fundamental problem in synthetic biology,
216
- where the goal is to design RNA sequences that fold into a target structure.
217
- In this demo, we show how to use OmniGenoBench to design RNA sequences
218
- that fold into a target structure using a pre-trained model.
219
- The tutorials of RNA Design Demo can be found in [RNA_Design_Tutorial.ipynb](examples/rna_sequence_design/RNA_Design_Tutorial.ipynb).
220
-
221
- You can find a visual example of RNA Design [here](asset/RNADesign-Demo.gif).
222
-
223
- ### RNA Secondary Structure Prediction
224
-
225
- RNA secondary structure prediction is a fundamental problem in computational biology,
226
- where the goal is to predict the secondary structure of an RNA sequence.
227
- In this demo, we show how to use OmniGenoBench to predict the secondary structure of RNA sequences using a pre-trained model.
228
- The tutorials of RNA Secondary Structure Prediction can be found in
229
- [Secondary_Structure_Prediction_Tutorial.ipynb](examples/rna_secondary_structure_prediction/Secondary_Structure_Prediction_Tutorial.ipynb).
230
-
231
- You can find a visual example of RNA Secondary Structure Prediction [here](asset/RNASSP-Demo.gif).
232
-
233
- ### More Tutorials
234
- Please find more usage tutorials in [examples](examples).
235
-
236
- ## Citation
237
- ```bibtex
238
- @article{yang2024omnigenbench,
239
- title={OmniGenBench: A Modular Platform for Reproducible Genomic Foundation Models Benchmarking},
240
- author={Heng Yang and Jack Cole, Yuan Li, Renzhi Chen, Geyong Min and Ke Li},
241
- year={2024},
242
- eprint={https://arxiv.org/abs/2505.14402},
243
- archivePrefix={arXiv},
244
- primaryClass={q-bio.GN},
245
- url={https://arxiv.org/abs/2505.14402},
246
- }
247
- ```
248
- ## License
249
- OmniGenBench is licensed under the Apache License 2.0. See the LICENSE file for more information.
250
-
251
-
252
- ## Contribution
253
- 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.
@@ -1,7 +0,0 @@
1
- omnigenome/__init__.py,sha256=2JNoPrnv-1lYXkBiuHBYVXp1OJiRD8c9j65qFeXJtQY,9436
2
- omnigenome-0.3.22a0.dist-info/licenses/LICENSE,sha256=oQoefBV6siHctF0ET-OO3EaSZgtqGtf-wdIAmokS8iY,11560
3
- omnigenome-0.3.22a0.dist-info/METADATA,sha256=Z8pqBMfX0aGOuCZ-SmPGPHBJtgjZQNafPwUsOB6mIHs,11520
4
- omnigenome-0.3.22a0.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
5
- omnigenome-0.3.22a0.dist-info/entry_points.txt,sha256=uu40UgMPxY65ASdRbrhkwH94r7CIYgyG_iDBmqFQbD8,84
6
- omnigenome-0.3.22a0.dist-info/top_level.txt,sha256=LVFxm_WPaxjj9KnAqdW94W4D4lbOk30gdsaKlJiSzTo,11
7
- omnigenome-0.3.22a0.dist-info/RECORD,,