Plots for metabolism pathway scoring
Arguments
- srt
A Seurat object containing the results of RunMetabolism.
- res
GSVA results generated by RunGSVA function. If provided, 'srt' and 'group.by' are ignored.
- group.by
A character vector specifying the grouping variable used in RunMetabolism.
- assay_name
The name of the assay or tools slot containing metabolism results. Default is
"METABOLISM".- ...
Additional arguments passed to GSVAPlot.
Examples
data(pancreas_sub)
pancreas_sub <- standard_scop(pancreas_sub)
#> ℹ [2026-03-20 09:06:19] Start standard scop workflow...
#> ℹ [2026-03-20 09:06:19] Checking a list of <Seurat>...
#> ! [2026-03-20 09:06:19] Data 1/1 of the `srt_list` is "unknown"
#> ℹ [2026-03-20 09:06:19] Perform `NormalizeData()` with `normalization.method = 'LogNormalize'` on 1/1 of `srt_list`...
#> ℹ [2026-03-20 09:06:21] Perform `Seurat::FindVariableFeatures()` on 1/1 of `srt_list`...
#> ℹ [2026-03-20 09:06:22] Use the separate HVF from `srt_list`
#> ℹ [2026-03-20 09:06:22] Number of available HVF: 2000
#> ℹ [2026-03-20 09:06:22] Finished check
#> ℹ [2026-03-20 09:06:22] Perform `Seurat::ScaleData()`
#> ℹ [2026-03-20 09:06:23] Perform pca linear dimension reduction
#> ℹ [2026-03-20 09:06:23] Perform `Seurat::FindClusters()` with `cluster_algorithm = 'louvain'` and `cluster_resolution = 0.6`
#> ℹ [2026-03-20 09:06:24] Reorder clusters...
#> ℹ [2026-03-20 09:06:24] Perform umap nonlinear dimension reduction
#> ℹ [2026-03-20 09:06:24] Perform umap nonlinear dimension reduction using Standardpca (1:50)
#> ℹ [2026-03-20 09:06:28] Perform umap nonlinear dimension reduction using Standardpca (1:50)
#> ✔ [2026-03-20 09:06:31] Run scop standard workflow completed
pancreas_sub <- RunMetabolism(
pancreas_sub,
db = c("KEGG", "REACTOME"),
group.by = "CellType",
species = "Mus_musculus",
method = "AUCell"
)
#> ℹ [2026-03-20 09:06:31] Start metabolism pathway scoring
#> ℹ [2026-03-20 09:06:32] Data type is raw counts
#> ℹ [2026-03-20 09:06:32] Averaging expression by "CellType" ...
#> ℹ [2026-03-20 09:06:32] Aggregated expression: 15998 genes x 5 groups
#> ℹ [2026-03-20 09:06:32] Species: "Mus_musculus"
#> ℹ [2026-03-20 09:06:32] Preparing KEGG database
#> ℹ [2026-03-20 09:06:46] Preparing Reactome database
#> ℹ [2026-03-20 09:06:51] Convert ID types for the KEGG database
#> ℹ [2026-03-20 09:06:51] Connect to the Ensembl archives...
#> ℹ [2026-03-20 09:06:51] Using the 115 version of ensembl database...
#> ℹ [2026-03-20 09:06:51] Downloading the ensembl database from https://sep2025.archive.ensembl.org...
#> ℹ [2026-03-20 09:06:54] Searching the dataset mmusculus ...
#> ℹ [2026-03-20 09:06:54] Connecting to the dataset mmusculus_gene_ensembl ...
#> ℹ [2026-03-20 09:06:57] Converting the geneIDs...
#> ! [2026-03-20 09:07:00] <simpleError in .processResults(postRes, mart = mart, hostURLsep = sep, fullXmlQuery = fullXmlQuery, quote = quote, numAttributes = length(attributes)): Query ERROR: caught BioMart::Exception::Database: Could not connect to mysql database ensembl_mart_115: DBI connect('database=ensembl_mart_115;host=127.0.0.1;port=5316','ensro',...) failed: Can't connect to MySQL server on '127.0.0.1' (111) at /nfs/public/ro/ensweb/live/mart/www_115/biomart-perl/lib/BioMart/Configuration/DBLocation.pm line 98.
#> ! >
#> ! [2026-03-20 09:07:00] Get errors when retrieving information from the BioMart database
#> ! [2026-03-20 09:07:01] Retrying...
#> ℹ [2026-03-20 09:07:03] 10581 genes mapped with "entrez_id"
#> ℹ [2026-03-20 09:07:03] ==============================
#> ℹ 10581 genes mapped
#> ℹ 573 genes unmapped
#> ℹ ==============================
#> ℹ [2026-03-20 09:07:07] Convert ID types for the Reactome database
#> ℹ [2026-03-20 09:07:07] Connect to the Ensembl archives...
#> ℹ [2026-03-20 09:07:07] Using the 115 version of ensembl database...
#> ℹ [2026-03-20 09:07:07] Downloading the ensembl database from https://sep2025.archive.ensembl.org...
#> ℹ [2026-03-20 09:07:08] Searching the dataset mmusculus ...
#> ℹ [2026-03-20 09:07:08] Connecting to the dataset mmusculus_gene_ensembl ...
#> ℹ [2026-03-20 09:07:11] Converting the geneIDs...
#> ℹ [2026-03-20 09:07:54] 8776 genes mapped with "entrez_id"
#> ℹ [2026-03-20 09:07:54] ==============================
#> ℹ 8776 genes mapped
#> ℹ 4 genes unmapped
#> ℹ ==============================
#> ℹ [2026-03-20 09:07:57] Total metabolism gene sets to score: 109
#> ✔ [2026-03-20 09:08:23] Metabolism scores stored in tools slot "Metabolism_CellType_AUCell"
ht <- MetabolismPlot(
pancreas_sub,
group.by = "CellType",
plot_type = "heatmap",
topTerm = 10,
width = 1,
height = 2
)
#> Warning: Data is of class matrix. Coercing to dgCMatrix.
ht2 <- MetabolismPlot(
pancreas_sub,
group.by = "CellType",
plot_type = "heatmap",
n_split = 3,
topTerm = 100,
use_raster = TRUE,
width = 1,
height = 2
)
#> Warning: Data is of class matrix. Coercing to dgCMatrix.
MetabolismPlot(
pancreas_sub,
group.by = "CellType",
db = "GO_BP",
plot_type = "comparison",
topTerm = 5
)
MetabolismPlot(
pancreas_sub,
group.by = "CellType",
db = "GO_BP",
group_use = "Ductal",
plot_type = "bar",
topTerm = 5
)
MetabolismPlot(
pancreas_sub,
group.by = "CellType",
group_use = "Ductal",
db = "GO_BP",
plot_type = "network",
topTerm = 3
)
#> ✔ [2026-03-20 09:08:27] shadowtext installed successfully
MetabolismPlot(
pancreas_sub,
group.by = "CellType",
group_use = "Ductal",
db = "GO_BP",
plot_type = "enrichmap"
)
MetabolismPlot(
pancreas_sub,
group.by = "CellType",
group_use = "Ductal",
plot_type = "wordcloud",
word_type = "feature"
)
pancreas_sub <- RunMetabolism(
pancreas_sub,
assay_name = "METABOLISM",
db = c("KEGG", "REACTOME"),
species = "Mus_musculus"
)
#> ℹ [2026-03-20 09:08:31] Start metabolism pathway scoring
#> ℹ [2026-03-20 09:08:32] Data type is raw counts
#> ℹ [2026-03-20 09:08:32] Species: "Mus_musculus"
#> ℹ [2026-03-20 09:08:32] Loading cached: KEGG version: Release 117.0+/03-20, Mar 26 nterm:366 created: 2026-03-20 09:07:07
#> ℹ [2026-03-20 09:08:33] Loading cached: Reactome version: 1.95.0 nterm:1815 created: 2026-03-20 09:07:57
#> ℹ [2026-03-20 09:08:33] Total metabolism gene sets to score: 109
#> ✔ [2026-03-20 09:08:38] Metabolism scores stored in tools slot "Metabolism_AUCell"
#> ℹ [2026-03-20 09:08:38] Metabolism scores also stored in assay "METABOLISM"
FeatureDimPlot(
pancreas_sub,
assay = "METABOLISM",
features = rownames(pancreas_sub[["METABOLISM"]])[1:2],
reduction = "umap"
)
FeatureStatPlot(
pancreas_sub,
stat.by = rownames(pancreas_sub[["METABOLISM"]])[1:2],
group.by = "CellType",
assay = "METABOLISM"
)
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's colour values.
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's colour values.
ht <- GroupHeatmap(
pancreas_sub,
exp_legend_title = "Z-score",
features = rownames(pancreas_sub[["METABOLISM"]])[1:10],
group.by = "CellType",
assay = "METABOLISM",
width = 1,
height = 2
)
#> ! [2026-03-20 09:08:39] The values in the "counts" layer are non-integer. Set the library size to "1"