View source: R/interactivity.R
addPolygonCells | R Documentation |
Add corresponding polygon IDs to cell metadata
addPolygonCells(
gobject,
polygon_name = "selections",
spat_unit = "cell",
spat_loc_name = "raw",
feat_type = "rna",
polygons = NULL,
na.label = "no_polygon"
)
gobject |
A Giotto object |
polygon_name |
name of polygon selections |
spat_unit |
spatial unit |
spat_loc_name |
name of spatial locations to use |
feat_type |
feature name where metadata will be added |
polygons |
polygon names to plot (e.g. 'polygon_1'). If NULL, plots all available polygons |
na.label |
polygon label for cells located outside of polygons area. Default = "no_polygon" |
A Giotto object with a modified cell_metadata slot that includes the polygon name where each cell is located or no_polygon label if the cell is not located within a polygon area
## Not run:
## Plot interactive polygons
my_polygon_coords <- plotInteractivePolygons(my_spatPlot)
## Add polygon coordinates to Giotto object
my_giotto_polygons <- createGiottoPolygonsFromDfr(my_polygon_coords)
my_giotto_object <- addGiottoPolygons(gobject = my_giotto_object,
gpolygons = list(my_giotto_polygons))
## Add polygon IDs to cell metadata
my_giotto_object <- addPolygonCells(my_giotto_object)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.