Given a SpatialExperiment and column name in its colData, return a modified copy of the SpatialExperiment with additional colData columns: spe$exclude_overlapping and spe$overlap_key

add_overlap_info(spe, metric_name)

Arguments

spe

A SpatialExperiment with colData columns array_row_transformed, array_col_transformed, key, and capture_area

metric_name

character(1) in colnames(colData(spe)), where spots belonging to the capture area with highest average value for the metric take precedence over other spots

Value

A SpatialExperiment object with additional colData columns spe$exclude_overlapping and spe$overlap_key

Details

spe$exclude_overlapping is TRUE for spots with a higher-quality overlapping capture area and FALSE otherwise. spot_plot only displays FALSE spots to prevent overplotting in regions of overlap. spe$overlap_key gives comma- separated strings containing the keys of any overlapping spots, and is the empty string otherwise.

Author

Nicholas J. Eagles

Examples

#   For internal testing
if (FALSE) { # \dontrun{
library("HDF5Array")
spe <- loadHDF5SummarizedExperiment("dev/test_data/spe_filtered")
spe_new <- add_overlap_info(spe, metric_name = "sum_umi")
p_old <- spot_plot(
    spe,
    sample_id = "Br8492", var_name = "capture_area",
    is_discrete = TRUE
)
p_new <- spot_plot(
    spe_new,
    sample_id = "Br8492", var_name = "capture_area",
    is_discrete = TRUE
)
print(p_old)
print(p_new)
} # }

## TODO: add working examples
args(add_overlap_info)
#> function (spe, metric_name) 
#> NULL