Skip to contents

Runs the cell2location model (via Python/reticulate) and returns a deconvolution matrix, optionally rescaled to relative values.

Usage

deconvolute_cell2location(
  spatial_obj,
  signature = NULL,
  epochs = 30000,
  n_cell = 10,
  alpha = 20,
  gpu = TRUE,
  result_name = "cell2location",
  values = "relative"
)

Arguments

spatial_obj

SpatialExperiment.

signature

Signature/model input expected by cell2location.

epochs

Training epochs for the model.

n_cell

cell2location hyperparameter.

alpha

cell2location hyperparameter.

gpu

Logical; whether to use GPU for training.

result_name

Prefix used to label result columns (default: "cell2location").

values

"relative" to rescale to fractions, or "absolute" to keep raw outputs.