bento.tl.fe¶
- bento.tl.fe(sdata, net, instance_key='cell_boundaries', source='source', target='target', weight='weight', batch_size=10000, min_n=0) SpatialData¶
Perform functional enrichment of RNAflux embeddings using decoupler’s wsum function.
- Parameters:
sdata (SpatialData) – SpatialData object.
net (pd.DataFrame) – DataFrame with columns for source, target, and weight. See decoupler API for more details.
instance_key (str, default “cell_boundaries”) – Key for the instance in sdata.points.
source (str, default “source”) – Column name for source nodes in net.
target (str, default “target”) – Column name for target nodes in net.
weight (str, default “weight”) – Column name for weights in net.
batch_size (int, default 10000) – Number of points to process in each batch.
min_n (int, default 0) – Minimum number of targets per source. If less, sources are removed.
- Returns:
Updated SpatialData object with: - Enrichment scores added to sdata.points[f”{instance_key}_raster”] - Enrichment statistics added to sdata.tables[“table”].uns[“fe_stats”] and sdata.tables[“table”].uns[“fe_ngenes”]
- Return type:
SpatialData