API#
Import Harreman as:
import harreman
Datasets#
Load the mouse colon 10x Visium dataset. |
|
Load the human lung Slide-seq dataset. |
Hotspot functions for metabolic zonation#
Load the list of metabolic genes for a given species. |
|
Computes gene-level spatial autocorrelation statistics using spatial weights and centered gene expression values. |
|
Computes pairwise local correlation between selected genes using a spatial weight matrix. |
|
Perform hierarchical clustering on gene-gene local correlation Z-scores to assign gene modules. |
|
Calculate module scores for gene modules across cells. |
|
Identify the top-scoring module (or super-module) for each cell. |
|
Calculate super-module scores for gene super-modules across cells. |
Interaction database#
Extract the metabolite transporter or ligand-receptor (LR) database from .csv files. |
Setting up deconvolution AnnData#
Set up deconvolution AnnData. |
Metabolic crosstalk#
Computes the spatial proximity graph. |
|
Applies multi-step gene filtering to an AnnData object. |
|
Identifies biologically plausible gene pairs involved in ligand-receptor (LR) signaling or metabolite transport based on annotated interaction databases and filtered expression data. |
|
Computes spatially-informed cell-type-agnostic cell-cell communication (CCC) scores and significance across all gene pairs using both parametric and non-parametric statistical tests. |
|
Computes cell type-aware cell-cell communication (CCC) scores by stratifying communication by interacting cell type pairs. |
|
Select significant gene pairs or metabolite-mediated interactions based on FDR/p-value thresholds and (optionally) cell-type–aware tests. |
|
Compute interacting cell scores for gene pairs and metabolites. |
|
Compute cell-type–aware interacting cell scores for gene pairs and metabolites. |
|
Compute correlations between interacting cell scores and module scores. |
Visualization#
Plot a hierarchical-clustered heatmap of pairwise correlation Z-scores. |
|
Plot the average pairwise correlation Z-scores between modules. |
|
Plot correlations between module scores across cells. |
|
Plot spatial maps of interacting cell scores for selected gene pairs or metabolites. |
|
Plot cell-type–specific interacting cell scores (for gene pairs or metabolites) across spatial coordinates. |
Reading/writing functions#
Load an AnnData object from disk and restore Harreman-specific metadata. |
|
Save an AnnData object to disk with Harreman-compatible preprocessing. |