R/03_NB_based_cell_comparison.R
spatialleiden_clust.RdSpatialLeiden is called thrugh reticulate and interacts with Seurat/Kandinsky object after anndata conversion with anndataR
spatialleiden_clust(
data = NULL,
n_clust = NULL,
nfeatures = 2000,
seed = 347548,
python_path = NULL,
resolution = 1,
embedding = NULL,
layer_ratio = 1.5
)a Seurat object containing Kandinsky data
numeric, number of expected clusters
numeric, number of variable features to use for dimensionality reduction (PCA)
numeric, random seed
path of python environment with SpatialLeiden and its dependencies installed
numeric, resolution for the latent space and spatial layer, respectively.
name of dimension reduction embedding to use for SpatialLeiden clustering. If NULL, the function will run PCA with scanpy through reticulate. Default is NULL.
numeric, the ratio of the weighting of the layers; latent space vs spatial. A higher ratio will increase relevance of the spatial neighbors and lead to more spatially homogeneous clusters
updated Seurat object with 'spatialleiden_clusters' annotation added to metadata slot
SpatialLeiden must be installed within a python environment together with its dependencies (squidpy,scanpy,leidenalg)