Skip to contents

GPU counterpart of bixverse::generate_seacells_sc(). Both Frank-Wolfe solves, the B-gradient argmin and the per-cell A columns, run on the WGPU backend. Kernel construction, archetype initialisation, the K^2 B bookkeeping, the RSS evaluation and the aggregation into pseudo-bulk counts stay on the CPU, so the speedup tracks how much of the run the two solves own. That share grows with n_sea_cells. Each solve falls back to its CPU sibling for that iteration if no GPU workgroup tier covers k.

Params, result class and downstream code are identical to the CPU version.

Usage

generate_seacells_gpu_sc(
  object,
  seacell_params = bixverse::params_sc_seacells(),
  embd_to_use = "pca",
  no_embd_to_use = NULL,
  cells_to_use = NULL,
  regenerate_knn = FALSE,
  target_size = 1e+05,
  seed = 42L,
  .verbose = TRUE
)

Arguments

object

SingleCells or SingleCellsSubset class from bixverse.

seacell_params

List. Output of bixverse::params_sc_seacells(). A list with the following items:

  • n_sea_cells - Number of SEA cells to detect.

  • max_fw_iters - Maximum iterations for the Frank-Wolfe algorithm per matrix update.

  • convergence_epsilon - Convergence threshold. Algorithm stops when RSS change < epsilon * RSS(0).

  • max_iter - Maximum iterations to run SEACells for.

  • min_iter - Minimum iterations to run SEACells for.

  • greedy_threshold - Maximum number of cells before defaulting to rapid random selection of archetypes.

  • graph_building - Graph building method.

  • pruning - Boolean. Shall small values be pruned during the Frank- Wolfe iterations.

  • pruning_threshold - The threshold below which pruning shall be applied during Frank-Wolfe iterations.

  • n_landmarks - Optional integer. Number of landmarks for the Nystroem archetype initialisation.

  • knn - List of kNN parameters. See bixverse::params_knn_defaults() for available parameters and their defaults.

embd_to_use

String. The embedding to use. Atm, the only option is "pca".

no_embd_to_use

Optional integer. Number of embedding dimensions to use. If NULL all will be used.

cells_to_use

Optional string. Names of the cells to use for the generation of the SEACells. Forces a kNN rebuild on that subset.

regenerate_knn

Boolean. Shall a kNN graph be regenerated. If not, the internal one will be used.

target_size

Numeric. The library target size to normalise the meta cells to.

seed

Integer. Seed for reproducibility.

.verbose

Boolean or integer. Controls verbosity and returns run times. FALSE -> quiet, TRUE or 1L -> normal verbosity, 2L -> detailed verbosity.

Value

A bixverse::MetaCells() with the data generated by this meta cell aggregation method.

References

Persad, et al. Nat Biotechnol, 2023