Generic function. Plots each bin coloured by significance status: empty, non-significant, or significant hotspot (continuous gradient of -log10 p-value or 1 - p-value).
Usage
plotHotspots(x, ...)
# S3 method for class 'blisa'
plotHotspots(
x,
index = 1,
ligand = NULL,
receptor = NULL,
as_points = FALSE,
size = 1.5,
background = NULL,
log_pval = TRUE,
p_cutoff = NULL,
spots = NULL,
spot_pval = NULL,
title = NULL,
...
)Arguments
- x
A
blisaobject.- ...
Additional arguments passed to the method.
- index
Integer. Row index into
LR_resultsselecting the ligand-receptor pair to visualise. Ignored when bothligandandreceptorare supplied. Default1(top-ranked pair).- ligand
Character. Ligand gene symbol. When both
ligandandreceptorare provided the matching LR pair is located automatically andindexis ignored. Must be supplied together withreceptor.- receptor
Character. Receptor gene symbol. Must be supplied together with
ligand.- as_points
Logical. If
TRUE, draw each bin as a dot at its centroid instead of its polygon. Useful for Visium, where each bin is a single spot. DefaultFALSE(draw polygons).- size
Numeric. Point size when
as_points = TRUE(or whenbackgroundis supplied). Default1.5.- background
A
ggplotobject to draw the hotspots on top of, e.g.scider::plotImage(spe)to place the H&E image behind the spots. When supplied, the hotspots are always rendered as dots (the raster background is incompatible withgeom_sfcoordinates), and the bins must share the background plot's coordinate frame (true for objects read byscider::readVisium()). DefaultNULL.- log_pval
Logical. If
TRUE(default), colour significant bins by -log10(p-value). IfFALSE, use 1 - p-value.- p_cutoff
Numeric or
NULL. WhenNULL(default), the pre-computed hotspot bins stored in theblisaobject are used, reflecting thep_cutoffand High-High quadrant classification applied duringblisa. When a numeric value is supplied, bins are re-defined on the fly as those withall_pval <= p_cutoffand quadrant label"High-High"(from the storedall_quadrant), giving an exact re-threshold consistent with the original classification.- spots
Integer vector or
NULL. Significant spot indices to plot directly, bypassing the LR-pair lookup – e.g. asig_spot_indexentry fromblisaPathway. When supplied,index/ligand/receptor/p_cutoffare ignored and every bin is drawn as grey background with these spots coloured. DefaultNULL.- spot_pval
Numeric vector. P-values for
spots(same length and order); required whenspotsis supplied.- title
Character or
NULL. Plot title. Defaults to the LR pair id (or "hotspots" inspotsmode). Useful to label a pathway, e.g.title = "MDK pathway".
