Convert an ordinary SPE/SFE once, before deployment. Assays retain their values in gene-oriented BPCells directories; polygons and images are stored separately from a lightweight SpatialExperiment. Input objects are unchanged.
prepare_app_inputs(spe, output_dir, fullres_images = NULL)A SpatialExperiment or SpatialFeatureExperiment with sample_id, feature identifiers, spatial coordinates, and at least one assay.
A new directory. Existing directories are never overwritten.
Optional named list indexed by sample_id. Each entry is a path to an aligned OME-TIFF/OME-Zarr pyramid, or a descriptor with path, image_id (default "fullres"), type, extent (xmin, ymin, xmax, ymax in spatial coordinate units), and y_direction ("up"/"down"). Descriptors may also supply pixel_size_um_xy. Multiple sources can be supplied as list(sources = ...). Paths without registration use the experiment's image coordinate frame. Images must already be oriented to that frame; preparation does not rotate or reflect full-resolution pixels. Local pyramids are copied into the output.
Invisibly, the normalized output directory. Use open_app_dataset() to open it, then pass the result to run_app().
Requires the optional package BPCells (>= 0.3.1). Install it with
install.packages("BPCells", repos = c("https://bnprks.r-universe.dev", "https://cloud.r-project.org")).