Rust/extendr backend for Seurat's performance-critical native routines. Install alongside Seurat to use the same function signatures with a Rust backend.
No C++ compiler or RcppEigen headers are needed; all compiled code is Rust.
install.packages("seurust")
install.packages(
"seurust",
repos = c("https://NebilI.r-universe.dev", "https://cloud.r-project.org")
)
if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}
remotes::install_github("NebilI/seurust", subdir = "seurust")
Download seurust_*.tar.gz from
GitHub Releases, then:
install.packages("path/to/seurust_0.1.5.tar.gz", repos = NULL, type = "source")
library(Seurat)
library(seurust)
library(Matrix)
mat <- Matrix::sparseMatrix(i = c(1, 3, 2), j = c(1, 2, 3), x = 1:3, dims = c(3, 3))
all.equal(
Seurat:::LogNorm(mat, 1e4, FALSE),
seurust::LogNorm(mat, 1e4, FALSE)
)
Every exported function takes the same arguments and returns the same kind of
object as the Seurat function of the same name. Integer inputs are accepted
wherever Seurat's Rcpp signature would coerce them (for example integer
neighbor ids in fast_dist or an integer nn_ranked matrix in ComputeSNN).
One deliberate difference: Seurat's RowMergeMatrices only accepts
row-compressed (RsparseMatrix) inputs and errors on a dgCMatrix.
seurust::RowMergeMatrices accepts either layout and converts first; for
RsparseMatrix inputs the result is identical.
Development, packaging, and contribution notes live in the GitHub repository.