grassp.pp.neighbors

Contents

grassp.pp.neighbors#

neighbors(data, layer=None, copy=False, **kwargs)[source]#

Compute the nearest neighbors distance matrix using scanpy.pp.neighbors.

This function is a wrapper around scanpy.pp.neighbors() scanpy.pp.neighbors adding support for using different layers.

Parameters:
data

The annotated data matrix with proteins as observations (rows).

layer default: None

Layer to use for nearest neighbors calculation.

copy bool (default: False)

Return a copy with the neighbors graph instead of writing it to data.

**kwargs

Additional arguments to pass to scanpy.pp.neighbors.

Return type:

AnnData | None

Returns:

A copy of data with the neighbors graph if copy=True, else None.