API#

Import Harreman as:

import harreman

Datasets#

datasets.load_visium_mouse_colon_dataset

Load the mouse colon 10x Visium dataset.

datasets.load_slide_seq_human_lung_dataset

Load the human lung Slide-seq dataset.

Hotspot functions for metabolic zonation#

hotspot.load_metabolic_genes

Load the list of metabolic genes for a given species.

hotspot.compute_local_autocorrelation

Computes gene-level spatial autocorrelation statistics using spatial weights and centered gene expression values.

hotspot.compute_local_correlation

Computes pairwise local correlation between selected genes using a spatial weight matrix.

hotspot.create_modules

Perform hierarchical clustering on gene-gene local correlation Z-scores to assign gene modules.

hotspot.calculate_module_scores

Calculate module scores for gene modules across cells.

hotspot.compute_top_scoring_modules

Identify the top-scoring module (or super-module) for each cell.

hotspot.calculate_super_module_scores

Calculate super-module scores for gene super-modules across cells.

Interaction database#

preprocessing.extract_interaction_db

Extract the metabolite transporter or ligand-receptor (LR) database from .csv files.

Setting up deconvolution AnnData#

preprocessing.setup_deconv_adata

Set up deconvolution AnnData.

Metabolic crosstalk#

tools.compute_knn_graph

Computes the spatial proximity graph.

tools.apply_gene_filtering

Applies multi-step gene filtering to an AnnData object.

tools.compute_gene_pairs

Identifies biologically plausible gene pairs involved in ligand-receptor (LR) signaling or metabolite transport based on annotated interaction databases and filtered expression data.

tools.compute_cell_communication

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.

tools.compute_ct_cell_communication

Computes cell type-aware cell-cell communication (CCC) scores by stratifying communication by interacting cell type pairs.

tools.select_significant_interactions

Select significant gene pairs or metabolite-mediated interactions based on FDR/p-value thresholds and (optionally) cell-type–aware tests.

tools.compute_interacting_cell_scores

Compute interacting cell scores for gene pairs and metabolites.

tools.compute_ct_interacting_cell_scores

Compute cell-type–aware interacting cell scores for gene pairs and metabolites.

tools.compute_interaction_module_correlation

Compute correlations between interacting cell scores and module scores.

Visualization#

plots.local_correlation_plot

Plot a hierarchical-clustered heatmap of pairwise correlation Z-scores.

plots.average_local_correlation_plot

Plot the average pairwise correlation Z-scores between modules.

plots.module_score_correlation_plot

Plot correlations between module scores across cells.

plots.plot_interacting_cell_scores

Plot spatial maps of interacting cell scores for selected gene pairs or metabolites.

plots.plot_ct_interacting_cell_scores

Plot cell-type–specific interacting cell scores (for gene pairs or metabolites) across spatial coordinates.

Reading/writing functions#

read_h5ad

Load an AnnData object from disk and restore Harreman-specific metadata.

write_h5ad

Save an AnnData object to disk with Harreman-compatible preprocessing.