R/convenience_visiumHD.R
createGiottoVisiumHDObjectCell.RdConvenience function to create a Giotto object from a VisiumHD `segmented_outputs` folder (Space Ranger v4+). Point `segmented_outputs_dir` directly at the `segmented_outputs` directory. For lower-level loading of individual pieces of data, see [importVisiumHD()].
Transcript loading (2 µm bin data) requires access to the `binned_outputs` directory. When `load_transcripts = TRUE` the function first tries to auto-detect `binned_outputs` as a sibling directory next to `segmented_outputs`. If it cannot be found, an error is thrown and the user should supply `binned_outputs_dir` explicitly.
createGiottoVisiumHDObjectCell(
segmented_outputs_dir,
load_expression = TRUE,
load_polygons = c("cell", "nucleus"),
graphclust_annotated = FALSE,
load_image = TRUE,
load_transcripts = FALSE,
binned_outputs_dir = NULL,
micron = FALSE,
barcodes = NULL,
expression_source = "raw",
feature_id_type = c("symbol", "ensembl"),
expression_remove_zero_rows = TRUE,
expression_split_by_type = TRUE,
image_type = "hires",
scalefactors_path = NULL,
expression_path = NULL,
image_path = NULL,
geojson_path = NULL,
instructions = NULL,
verbose = NULL
)filepath to the VisiumHD `segmented_outputs` directory.
logical. Whether to load expression matrix.
character. Which polygon types to load. One or both of `"cell"` and `"nucleus"`. Set to `NULL` or `character(0)` to skip.
logical. Whether to load graphclust-annotated polygon variants.
logical. Whether to load the paired image.
logical. Whether to load 2 µm bin data as transcripts. Very memory expensive. Requires access to the `binned_outputs` directory (auto-detected or supplied via `binned_outputs_dir`).
(optional) filepath to the VisiumHD `binned_outputs` directory. Only needed when `load_transcripts = TRUE` and auto-detection of the sibling `binned_outputs` folder fails.
logical. Set `TRUE` to load in micron scale.
character. Specific cell barcodes to keep.
character. One of `"raw"` or `"filtered"`.
character. One of `"symbol"` or `"ensembl"`.
logical (default `TRUE`). Whether to remove features with no detections.
logical (default `TRUE`). Whether to split expression by feature type.
character. One of `"hires"` (default) or `"lowres"`.
(optional) filepath to `scalefactors_json.json`.
(optional) filepath to .h5 or matrix market directory.
(optional) filepath to image to use.
(optional) filepath or directory for polygon `.geojson` files.
giotto instructions to apply.
verbosity
giotto object
[importVisiumHD()] [createGiottoVisiumHDObjectBin()]
if (FALSE) {
seg_dir <- "path/to/visiumhd/segmented_outputs"
g <- createGiottoVisiumHDObjectCell(seg_dir)
# with transcript loading (auto-detects ../binned_outputs/)
g <- createGiottoVisiumHDObjectCell(seg_dir, load_transcripts = TRUE)
# with explicit binned_outputs path
g <- createGiottoVisiumHDObjectCell(seg_dir,
load_transcripts = TRUE,
binned_outputs_dir = "path/to/visiumhd/binned_outputs"
)
}