Convenience function to create a Giotto object from a Stereo-seq `outs` directory using cell bin (cellbin) 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()].

createGiottoStereoSeqObjectCell(
  stereoseq_dir,
  gene_column = c("geneName", "geneID"),
  negative_y = TRUE,
  gef_type = c("adjusted_cellbin", "cellbin"),
  load_expression = TRUE,
  load_spatlocs = TRUE,
  load_binpoints = FALSE,
  load_image = TRUE,
  load_polygons = TRUE,
  load_mask = FALSE,
  gef_path = NULL,
  image_path = NULL,
  mask_path = NULL,
  instructions = NULL,
  verbose = NULL
)

Arguments

stereoseq_dir

filepath to the Stereo-seq `outs` directory.

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, "adjusted_cellbin" (default) or "cellbin".

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 also load a [giottoBinPoints-class] object — the most memory-efficient representation. Data stays as integer triplets + `SpatVector`; no matrix is created.

load_image

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

load_polygons

logical. Whether to load the cell boundaries polygons.

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 `*.adjusted.cellbin.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()] [createGiottoStereoSeqObjectBin()]

Examples

if (FALSE) {
g <- createGiottoStereoSeqObjectCell(
    stereoseq_dir = "path/to/outs"
)
}