
4-column master gene map: UMAP clusters + UMAP expression + Spatial clusters + Spatial expression
PlotMasterMaps.RdFor each gene, generates one PDF with one row per spatial image, and four columns: UMAP colored by clusters, UMAP colored by gene expression, spatial plot colored by clusters, and spatial plot colored by gene expression. A single pair of legends (categorical + continuous) is attached to the right.
Usage
PlotMasterMaps(
seurat_object,
features,
imgalpha = 1,
alpha = 1,
group.by = "seurat_clusters",
images_to_plot = NULL,
remove_outliers = FALSE,
outlier_prob = 0.01,
size_override = NULL,
calcptsizesc = 100,
colors = NULL,
gene_colors = c("#053061", "#2166AC", "#D1E5F0", "#FDDBC7", "#F4A582", "#D6604D",
"#B2182B", "#67001F"),
legend.side = "right",
legend.direction = "vertical",
output_dir = NULL,
object_name = "",
subset_name = "",
file_name = NULL,
width = NULL,
height = NULL,
timestamp = FALSE,
cluster_col = NULL,
cluster_colors = NULL
)
GenerateMasterGeneMaps(
seurat_object,
features,
imgalpha = 1,
alpha = 1,
group.by = "seurat_clusters",
images_to_plot = NULL,
remove_outliers = FALSE,
outlier_prob = 0.01,
size_override = NULL,
calcptsizesc = 100,
colors = NULL,
gene_colors = c("#053061", "#2166AC", "#D1E5F0", "#FDDBC7", "#F4A582", "#D6604D",
"#B2182B", "#67001F"),
legend.side = "right",
legend.direction = "vertical",
output_dir = NULL,
object_name = "",
subset_name = "",
file_name = NULL,
width = NULL,
height = NULL,
timestamp = FALSE,
cluster_col = NULL,
cluster_colors = NULL
)Arguments
- seurat_object
A Seurat object with both
"umap"reduction and spatial images.- features
Character vector of gene names.
- imgalpha
Numeric. Tissue image transparency. Default
1.- alpha
Numeric. Spot transparency. Default
1.- group.by
Character (or vector). Metadata column(s) for cluster coloring. Default
"seurat_clusters". When a vector is supplied, the function recurses and produces one PDF set per variable.- images_to_plot
Character vector or
NULL. Images to include.- remove_outliers
Logical. Default
FALSE.- outlier_prob
Numeric. Default
0.01.- size_override
Scalar or named numeric list. A plain number applies to all images; a named list applies per image.
- calcptsizesc
Numeric. Scaling constant for automatic point-size calculation; larger values yield larger spots. Radius-aware, so the same value works across Visium and Visium HD. Default
100.- colors
Named character vector. Colors for
group.bylevels.NULLauto-resolves from PrepObject orNour_pal.- gene_colors
Character vector. Gradient for gene expression.
- legend.side
Character. Where to place the paired legends:
"right"(default, stacked vertically) or"bottom"(side by side).- legend.direction
Character. Internal layout of the categorical cluster legend:
"vertical"(default) or"horizontal".- output_dir
Character or
NULL. Output directory for PDFs. WhenNULLthe plot is printed to the active device and returned invisibly. Walk-up from PrepObject applies when omitted entirely.- object_name
Character. Label for PDF filenames. Default
"".- subset_name
Character. Optional second label appended to PDF filenames after
object_name. Default"".- file_name
Character or
NULL. Base name (no extension) for the saved PDF.NULL(default) auto-deduces fromobject_name,subset_name, the gene, andgroup.by.- width, height
Numeric or
NULL. Override the auto-calculated PDF dimensions in inches.NULL(default) auto-sizes to fit the row grid and legend.- timestamp
Logical. When
TRUE, append a_YYYYMMDD-HHMMSSstamp to the saved file name so repeated runs are versioned instead of overwriting the previous PDF. DefaultFALSE.- cluster_col
Deprecated alias for
group.by.- cluster_colors
Deprecated alias for
colors.