rapids_singlecell.gr.neighbors.GraphBuilderCSR#
- class rapids_singlecell.gr.neighbors.GraphBuilderCSR(transform=None, set_diag=False, percentile=None, postprocessors=())[source]#
CuPy CSR strategy that builds from finite float32 coordinates.
- Parameters:
- transform
str|None(default:None) Transform setting stored on the builder:
None,"spectral", or"cosine". Subclasses or postprocessors implement its effect.- set_diag
bool(default:False) Diagonal setting stored on the builder for use by subclasses.
- percentile
float|None(default:None) Distance percentile setting stored on the builder for use by subclasses or postprocessors.
Nonedisables percentile pruning.- postprocessors
Sequence[Callable[[csr_matrix,csr_matrix],tuple[csr_matrix,csr_matrix]]] (default:()) Ordered callables taking connectivity and distance matrices and returning the processed pair. Custom builders control which steps are applied.
- transform
Methods table#
build(coords)Validate
coordsand build the(adjacency, distances)graphs.build_graph(coords)Construct raw adjacency and distance matrices.
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#
- abstractmethod build_graph(coords)[source]#
Construct raw adjacency and distance matrices.
- Parameters:
- coords
ndarray Coordinates in the format supported by this builder.
- coords
- Return type:
- Returns:
connectivities, distances Raw graph matrices before postprocessing.
- 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.