View source: R/geometry_operation.R
annotPred  R Documentation 
This function finds binary predicates for the geometry of each cell/spot
(i.e. colGeometry
) and an annotation geometry for each sample. For
example, whether each Visium spot intersects with the tissue boundary in each
sample.
annotPred(
sfe,
colGeometryName = 1L,
annotGeometryName = 1L,
sample_id = "all",
pred = st_intersects
)
annotNPred(
sfe,
colGeometryName = 1L,
annotGeometryName = 1L,
sample_id = "all",
pred = st_intersects
)
sfe 
An SFE object. 
colGeometryName 
Name of column geometry for the predicate. 
annotGeometryName 
Name of annotation geometry for the predicate. 
sample_id 
Which sample(s) to operate on. Can be "all" to indicate all samples. 
pred 
Predicate function to use, defaults to

For annotPred
, a logical vector of the same length as the
number of columns in the sample(s) of interest, with barcodes (or
corresponding column names of sfe) as names. For annotNPred
, a
numeric vector of the same length as the number of columns in the sample(s)
of interest with barcodes as names, indicating the number of geometries
in the annotGeometry
of interest returns TRUE for the predicate for
each each geometry in the colGeometry
of interest.
annotOp
library(SFEData)
sfe < McKellarMuscleData("small")
# Whether each spot is in tissue
in_tissue < annotPred(sfe, "spotPoly", annotGeometryName = "tissueBoundary")
# How many nuclei are there in each Visium spot
n_nuclei < annotNPred(sfe, "spotPoly", annotGeometryName = "nuclei")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.