Per-marker intensity distribution with fitted GMM densities
Source:R/plot_utils.R
plot_distributions.RdPlots a histogram of log2-transformed pixel (or cell) intensities and
overlays the component-wise density curves from the fitted GMM. One facet
per marker. Accepts a QPTIFFImage returned by
bgnorm_pixels (bgnorm results are carried as an attribute) or
a SummarizedExperiment /
SpatialExperiment with bgnorm results in
metadata(x)$bgnorm_results. Multi-sample
SpatialExperiments are automatically detected via sample_id
in colData and produce facets by sample_id x marker.
Arguments
- x
A
QPTIFFImagereturned bybgnorm_pixelsor aSummarizedExperiment/SpatialExperiment.- results
Optionally, the
QPTIFFImagereturned bybgnorm_pixelswhenxis the raw (unadjusted)QPTIFFImage. Ignored forSummarizedExperimentinput.- markers
Character vector of markers to display, or
NULLfor all markers.- ncol
Number of facet columns.
Examples
path <- system.file("extdata", "PA_HNC_sample.ome.tiff", package = "bgnormR")
img <- read_qptiff(path)
#> Reading TIFF directory structure ...
#> Reading OME-TIFF metadata ...
#> Reading IFD page layouts ...
#> Loading 5 channel(s) ...
#> Loading 5 channel(s) ...
res <- bgnorm_pixels(img, sample_prop = 0.1)
plot_distributions(res)