napari_prism.gr.cellular_neighborhood_enrichment#
- napari_prism.gr.cellular_neighborhood_enrichment(adata, neighborhood, phenotype, label, grouping, pseudocount=0.001)#
Perform a cellular neighborhood enrichment test using OLS linear models.
- Parameters:
adata (
AnnData) – Annotated data object.neighborhood (
str) – Column in .obs that defines the neighborhood index or label that a cell belongs to.phenotype (
str) – Column in .obs that defines the cellular label to take into account. Ideally this should be the phenotype that was used to compute the givenneighborhood.label (
str) – Column in .obs that defines the binary label defining distinctgroupinggroups.grouping (
str) – Column in .obs that defines distinct samples.pseudo_count – Pseudocount to add to the log2 normalised proportions data. Defaults to 1e-3.
- Return type:
- Returns:
- Dictionary containing the p-values, adjusted p-values,
coefficients, t-values and null hypothesis rejection status. Each entry is a DataFrame with neighborhoods as rows and phenotypes as columns.