rrblup-rs
A Rust implementation of rrBLUP for mixed model solving and genomic prediction. Based on R/rrBLUP version 4.6.3.
This is a library crate.
For GWAS workflows, see gwaspoly-rs (which uses this crate) or the Binx CLI (
binx gwas) for a complete command-line interface.
Features
mixed_solve()- REML-based mixed model solvera_mat()- Additive relationship matrix computationkin_blup()- Genomic BLUP with kinship matrix- Faithful port of R/rrBLUP algorithms
Usage
use ;
use DMatrix;
let y = vec!;
let x = from_row_slice; // intercept
let result = mixed_solve_reml?;
println!;
Benchmarks
mixed.solve with marker matrix Z
Varying markers (n=500 genotypes):
| Markers (m) | R (ms) | Rust (ms) | Speedup |
|---|---|---|---|
| 1,000 | 1,014 | 532 | 1.9x |
| 5,000 | 2,447 | 706 | 3.5x |
| 10,000 | 4,222 | 1,000 | 4.2x |
| 20,000 | 7,841 | 1,604 | 4.9x |
Varying genotypes (m=10,000 markers):
| Genotypes (n) | R (ms) | Rust (ms) | Speedup |
|---|---|---|---|
| 100 | 159 | 31 | 5.1x |
| 200 | 638 | 117 | 5.5x |
| 500 | 4,237 | 936 | 4.5x |
| 1,000 | 19,937 | 5,960 | 3.3x |
kin.blup
| n_geno | R (ms) | Rust (ms) | Speedup |
|---|---|---|---|
| 100 | 93 | 54 | 1.7x |
| 200 | 704 | 474 | 1.5x |
Summary: Rust is 3-5x faster for marker-based workflows, with advantages growing as problem size increases.
Citation
If you use rrblup-rs, please cite the original R/rrBLUP paper:
Endelman, J.B. (2011). Ridge regression and other kernels for genomic selection with R package rrBLUP. The Plant Genome 4:250-255.
This crate is a Rust reimplementation of mixed.solve and related functionality.
For a command-line interface, see Binx.
Related Crates
- gwaspoly-rs - GWASpoly implementation (uses this crate)
- binx-cli - User-facing CLI for GWAS workflows
License
GPL-3.0-or-later