
Run Harmony v2 (GPU)
harmony_gpu_sc.RdA GPU-accelerated version of Harmony v2 by Patikas et al., 2026,
implemented in Rust. Performs batch correction on PCA embeddings and stores
the result as a "harmony_gpu" embedding in the object. Only a single
batch covariate is supported on the GPU path.
Usage
harmony_gpu_sc(
object,
batch_column,
embd_to_use = "pca",
modality = c("rna", "adt", "atac"),
harmony_params = params_sc_harmony_v2_gpu(),
seed = 42L,
backend = c("wgpu", "mlx"),
.verbose = TRUE
)Arguments
- object
SingleCellsclass.- batch_column
String. Column name in the object containing the batch labels.
- embd_to_use
String. The embedding to correct,
"pca"or any other cached embedding.- modality
String. One of
c("rna", "adt", "atac")."adt"needs aSingleCellsMultiModal,"atac"aSingleCellsMultiModalor aSingleCellsAtac.- harmony_params
List. Output of
params_sc_harmony_v2_gpu().- seed
Integer. For reproducibility.
- backend
String. One of
c("wgpu", "mlx")."mlx"runs on Apple Silicon via MLX and needs a build with the MLX backend, seemlx_available().- .verbose
Boolean or integer. Controls verbosity and returns run times.
FALSE-> quiet,TRUEor1L-> normal verbosity,2L-> detailed verbosity.