View source: R/binAcrossPixels.R
binAcrossPixels | R Documentation |
Helper function for estimating the spillover matrix. Per metal spot, consecutive pixels a aggregated (default: summed).
binAcrossPixels(
object,
bin_size,
spot_id = "sample_id",
assay_type = "counts",
statistic = "sum",
...
)
object |
a |
bin_size |
single numeric indicating how many consecutive pixels per spot should be aggregated. |
spot_id |
character string indicating which |
assay_type |
character string indicating which assay to use. |
statistic |
character string indicating the statistic to use for aggregating consecutive pixels. |
... |
additional arguments passed to |
returns the binned pixel intensities in form of a
SingleCellExperiment
object
Nils Eling (nils.eling@dqbm.uzh.ch)
aggregateAcrossCells
for the aggregation
function
path <- system.file("extdata/spillover", package = "imcRtools")
# Read in .txt files
sce <- readSCEfromTXT(path)
dim(sce)
# Visualizes heatmap before aggregation
plotSpotHeatmap(sce)
# Sum consecutive pixels
sce <- binAcrossPixels(sce, bin_size = 10)
dim(sce)
# Visualizes heatmap after aggregation
plotSpotHeatmap(sce)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.