Adjusts tags of spatial annotations.

tagSpatialAnnotations(object, ...)

# S4 method for class 'SPATA2'
tagSpatialAnnotations(object, ids, tags, opt = "add")

# S4 method for class 'SpatialData'
tagSpatialAnnotations(object, ids, tags, opt = "add")

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

...

Used to absorb deprecated arguments or functions.

ids

A character vector of IDs naming the spatial annotations that are affected by the changes.

tags

A character vector of tags.

opt

A character string specifying the kind of adjustment: either 'add' to add tags to existing tags or 'set' to replace existing tags with the new ones.

Value

The updated input object, containing the added, removed or computed results.

Examples

library(SPATA2)

data("example_data")

object <- example_data$object_UKF313T_diet

plotSpatialAnnotations(object)
getSpatAnnTags(object, simplify = FALSE)

object <- tagSpatialAnnotations(object, ids = c("necrotic_edge", "necrotic_edge2"), tags = "edge")

getSpatAnnTags(object, simplify = FALSE)