scanpy.api.Neighbors

class scanpy.api.Neighbors(adata, n_dcs=None)

Data represented as graph of nearest neighbors.

Represent a data matrix as a graph of nearest neighbor relations (edges) among data points (nodes).

Parameters:
adata : AnnDataAnnData

Annotated data object.

n_dcs : int, NoneOptional[int]

Number of diffusion components to use.

Attributes

connectivities Connectivities between data points (sparse matrix).
distances Distances between data points (sparse matrix).
distances_dpt DPT distances (on-fly matrix).
eigen_basis Eigen basis of transition matrix (numpy array).
eigen_values Eigen values of transition matrix (numpy array).
getdoc
laplacian Graph laplacian (sparse matrix).
transitions Transition matrix (sparse matrix).
transitions_sym Symmetrized transition matrix (sparse matrix).

Methods

compute_eigen([n_comps, sym, sort]) Compute eigen decomposition of transition matrix.
compute_neighbors([n_neighbors, knn, n_pcs, …]) Compute distances and connectivities of neighbors.
compute_transitions([density_normalize]) Compute transition matrix.
to_igraph() Generate igraph from connectiviies.