readVizgen | R Documentation |
This function reads the standard Vizgen MERFISH output into an SFE object.
The coordinates are in microns. Cell centroids are read into
colGeometry
"centroids", and cell segmentations are read into
colGeometry
"cellSeg". The image(s) (polyT and DAPI) are also read as
SpatRaster
objects so they are not loaded into memory unless
necessary. Because the image's origin is the top left while the geometry's
origin is bottom left, either the image or the geometry needs to be flipped.
Because the image accompanying MERFISH datasets are usually very large, the
coordinates will be flipped so the flipping operation won't load the entire
image into memory.
readVizgen(
data_dir,
z = 3L,
use_cellpose = TRUE,
sample_id = "sample01",
min_area = 15,
image = c("DAPI", "PolyT"),
flip = c("geometry", "image", "none"),
max_flip = "50 MB",
BPPARAM = SerialParam()
)
data_dir |
Top level directory of Vizgen output, which contains
directories |
z |
Index of z plane to read. |
use_cellpose |
Logical, whether to use Cellpose parquet files if present. |
sample_id |
A |
min_area |
Minimum cell area in square microns. Anything smaller will be considered artifact or debris and removed. |
image |
Which image(s) to load, can be "DAPI", "PolyT", or both. |
flip |
To flip the image, geometry coordinates, or none. Because the image has the origin at the top left while the geometry has origin at the bottom left, one of them needs to be flipped for them to match. If one of them is already flipped, then use "none". The image will not be flipped if it's GeoTIFF. |
max_flip |
Maximum size of the image allowed to flip the image. Because the image will be loaded into memory to be flipped. If the image is larger than this size then the coordinates will be flipped instead. |
BPPARAM |
A |
A SpatialFeatureExperiment
object.
dir_use <- system.file("extdata/vizgen", package = "SpatialFeatureExperiment")
sfe <- readVizgen(dir_use, z = 0L, use_cellpose = TRUE, image = "PolyT",
flip = "geometry")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.