spatialAnnotationScreening | R Documentation |
Screens the sample for numeric variables that stand
in meaningful, spatial relation to annotated structures/areas, spatial annotations.
For a detailed explanation on how to define the parameters distance
,
resolution
, angle_span
and n_bins_angle
see details section.
spatialAnnotationScreening(
object,
ids,
variables,
core,
distance = "dte",
resolution = recSgsRes(object),
angle_span = c(0, 360),
unit = getDefaultUnit(object),
bcs_exclude = character(0),
sign_var = "fdr",
sign_threshold = 0.05,
force_comp = FALSE,
skip_comp = FALSE,
model_add = NULL,
model_subset = NULL,
model_remove = NULL,
estimate_R2 = TRUE,
control = NULL,
n_random = 10000,
rm_zero_infl = TRUE,
seed = 123,
add_image = TRUE,
verbose = NULL,
...
)
object |
An object of class |
ids |
Character vector. Specifies the IDs of the spatial annotations of interest. |
variables |
Character vector. The numeric variables to be included in the screening process. Makre sure that the correct matrix is active in the respective assays. |
distance |
|
resolution |
Distance measure. The resolution
with which the expression gradient is inferred. Defaults are platform specific.
See more in detail section of |
angle_span |
Numeric vector of length 2. Confines the area screened by an angle span relative to the center of its closest spatial annotation. |
unit |
Character value. Specifies the desired unit in
which distance measures
or area measures are provided.
Run |
bcs_exclude |
Character value containing the barcodes of observations to be excluded from the analysis. |
sign_var |
Either p_value or fdr. Defaults to fdr. |
sign_threshold |
The significance threshold. Defaults to 0.05. |
model_add |
Named list. Every slot in the list must be either a formula
containing a function that takes a numeric vector as input and returns a numeric
vector with the same length as its input vector. Or a numeric vector with the
same length as the input vector. Test models with |
model_subset |
Character value. Used as a regex to subset models.
Use |
model_remove |
Character value. Used as a regex to remove models are not supposed to be included. |
control |
A list of arguments as taken from |
n_random |
Number of random permutations for the significance testing of step 2. |
seed |
Numeric value. Sets the random seed. |
verbose |
Logical. If (Warning messages will always be printed.) |
... |
Used to absorb deprecated arguments or functions. |
An object of class SpatialAnnotationScreening
.
Extensive tutorials for how to use this function can be found on our website https://themilolab.github.io/SPATA2/ .
createGroupAnnotations()
, createImageAnnotations()
,
createNumericAnnotations()
for how to create spatial annotations.
getCoordsDfSA()
for how to obtain spatial relation of data points to
a spatial annotation.
getSasDf()
for how to obtain inferred expression gradients as used in
spatial annotation screening.
plotSasLineplot()
for visualization of inferred expression gradients.
library(SPATA2)
data("example_data")
object <- example_data$object_UKF313T_diet
object <- identifyTissueOutline(object)
ids <- getSpatAnnIds(object, tags = c("necrotic", "compr"), test = "all")
# opt 1 prefiltering by SPARKX is recommended, but not required
object <- runSPARKX(object)
genes <- getSparkxGenes(object, threshold_pval = 0.05)
# opt 2
genes <- getGenes(object)
sas_out <-
spatialAnnotationScreening(
object = object,
ids = ids,
variables = genes,
core = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.