You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have pre-annotated regions in QuPath and exported them as geoJSON files. Can these be loaded directly or converted in some way so that I may perform spatially-aware DE of my Visium data?
The text was updated successfully, but these errors were encountered:
Yes, I also do that. You can use sf::st_read() to read GeoJSON file as a sf data frame, make sure to set crs = NA; CRS is the different ways to project the globe onto a 2D map, which is irrelevant to histological space. The catch though is if the QuPath annotations have the same unit as the Visium coordinates. If you did the annotations with the full resolution image and the Visium coordinates are also in full res pixels, then they should match. If you have terra >= 1.17.83, then the image will appear flipped compared to QuPath so y would increase going up just as in the geometries so the geometries should match the images as well. Here's some pseudocode, say you saved your annotations in annotations.geojson:
library(sf)
g <- st_read("annotations.geojson", crs = NA)
annotGeometry(sfe, "annotations") <- g # suppose you have one sample
If you have multiple samples in the SFE object, you should add a column named "sample_id" specifying which geometry belongs to which sample.
I have pre-annotated regions in QuPath and exported them as geoJSON files. Can these be loaded directly or converted in some way so that I may perform spatially-aware DE of my Visium data?
The text was updated successfully, but these errors were encountered: