Runs Leiden community detection algorithm to detect clusters.
cluster_leiden(fsce, expt = "rnaseq", method = "PCA", dims = 1:5, prune = 1/15, seed = NULL, partition_type = "ModularityVertexPartition", ...)
fsce | An object of class |
---|---|
expt | Data to use for calculating variable features
(default is |
method | dimensionality reduction method for clustering (defaults to PCA) |
dims | dimensions to use for nearest-neighbor calculation |
prune | Pruning parameter for shared nearest-neighbor calculation. |
seed | seed for |
partition_type | partitioning algorithm (see |
... | Parameters to pass to the Python |
https://github.com/vtraag/leidenalg
https://github.com/TomKellyGenetics/leiden
fsce with leiden_cluster
in expt
colData.
Execute install_py_deps()
to install required python modules leidenalg
and igraph
.
Other clustering functions: cluster_kmeans
# \donttest{ fsce_small <- cluster_leiden(fsce_small) SingleCellExperiment::colData(fsce_small[["rnaseq"]])#> DataFrame with 250 rows and 4 columns #> cell_id k_cluster leiden_cluster cell_cycle #> <character> <character> <character> <character> #> TGCGGGTGTAGAGTGC TGCGGGTGTAGAGTGC 2 2 S #> TGGTTCCCATCTATGG TGGTTCCCATCTATGG 6 4 S #> CATATTCCACGTCAGC CATATTCCACGTCAGC 2 2 G2M #> TCACAAGTCCTGCTTG TCACAAGTCCTGCTTG 5 3 G1 #> GGAATAATCCAGGGCT GGAATAATCCAGGGCT 4 4 G1 #> ... ... ... ... ... #> CTACGTCCACCACGTG CTACGTCCACCACGTG 6 1 G1 #> TGTGGTAAGGTGCTTT TGTGGTAAGGTGCTTT 3 6 G1 #> AGCGTCGGTCGAGTTT AGCGTCGGTCGAGTTT 3 6 G1 #> CTCGAAAAGTTCGATC CTCGAAAAGTTCGATC 6 5 G2M #> TGACAACGTCGCATAT TGACAACGTCGCATAT 6 4 S# }