API

Preprocessing: pp

pp.MetaChatDB([species])

Extract metabolite-sensor pairs from MetaChatDB.

pp.generate_adata_met_compass(compass_output)

Generate processed metabolite matrix for COMPASS analysis using reaction-level penalty scores.

pp.generate_adata_met_scFEA(data_path)

Generate processed metabolite matrix for scFEA analysis.

pp.generate_adata_met_mebocost(data_path)

Generate processed metabolite matrix for scFEA analysis.

pp.global_intensity_scaling(adata_ref, ...)

Perform global intensity scaling of adata_target to match adata_ref, using either total ion current (TIC) or root-mean-square (RMS) normalization.

pp.load_barrier_segments([csv_path, ...])

Parse Napari shapes CSV and extract barrier line segments.

pp.LRC_unfiltered(adata[, LRC_name, ...])

Identify unfiltered candidate LRC (long-range channel) spots based on the quantile of a marker feature.

pp.LRC_cluster(adata[, LRC_name, ...])

Perform local density clustering on unfiltered LRC candidate points.

pp.LRC_filtered(adata[, LRC_name, ...])

Assign final LRC (long-range channel) clusters after local density clustering.

pp.compute_costDistance(adata[, LRC_type, ...])

Compute LRC-embedding cost distance based on visibility and local connectivity, supporting both 2D and 3D spatial coordinates.

Tools: tl

tl.metabolic_communication(adata[, ...])

Infer spatial metabolic cell communication (MCC) using the Flow Optimal Transport (FOT) framework.

tl.summary_communication(adata[, ...])

Summarize communication signals by metabolite sets, pathways, or custom lists.

tl.communication_flow(adata[, ...])

Construct spatial vector fields representing metabolic communication flow.

tl.communication_group(adata[, ...])

Summarize metabolic communication to group-level MCC and compute p-values via label permutation.

tl.communication_group_spatial(adata[, ...])

Function for summarizing metabolic MCC communication to group-level communication and computing p-values based on spatial distance distribution.

tl.summary_pathway(adata[, database_name, ...])

Summarize MCC (Metabolite–Sensor Communication) patterns between specific sender and receiver groups, and rank metabolic and sensor pathways.

tl.communication_responseGenes(adata, adata_raw)

Identify signal-dependent genes responding to MCC communication patterns.

tl.communication_responseGenes_cluster(...)

Function for cluster the communcation DE genes based on their fitted expression pattern.

tl.communication_responseGenes_keggEnrich([...])

Function for performing KEGG enrichment analysis on a given list of response genes.

tl.compute_direction_histogram_per_pair(...)

Compute per-pair directional histograms for MCC vector fields.

Plotting: pl

pl.plot_communication_flow(adata, database_name)

Visualize inferred metabolic communication vector fields on tissue images or annotated backgrounds.

pl.plot_group_communication_chord(adata[, ...])

Plot a chord diagram representing group-level metabolic cell communication (MCC).

pl.plot_group_communication_heatmap(adata[, ...])

Plot a heatmap diagram for group-level metabolic cell communication (MCC).

pl.plot_group_communication_compare_hierarchy_diagram(...)

Plot a hierarchy-style diagram comparing group-level MCC between two conditions.

pl.plot_MSpair_contribute_group(adata[, ...])

Plot a heatmap showing group-level contributions of metabolite–sensor pairs for a specific metabolite.

pl.plot_summary_pathway([ms_result, ...])

Plot a Sankey diagram summarizing metabolic cell communication between metabolite and sensor pathways.

pl.plot_metapathway_pair_contribution_bubbleplot(...)

Plot a bubble chart showing metabolite–sensor contributions for a selected metabolic pathway.

pl.plot_communication_responseGenes(df_deg, ...)

Plot the smoothed gene expression profiles of metabolic cell communication response genes.

pl.plot_communication_responseGenes_keggEnrich(...)

Plot a horizontal bar chart summarizing KEGG enrichment results of MCC response genes.

pl.plot_DEG_volcano(deg_result[, name_col, ...])

Plot a volcano plot from differential MCC results.

pl.plot_3d_feature(adata, feature[, ...])

Visualize a spatial feature (gene or obs annotation) in 3D using Plotly.

pl.plot_3d_LRC_with_two_slices(adata, mask_key)

Visualize 3D long-range channels (LRCs) with two representative z-slice views.

pl.plot_dis_thr(adata, dis_thr, spot_index)

Visualize spatial neighborhood within a specified distance threshold around a selected spot.

pl.plot_LRC_markers(adata, LRC_name, ...[, ...])

Visualize expression of LRC (Long-Range Channel) marker genes in spatial omics data.

pl.plot_spot_distance(adata, ...[, figsize, ...])

Visualize the spatial distance from a selected spot to all other spots.

pl.plot_graph_connectivity(G[, node_size, ...])

Plot a 2D visualization of a graph showing connectivity between nodes and edges.

pl.plot_direction_similarity(df_direction, ...)

Plot a block-ordered similarity heatmap for direction-based flow clusters.