Flag Visium Outliers in SpatialExperiment Objects
Source:R/flagVisiumOutliers.R
      flagVisiumOutliers.RdThe flagVisiumoutliers function identifies and flags Visium systematic outlier spots in a
SpatialExperiment object based on barcodes. These outliers are marked in the colData
of the SpatialExperiment object, allowing users to exclude them from downstream analyses
to enhance data quality and reliability.
Value
A SpatialExperiment object identical to the input spe but with an additional
logical column systematic_outliers in its colData. This column indicates whether
each spot is flagged as a technical outlier (TRUE) or not (FALSE).
Examples
library(SpotSweeper)
library(SpatialExperiment)
# load example data
spe <- STexampleData::Visium_humanDLPFC()
#> see ?STexampleData and browseVignettes('STexampleData') for documentation
#> downloading 1 resources
#> retrieving 1 resource
#> loading from cache
# Flag outlier spots
spe <- flagVisiumOutliers(spe)
# drop outlier spots
spe <- spe[, !colData(spe)$systematic_outliers]