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

Arguments

gobject

giotto object

spat_unit

spatial unit (e.g. "cell")

feat_type

feature type (e.g. "rna", "dna", "protein")

version

implemented version of Louvain clustering to use

name

name for cluster, default to "louvain_clus"

nn_network_to_use

type of NN network to use (kNN vs sNN), default to "sNN"

network_name

name of NN network to use, default to "sNN.pca"

python_path

[community] specify specific path to python if required

resolution

[community] resolution, default = 1

weight_col

weight column name

gamma

[multinet] Resolution parameter for modularity in the generalized louvain method, default = 1

omega

[multinet] Inter-layer weight parameter in the generalized louvain method, default = 1

louv_random

[community] Will randomize the node evaluation order and the community evaluation order to get different partitions at each call (default = FALSE)

return_gobject

boolean: return giotto object (default = TRUE)

set_seed

set seed (default = FALSE)

seed_number

number for seed

...

arguments passed to .doLouvainCluster_community or .doLouvainCluster_multinet

Value

giotto object with new clusters appended to cell metadata

Details

Louvain clustering using the community or multinet implementation of the louvain clustering algorithm.

Examples

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
#> python already initialized in this session
#>  active environment : '/usr/bin/python3'
#>  python version : 3.10
#> 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.