rapids_singlecell.gr.neighbors.DelaunayBuilder#
- class rapids_singlecell.gr.neighbors.DelaunayBuilder(radius=None, transform=None, set_diag=False, percentile=None)[source]#
Connect Delaunay neighbors; a scalar
radiusprunes to(0, radius).- Parameters:
- radius
float|tuple[float,float] |None(default:None) Optional distance cutoff. A scalar means
(0, radius); a pair specifies an inclusive interval.Nonekeeps all Delaunay edges.- transform
str|None(default:None) Connectivity transform:
None,"spectral"(normalization by column degrees), or"cosine"(similarity between connectivity rows). Applied after pruning and adding the requested diagonal; distances are unchanged.- set_diag
bool(default:False) Whether to set connectivity self-loops before transforming the graph. Distance diagonals are zero; cosine can create connectivity self-loops even when this is
False.- percentile
float|None(default:None) Prune edges above this distance percentile (0 to 100) independently per library, after radius pruning. Stored zeros, including the diagonal, contribute to the percentile.
Nonedisables percentile pruning.
- radius
Methods table#
build(coords)Validate
coordsand build the(adjacency, distances)graphs.build_graph(coords[, codes])Build raw graphs, independently within each library of
codes.combine(mats, ixs)Stack per-library graphs block-diagonally, in the original observation order
ixs.Return processing steps for the raw adjacency and distances.
Return graph parameters to store in
adata.uns.Methods#
- build_graph(coords, codes=None)[source]#
Build raw graphs, independently within each library of
codes.
- combine(mats, ixs)[source]#
Stack per-library graphs block-diagonally, in the original observation order
ixs.- Return type:
- postprocessors()[source]#
Return processing steps for the raw adjacency and distances.
- Return type:
Sequence[Callable[[csr_matrix,csr_matrix],tuple[csr_matrix,csr_matrix]]]- Returns:
Sequence of callables Steps applied in order to the connectivity and distance matrices.