Skip to contents

Read a .loom file and convert to a Seurat

Usage

loom_to_srt(
  path,
  layers = c("spliced", "unspliced"),
  verbose = TRUE,
  chunk_rows = 1000
)

Arguments

path

Path to a .loom file.

layers

Character vector of loom layers to import as additional Seurat assays. Missing layers are skipped with a warning. Default is c("spliced", "unspliced").

verbose

Whether to print the message. Default is TRUE.

chunk_rows

Number of feature rows to read from each matrix dataset per chunk. Larger values can be faster but use more memory.

Value

A Seurat object.

Details

This function reads loom/HDF5 files directly in R using rhdf5; it does not call reticulate, scanpy, or loom_to_adata(). The loom /matrix dataset is imported as the RNA assay. Requested /layers/* datasets are imported as additional assays, which is useful for velocity-style loom files with spliced and unspliced layers.

Examples

if (FALSE) { # \dontrun{
srt <- loom_to_srt("path/to/data.loom")
srt
} # }