cuda_cell_pca: Run PCA on highly variable single-cell features

View source: R/cell-workflow.R

cuda_cell_pcaR Documentation

Run PCA on highly variable single-cell features

Description

Run PCA on highly variable single-cell features

Usage

cuda_cell_pca(
  counts,
  n_components = 30L,
  n_hvg = 2000L,
  scale. = TRUE,
  device = c("auto", "cuda", "cpu"),
  scale_factor = 10000,
  log1p = TRUE,
  min_mean = 0
)

Arguments

counts

Feature-by-cell matrix.

n_components

Number of principal components.

n_hvg

Number of highly variable features.

scale.

Whether to scale selected features before PCA.

device

Device passed to cudaverse::cuda_pca().

scale_factor

Target library size used during normalization.

log1p

Whether to apply log1p() after library-size normalization.

min_mean

Minimum feature mean used during highly variable feature selection.

Value

A cuda_pca object with an additional features element. Cell names label PCA score rows and selected feature names label loadings.

Examples

set.seed(2)
counts <- matrix(rpois(30 * 20, lambda = 2), 30, 20)
cuda_cell_pca(counts, n_components = 3, n_hvg = 10, device = "cpu")

cudacellr documentation built on Oct. 28, 2026, 1:07 a.m.