Skip to contents

Wraps find_clusters_sc() as an ScStep.

Usage

step_clusters_sc(
  cluster_algorithm = c("leiden", "louvain"),
  res = 1,
  name = NULL,
  modality = c("rna", "adt", "atac", "wnn"),
  seed = 42L,
  ...
)

Arguments

cluster_algorithm

String. One of c("leiden", "louvain").

res

Numeric. The modularity resolution parameter, see leiden_clustering().

name

Optional string. The name of the obs column to add. NULL gives "leiden_clustering" or "louvain_clustering", following cluster_algorithm.

modality

String. On which modality to cluster. One of c("rna", "adt", "atac", "wnn"). The two latter options are only available for multi-modal versions with the added data.

seed

Integer. For reproducibility.

...

Further parameters for leiden_clustering(): n_iterations, beta, min_gain, local_moving and node_order.

Value

An ScStep.

Examples

# Leiden over the graph the neighbours step wrote
step_neighbours_sc() %>>% step_clusters_sc(res = 0.5)
#> <ScPipeline> 2 steps
#>   1. neighbours  embd_to_use = "pca", no_embd_to_use = NULL, modality = c("rna", "adt", "atac"), neighbours_params = <list>, seed = 42L, .verbose = TRUE
#>   2. clusters    cluster_algorithm = c("leiden", "louvain"), res = 0.5, name = NULL, modality = c("rna", "adt", "atac", "wnn"), seed = 42L