CellCharter is called thrugh reticulate and interacts with Seurat/Kandinsky object after anndata conversion with anndataR

cellcharter_clust(
  data = NULL,
  sample_key = NULL,
  n_clust = 6:10,
  mode = c("rna", "protein"),
  preprocess = T,
  seed = 347548,
  python_path = NULL,
  use_kandinsky_nb = T,
  embedding = NULL,
  max_runs = 10,
  convergence_tol = 0.001
)

Arguments

data

a Seurat object containing Kandinsky data

sample_key

character string specifying a variable stored in the Seurat object to use as sample/batch annotation. If not NULL, neighbour networks will be defined separately for each sample/batch. Default is NULL.

n_clust

numeric, number of expected clusters. Can be a single number or a numeric vector if multiple cluster numbers needs to be tested

mode

molecular data type. Must be one between 'rna' and 'protein'. If set to 'rna', the function will expect to find integer count data. Default is 'rna'.

preprocess

boolean, whether molecular data still needs to be normalized. Default is TRUE.

seed

numeric, random seed.

python_path

path of python environment with CellCharter and its dependencies installed

use_kandinsky_nb

boolean, whether to use neighbour network pre-computed by Kandinsky instead of default CellCharter Delaunay network. Default is TRUE.

embedding

name of dimension reduction embedding to use for CellCharter clustering. If NULL, the function will call SCVI through reticulate. Default is NULL.

max_runs

numeric, maximum number of repetitions for each value of number of clusters.

convergence_tol

numeric, convergence tolerance for the clustering stability. If the Mean Absolute Percentage Error between consecutive iterations is below convergence_tol the algorithm stops without reaching max_runs.

Value

updated Seurat object with 'cellcharter_clusters' annotation added to metadata slot

Details

CellCharter must be installed within a python environment together with its dependencies (squidpy,scanpy,scvi)