Skip to main content
Glama

leiden

Detect communities in network data using the Leiden clustering algorithm. Adjust resolution, weights, and iterations for precise clustering. Supports directed/undirected graphs and customizable parameters for accurate analysis.

Instructions

Leiden clustering algorithm for community detection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clustering_argsNoAny further arguments to pass to the clustering algorithm.
directedNoWhether to treat the graph as directed or undirected.
flavorNoWhich package's implementation to use.igraph
key_addedNo`adata.obs` key under which to add the cluster labels.leiden
n_iterationsNoHow many iterations of the Leiden clustering algorithm to perform. -1 runs until optimal clustering.
neighbors_keyNoUse neighbors connectivities as adjacency. If specified, leiden looks .obsp[.uns[neighbors_key]['connectivities_key']] for connectivities.
obspNoUse .obsp[obsp] as adjacency. You can't specify both `obsp` and `neighbors_key` at the same time.
random_stateNoChange the initialization of the optimization.
resolutionNoA parameter value controlling the coarseness of the clustering. Higher values lead to more clusters.
use_weightsNoIf `True`, edge weights from the graph are used in the computation (placing more emphasis on stronger edges).

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/huang-sh/scmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server