SpatialLeiden 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
)

Arguments

data

a Seurat object containing Kandinsky data

n_clust

numeric, number of expected clusters

nfeatures

numeric, number of variable features to use for dimensionality reduction (PCA)

seed

numeric, random seed

python_path

path of python environment with SpatialLeiden and its dependencies installed

resolution

numeric, resolution for the latent space and spatial layer, respectively.

embedding

name of dimension reduction embedding to use for SpatialLeiden clustering. If NULL, the function will run PCA with scanpy through reticulate. Default is NULL.

layer_ratio

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

Value

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

Details

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