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", ...)

Arguments

fsce

An object of class FunctionalSingleCellExperiment

expt

Data to use for calculating variable features (default is rnaseq). Must be present in names(fsce).

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 leidenalg$find_partition()

partition_type

partitioning algorithm (see leiden::leiden). (defaults to "ModularityVertexPartition")

...

Parameters to pass to the Python leidenalg function.

Source

https://github.com/vtraag/leidenalg

https://github.com/TomKellyGenetics/leiden

Value

fsce with leiden_cluster in expt colData.

Details

Execute install_py_deps() to install required python modules leidenalg and igraph.

See also

Other clustering functions: cluster_kmeans

Examples

# \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
# }