neighbors
Compute nearest neighbors distance matrices and construct neighborhood graphs for single-cell RNA sequencing data analysis. Supports customizable parameters for manifold approximation, distance metrics, and kNN search methods.
Instructions
Compute nearest neighbors distance matrix and neighborhood graph
Input Schema
Name | Required | Description | Default |
---|---|---|---|
key_added | No | Key prefix for storing neighbor results. | |
knn | No | Whether to use hard threshold for neighbor restriction. | |
method | No | Method for computing connectivities ('umap' or 'gauss'). | umap |
metric | No | Distance metric to use. | euclidean |
metric_kwds | No | Options for the distance metric. | |
n_neighbors | No | Size of local neighborhood used for manifold approximation. | |
n_pcs | No | Number of PCs to use. If None, automatically determined. | |
random_state | No | Random seed for reproducibility. | |
transformer | No | Approximate kNN search implementation ('pynndescent' or 'rapids'). | |
use_rep | No | Key for .obsm to use as representation. |
Input Schema (JSON Schema)
{
"description": "Input schema for the neighbors graph construction tool.",
"properties": {
"key_added": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Key prefix for storing neighbor results.",
"title": "Key Added"
},
"knn": {
"default": true,
"description": "Whether to use hard threshold for neighbor restriction.",
"title": "Knn",
"type": "boolean"
},
"method": {
"default": "umap",
"description": "Method for computing connectivities ('umap' or 'gauss').",
"enum": [
"umap",
"gauss"
],
"title": "Method",
"type": "string"
},
"metric": {
"default": "euclidean",
"description": "Distance metric to use.",
"title": "Metric",
"type": "string"
},
"metric_kwds": {
"additionalProperties": true,
"description": "Options for the distance metric.",
"title": "Metric Kwds",
"type": "object"
},
"n_neighbors": {
"default": 15,
"description": "Size of local neighborhood used for manifold approximation.",
"exclusiveMinimum": 1,
"maximum": 100,
"title": "N Neighbors",
"type": "integer"
},
"n_pcs": {
"anyOf": [
{
"minimum": 0,
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Number of PCs to use. If None, automatically determined.",
"title": "N Pcs"
},
"random_state": {
"default": 0,
"description": "Random seed for reproducibility.",
"title": "Random State",
"type": "integer"
},
"transformer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Approximate kNN search implementation ('pynndescent' or 'rapids').",
"title": "Transformer"
},
"use_rep": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Key for .obsm to use as representation.",
"title": "Use Rep"
}
},
"title": "NeighborsModel",
"type": "object"
}