R/03_NB_based_cell_comparison.R
cellcharter_clust.RdCellCharter 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
)a Seurat object containing Kandinsky data
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.
numeric, number of expected clusters. Can be a single number or a numeric vector if multiple cluster numbers needs to be tested
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'.
boolean, whether molecular data still needs to be normalized. Default is TRUE.
numeric, random seed.
path of python environment with CellCharter and its dependencies installed
boolean, whether to use neighbour network pre-computed by Kandinsky instead of default CellCharter Delaunay network. Default is TRUE.
name of dimension reduction embedding to use for CellCharter clustering. If NULL, the function will call SCVI through reticulate. Default is NULL.
numeric, maximum number of repetitions for each value of number of clusters.
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.
updated Seurat object with 'cellcharter_clusters' annotation added to metadata slot
CellCharter must be installed within a python environment together with its dependencies (squidpy,scanpy,scvi)