| Crates.io | rrblup-rs |
| lib.rs | rrblup-rs |
| version | 0.1.0 |
| created_at | 2025-12-12 03:25:57.910631+00 |
| updated_at | 2025-12-12 03:25:57.910631+00 |
| description | Rust implementation of R/rrBLUP package for mixed model analysis |
| homepage | https://github.com/alex-sandercock/Binx/tree/main/crates/rrblup-rs |
| repository | https://github.com/alex-sandercock/Binx |
| max_upload_size | |
| id | 1980949 |
| size | 112,876 |
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.
mixed_solve() - REML-based mixed model solvera_mat() - Additive relationship matrix computationkin_blup() - Genomic BLUP with kinship matrixuse rrblup_rs::{mixed_solve_reml, MixedSolveOptions};
use nalgebra::DMatrix;
let y = vec![1.0, 2.0, 3.0, 4.0, 5.0];
let x = DMatrix::from_row_slice(5, 1, &[1.0, 1.0, 1.0, 1.0, 1.0]); // intercept
let result = mixed_solve_reml(&y, Some(&x), None, MixedSolveOptions::default())?;
println!("Vu: {}, Ve: {}", result.vu, result.ve);
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 |
| 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.
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.
GPL-3.0-or-later