Skip to contents

Constructs an interactive network for exploring spatial metabolomics and transcriptomics data.

Usage

PathwayNetworkPlots(
  SpaMTP,
  ident,
  regpathway,
  DE.list,
  selected_pathways = NULL,
  path = getwd(),
  SM_slot = "counts",
  ST_slot = "counts",
  colour_palette = NULL,
  SM_assay = "SPM",
  ST_assay = "SPT",
  analyte_types = c("genes", "metabolites"),
  image = "slice1",
  verbose = T
)

Arguments

SpaMTP

A SpaMTP Seurat object containing spatial metabolomics (SM) and/or spatial transcriptomics (ST) data. If SM data is included, it must be annotated using the SpaMTP::AnnotateSM() function.

ident

A character string specifying the cluster identifier used to group regions, corresponding to a column name in the SpaMTP@meta.data slot.

regpathway

A dataframe output from the SpaMTP::FindRegionalPathways() function, containing identified regional pathways.

DE.list

A list containing differential expression results from the FindAllMarkers() function, with items matching the order of the analyte_types argument.

selected_pathways

A character vector specifying the names or IDs of pathways used to construct the network (e.g., c("Amino acid metabolism", "WP1902", "Aspartate and asparagine metabolism")). This argument is not case-sensitive.

path

The directory to save the output. If not provided, the default is the current working directory.

SM_slot

The slot name containing the spatial metabolomics assay matrix (default: "counts").

ST_slot

The slot name containing the spatial transcriptomics assay matrix (default: "counts").

colour_palette

The color palette used to plot the spatial image in the output HTML file. Default: grDevices::colorRampPalette(rev(RColorBrewer::brewer.pal(11, "Spectral")))(100).

SM_assay

A character string specifying the assay name for spatial metabolomics data in SpaMTP to extract intensity values (default: "SPM").

ST_assay

A character string specifying the assay name for spatial transcriptomics data in SpaMTP to extract RNA count values (default: "SPT").

analyte_types

A subset of c("genes", "metabolites"). Can be c("genes"), c("metabolites"), or both.

image

Character string specifying which image stored within the SpaMTP object to use for plotting (default = "slice1").

verbose

A logical value indicating whether to display detailed messages during execution (default: FALSE).

Value

An interactive HTML file visualizing the network structure of the specified pathways.

Examples

#PathwayNetworkPlots(SpaMTP, ident = "Custom_ident", regpathway = regpathway, DE.list = DE.list, selected_pathways = selected_pathways)