R/convenience_stereoseq.r
createGiottoStereoSeqObjectBin.RdConvenience function to create a Giotto object from a Stereo-seq `outs` directory using square bin (squarebin) expression data. Point `stereoseq_dir` directly at the `outs` directory produced by the SAW pipeline. For lower-level loading of individual pieces of data, see [importStereoSeq()].
createGiottoStereoSeqObjectBin(
stereoseq_dir,
bin_size = "bin100",
gene_column = c("geneName", "geneID"),
negative_y = TRUE,
gef_type = c("tissue", "full", "raw"),
load_expression = TRUE,
load_spatlocs = TRUE,
load_binpoints = FALSE,
load_image = TRUE,
load_mask = TRUE,
gef_path = NULL,
image_path = NULL,
mask_path = NULL,
instructions = NULL,
verbose = NULL
)filepath to the Stereo-seq `outs` directory.
character. Bin size level to load. One of `"bin1"`, `"bin5"`, `"bin10"`, `"bin20"`, `"bin50"`, `"bin100"` (default), `"bin150"`, `"bin200"`. List available bins with `rhdf5::h5ls("path/to/*.tissue.gef")`.
character. Feature identifier column. One of `"geneName"` (default) or `"geneID"`.
logical. Map data to negative y spatial values (default `TRUE`). Origin is placed at the upper-left.
character. Which .gef to use, "tissue" (default), "full", or "raw". The default `"tissue"` includes only bins that overlap the detected tissue. If you need the full capture array, use `"full"`.
logical. Whether to load the expression matrix. Uses `Matrix::sparseMatrix()` directly from the gef triplet data for memory efficiency. Set to `FALSE` to skip.
logical. Whether to load spatial locations.
logical (default `FALSE`). Whether to load a [giottoBinPoints-class] object — the most memory-efficient representation. Data stays as integer triplets + `SpatVector`; no matrix is created. Useful for very large/fine bin datasets or as input to [calculateOverlap()] with custom polygons.
logical. Whether to load the H&E registered image.
logical (default `TRUE`). Whether to create cell polygons from the `*_HE_mask.tif` file in `stereoseq_dir/image/`. Uses [createGiottoPolygonsFromMask()] with `calc_centroids = TRUE`.
(optional) direct filepath to the `*.tissue.gef` file. Auto-detected from `stereoseq_dir` when not provided.
(optional) filepath or directory for the image. Auto-detected from `stereoseq_dir/image/` when not provided.
(optional) direct filepath to the `*_HE_mask.tif` file. Auto-detected from `stereoseq_dir/image/` when not provided.
giotto instructions to apply.
verbosity
giotto object
[importStereoSeq()] [createGiottoStereoSeqObjectCell()]
if (FALSE) {
g <- createGiottoStereoSeqObjectBin(
stereoseq_dir = "path/to/outs",
bin_size = "bin100"
)
}