Returns the sparse cross-cell-type ambient weight matrix that defines the per-cell contamination term (the short-range technical field a cell receives from its heterotypic neighbours).
Usage
ambientField(object, ...)
# S4 method for class 'SpatialExperiment'
ambientField(
object,
celltype_col,
image_col = NULL,
h_tech = 5,
assay_name = "counts",
...
)Arguments
Examples
spe <- readRDS(system.file("extdata", "bc_xenium_subset.rds", package = "PACE"))
af <- ambientField(spe, celltype_col = "cellType")
#> [W identity check] max|W%*%Y - dense E_tech| over 5 genes = 8.882e-16
names(af)
#> [1] "W" "image_idx" "n_images"
