runLeiden: Run Leiden clustering algorithm This code is modified from...

Description Usage Arguments Value

View source: R/scAI_model.R

Description

Implements the Leiden clustering algorithm in R using reticulate to run the Python version. Requires the python "leidenalg" and "igraph" modules to be installed. Returns a vector of partition indices.

Usage

1
2
3
4
5
6
runLeiden(SNN = matrix(), resolution = 1,
  partition_type = c("RBConfigurationVertexPartition",
  "ModularityVertexPartition", "RBERVertexPartition", "CPMVertexPartition",
  "MutableVertexPartition", "SignificanceVertexPartition",
  "SurpriseVertexPartition"), seed.use = 42L, n.iter = 10L,
  initial.membership = NULL, weights = NULL, node.sizes = NULL)

Arguments

SNN

An adjacency matrix compatible with igraph object.

resolution

A parameter controlling the coarseness of the clusters

partition_type

Type of partition to use. Defaults to RBConfigurationVertexPartition. Options include: ModularityVertexPartition, RBERVertexPartition, CPMVertexPartition, MutableVertexPartition, SignificanceVertexPartition, SurpriseVertexPartition (see the Leiden python module documentation for more details)

seed.use

set seed

n.iter

number of iteration

initial.membership

arameters to pass to the Python leidenalg function defaults initial_membership=None

weights

defaults weights=None

node.sizes

Parameters to pass to the Python leidenalg function

Value

A parition of clusters as a vector of integers


sqjin/scAI documentation built on Nov. 19, 2020, 4:04 p.m.