Skip to content

Commit

Permalink
Merge pull request #881 from josschavezf/suite
Browse files Browse the repository at this point in the history
update interactive selection tutorial
  • Loading branch information
josschavezf authored Feb 1, 2024
2 parents 2aea151 + c7dca30 commit cf36964
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions vignettes/interactive_selection.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,26 @@ my_polygon_coordinates <- plotInteractivePolygons(my_spatPlot,

Now, let's add the polygon coordinates to the Giotto object:

Create a polygon object

```{r, eval=FALSE}
## We must transform the data.table or data.frame with coordinates into a Giotto polygon object
my_giotto_polygons <- createGiottoPolygonsFromDfr(my_polygon_coordinates, name = 'selections')
my_giotto_polygons <- createGiottoPolygonsFromDfr(my_polygon_coordinates,
name = 'selections')
```

If you plan to save and load your Giotto object after adding the selected polygons, include the centroids of the polygon by using the following argument:

```{r, eval=FALSE}
## We must transform the data.table or data.frame with coordinates into a Giotto polygon object
my_giotto_polygons <- createGiottoPolygonsFromDfr(my_polygon_coordinates,
name = 'selections',
calc_centroids = TRUE)
```

## Then, add the polygons to the Giotto object
Then, add the polygons to the Giotto object

```{r, eval=FALSE}
visium_brain <- addGiottoPolygons(gobject = visium_brain,
gpolygons = list(my_giotto_polygons))
```
Expand Down

0 comments on commit cf36964

Please sign in to comment.