scviva.tools.vision.pool_matrix_anndata#

scviva.tools.vision.pool_matrix_anndata(adata, pools=None, layer_key=None, uns_key='micro_clusters', result_uns_key='pool_expression')[source]#

Pool adata.X (or a layer) into per-micro-cluster mean expression.

Convenience wrapper around pool_matrix() that reads pools from adata.uns when pools is not provided explicitly.

Parameters:
adata AnnData

pools dict[str, list[str]] | None

Pool mapping. Reads from adata.uns[uns_key] when None.

layer_key str | None

Layer to pool. Uses adata.X when None.

uns_key str

Key in adata.uns for the pool mapping.

result_uns_key str

Key in adata.uns where the result is stored.

Return type:

ndarray

Returns:

ndarray of shape (n_pools, n_genes)