Closed rbutleriii closed 5 months ago
Hi @rbutleriii, thanks for detecting this issue. I looked at it and the error comes from the lack of centroids in the polygons object. To fix the error, indicate calc_centroids = TRUE in the createGiottoPolygonsFromDfr( ) function. It won't affect the downstream analysis using your selected regions. I'll update the tutorial on the website immediately.
polygons = createGiottoPolygonsFromDfr(my_polygon_coords, name = 'subregion', calc_centroids = TRUE)
x %>% addGiottoPolygons(gpolygons = list(polygons)) %>% addPolygonCells(polygon_name = 'subregion') -> x
saveGiotto(x, foldername = "test", method = 'qs', overwrite = TRUE) loadGiotto("test")
Describe the Error
The interactive selection is fantastic and really works well! However, when using it in my pipeline I noticed the tutorial is missing essential step for a cosmx object you can save. If you save it after
addPolygonCells
then it will error when you try to load it again:Error Message
To Reproduce
Expected behavior
It seems to be down to gobjects with subcellular features? In any case you can rescue it by calculating the spatial centroids. Maybe add that to the tutorial (Agg features seems optional).
System Information