
Annotate Specific Spots within a SpatialExperiment Object
annotate_spots.RdThis function allows for the annotation of specified spots within a SpatialExperiment object.
Users can define a list of spots to be annotated and assign positive or negative values to these spots.
This is particularly useful for distinguishing or marking spots based on certain criteria or experimental results.
Arguments
- spe
A
SpatialExperimentobject representing the spatially resolved data. This is the target object where the annotations will be applied.- spots
A character vector or list specifying the spots within the
SpatialExperimentobject to annotate. These spots should correspond to the column names of theSpatialExperimentobject that represent specific spatial locations or features.- value_pos
The value to assign to the spots specified in the
spotsparameter. This value denotes a positive annotation, indicating that the spots meet a certain condition or criterion.- value_neg
The value to assign to spots not specified in the
spotsparameter. This value denotes a negative annotation, indicating that the spots do not meet the specified condition or criterion.- name
A character string specifying the name of the annotation. This name will be used to label the column in the
SpatialExperimentobject that contains the annotation values.
Value
Returns a SpatialExperiment object that includes the new annotations.
The function adds a column to the colData of the SpatialExperiment object, where the column name is specified by the name parameter.
Spots specified in the spots parameter are annotated with the value_pos value, while all other spots are annotated with the value_neg value.