View source: R/plotSpotHeatmap.R
plotSpotHeatmap | R Documentation |
Helper function for estimating the spillover matrix. This function visualizes the median pixel intensities per spot (rows) and per channel (columns) in form of a heatmap.
plotSpotHeatmap(
object,
spot_id = "sample_id",
channel_id = "channel_name",
assay_type = "counts",
statistic = "median",
log = TRUE,
threshold = NULL,
order_metals = TRUE,
color = viridis(100),
breaks = NA,
legend_breaks = NA,
cluster_cols = FALSE,
cluster_rows = FALSE,
...
)
object |
a |
spot_id |
character string indicating which |
channel_id |
character string indicating which |
assay_type |
character string indicating which assay to use (default
|
statistic |
the statistic to use when aggregating channels per spot
(default |
log |
should the aggregated pixel intensities be |
threshold |
single numeric indicating a threshold after pixel
aggregation. All aggregated values larger than |
order_metals |
should the metals be ordered based on spotted mass? |
color |
see parameter in |
breaks |
see parameter in |
legend_breaks |
see parameter in |
cluster_cols |
see parameter in |
cluster_rows |
see parameter in |
... |
other arguments passed to |
a pheatmap
object
Visualizing the aggregated pixel intensities serves two purposes:
Small median pixel intensities (< 200 counts) might hinder the robust
estimation of the channel spillover. In that case, consecutive pixels can be
summed (see binAcrossPixels
).
Each spotted metal (row) should show the highest median pixel intensity in its corresponding channel (column). If this is not the case, either the naming of the .txt files was incorrect or the incorrect metal was spotted.
By setting the threshold
parameter, the user can easily identify spots
where pixel intensities are too low for robust spillover estimation.
Nils Eling (nils.eling@dqbm.uzh.ch)
pheatmap
for visual modifications
aggregateAcrossCells
for the aggregation
function
path <- system.file("extdata/spillover", package = "imcRtools")
# Read in .txt files
sce <- readSCEfromTXT(path)
# Visualizes heatmap
plotSpotHeatmap(sce)
# Visualizes thresholding results
plotSpotHeatmap(sce, log = FALSE, threshold = 200)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.