Extracts barcodes of barcode-spots that fall in a given polygon. Works closely with sp::point.in.polygon().

getBarcodesInPolygon(object, polygon_df, strictly = TRUE)

getBarcodesInPolygonList(object, polygon_list, strictly = TRUE)

Arguments

object

An object of class spata2.

polygon_df

A data.frame that contains the vertices of the polygon in form of two variables: x and y.

strictly

Logical value. If TRUE, only barcode spots that are strictly interior to the polygon are returned. If FALSE, barcodes that are on the relative interior the polygon border or that are vertices themselves are returned, too.

polygon_list

A named list of data.frames with the numeric variables x and y. Observations correspond to the vertices of the polygons that confine spatial areas. Must contain a slot named outer which sets the outer border of the spatial area. Can contain multiple slots named inner (suffixed with numbers) that correspond to inner polygons - holes within the annotation. Like inner1, inner2.

Value

Character vector.