cluster cells using a NN-network and the Louvain algorithm.
doLouvainCluster(
gobject,
spat_unit = NULL,
feat_type = NULL,
version = c("community", "multinet"),
name = "louvain_clus",
nn_network_to_use = "sNN",
network_name = "sNN.pca",
python_path = NULL,
resolution = 1,
weight_col = NULL,
gamma = 1,
omega = 1,
louv_random = FALSE,
return_gobject = TRUE,
set_seed = FALSE,
seed_number = 1234,
...
)
giotto object
spatial unit (e.g. "cell")
feature type (e.g. "rna", "dna", "protein")
implemented version of Louvain clustering to use
name for cluster, default to "louvain_clus"
type of NN network to use (kNN vs sNN), default to "sNN"
name of NN network to use, default to "sNN.pca"
[community] specify specific path to python if required
[community] resolution, default = 1
weight column name
[multinet] Resolution parameter for modularity in the generalized louvain method, default = 1
[multinet] Inter-layer weight parameter in the generalized louvain method, default = 1
[community] Will randomize the node evaluation order and the community evaluation order to get different partitions at each call (default = FALSE)
boolean: return giotto object (default = TRUE)
set seed (default = FALSE)
number for seed
arguments passed to .doLouvainCluster_community
or
.doLouvainCluster_multinet
giotto object with new clusters appended to cell metadata
Louvain clustering using the community or multinet implementation of the louvain clustering algorithm.
g <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 3.1 read Giotto spatial shape information
#> 3.2 read Giotto spatial centroid information
#> 3.3 read Giotto spatial overlap information
#> 4. read Giotto image information
#>
#> checking default envname 'giotto_env'
#> a system default python environment was found
#> Using python path:
#> "/usr/bin/python3"
doLouvainCluster(g)
#> Error in py_run_file_impl(file, local, convert): ModuleNotFoundError: No module named 'community'
#> Run `reticulate::py_last_error()` for details.