Convenience 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
)

Arguments

stereoseq_dir

filepath to the Stereo-seq `outs` directory.

bin_size

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")`.

gene_column

character. Feature identifier column. One of `"geneName"` (default) or `"geneID"`.

negative_y

logical. Map data to negative y spatial values (default `TRUE`). Origin is placed at the upper-left.

gef_type

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"`.

load_expression

logical. Whether to load the expression matrix. Uses `Matrix::sparseMatrix()` directly from the gef triplet data for memory efficiency. Set to `FALSE` to skip.

load_spatlocs

logical. Whether to load spatial locations.

load_binpoints

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.

load_image

logical. Whether to load the H&E registered image.

load_mask

logical (default `TRUE`). Whether to create cell polygons from the `*_HE_mask.tif` file in `stereoseq_dir/image/`. Uses [createGiottoPolygonsFromMask()] with `calc_centroids = TRUE`.

gef_path

(optional) direct filepath to the `*.tissue.gef` file. Auto-detected from `stereoseq_dir` when not provided.

image_path

(optional) filepath or directory for the image. Auto-detected from `stereoseq_dir/image/` when not provided.

mask_path

(optional) direct filepath to the `*_HE_mask.tif` file. Auto-detected from `stereoseq_dir/image/` when not provided.

instructions

giotto instructions to apply.

verbose

verbosity

Value

giotto object

See also

[importStereoSeq()] [createGiottoStereoSeqObjectCell()]

Examples

if (FALSE) {
g <- createGiottoStereoSeqObjectBin(
    stereoseq_dir = "path/to/outs",
    bin_size = "bin100"
)
}