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
Name | Required | Description | Default |
---|---|---|---|
clustering_args | No | Any further arguments to pass to the clustering algorithm. | |
directed | No | Whether to treat the graph as directed or undirected. | |
flavor | No | Which package's implementation to use. | igraph |
key_added | No | `adata.obs` key under which to add the cluster labels. | leiden |
n_iterations | No | How many iterations of the Leiden clustering algorithm to perform. -1 runs until optimal clustering. | |
neighbors_key | No | Use neighbors connectivities as adjacency. If specified, leiden looks .obsp[.uns[neighbors_key]['connectivities_key']] for connectivities. | |
obsp | No | Use .obsp[obsp] as adjacency. You can't specify both `obsp` and `neighbors_key` at the same time. | |
random_state | No | Change the initialization of the optimization. | |
resolution | No | A parameter value controlling the coarseness of the clustering. Higher values lead to more clusters. | |
use_weights | No | If `True`, edge weights from the graph are used in the computation (placing more emphasis on stronger edges). |
Input Schema (JSON Schema)
{
"description": "Input schema for the Leiden clustering algorithm.",
"properties": {
"clustering_args": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Any further arguments to pass to the clustering algorithm.",
"title": "Clustering Args"
},
"directed": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether to treat the graph as directed or undirected.",
"title": "Directed"
},
"flavor": {
"default": "igraph",
"description": "Which package's implementation to use.",
"enum": [
"leidenalg",
"igraph"
],
"title": "Flavor",
"type": "string"
},
"key_added": {
"default": "leiden",
"description": "`adata.obs` key under which to add the cluster labels.",
"title": "Key Added",
"type": "string"
},
"n_iterations": {
"default": -1,
"description": "How many iterations of the Leiden clustering algorithm to perform. -1 runs until optimal clustering.",
"title": "N Iterations",
"type": "integer"
},
"neighbors_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Use neighbors connectivities as adjacency. If specified, leiden looks .obsp[.uns[neighbors_key]['connectivities_key']] for connectivities.",
"title": "Neighbors Key"
},
"obsp": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Use .obsp[obsp] as adjacency. You can't specify both `obsp` and `neighbors_key` at the same time.",
"title": "Obsp"
},
"random_state": {
"default": 0,
"description": "Change the initialization of the optimization.",
"title": "Random State",
"type": "integer"
},
"resolution": {
"default": 1,
"description": "A parameter value controlling the coarseness of the clustering. Higher values lead to more clusters.",
"title": "Resolution",
"type": "number"
},
"use_weights": {
"default": true,
"description": "If `True`, edge weights from the graph are used in the computation (placing more emphasis on stronger edges).",
"title": "Use Weights",
"type": "boolean"
}
},
"title": "LeidenModel",
"type": "object"
}