squidpy.gr.neighbors.GraphBuilderCSR

class squidpy.gr.neighbors.GraphBuilderCSR(transform=None, set_diag=False, percentile=None, postprocessors=())[source]

CSR-based graph construction strategy.

Specializes GraphBuilder for sparse CSR matrix output. Adds SparseEfficiencyWarning suppression and multi-library library_key combination. Built-in concrete builders (KNNBuilder, RadiusBuilder, DelaunayBuilder, GridBuilder) inherit from this class and declare their postprocessors explicitly in __init__ using the reusable public postprocessor classes.

Subclass this (not the generic GraphBuilder) when implementing a builder that returns CSR matrices.

See also

GraphBuilder

Generic builder interface for custom coordinate/matrix types.

KNNBuilder

Example of a concrete CSR-based builder.

Methods

build(coords)

build_graph(coords)

Construct raw adjacency and distance matrices.

combine(mats, ixs)

Combine per-library results into a single graph.

postprocessors()

Return post-build processing steps for (adj, dst).

uns_params()

Parameters stored in anndata.AnnData.uns after graph construction.