inspect_sc: Inspect a single-cell object

View source: R/inspect_sc.R

inspect_scR Documentation

Inspect a single-cell object

Description

Inspects the structure and contents of a supported single-cell data file without performing a conversion. Supported inputs include Seurat and SingleCellExperiment objects stored as RDS files, AnnData H5AD files, and Loom files.

Usage

inspect_sc(path_to_file)

Arguments

path_to_file

Path to an RDS, H5AD, or Loom file.

Details

The function reports basic information such as the number of cells and features, available assays or layers, dimensional reductions, metadata, and a sample of cell names. Additional format-specific information is reported when available.

Value

Invisibly returns a list containing information about the inspected object. The contents of the list depend on the input format.

Examples

if (requireNamespace("Seurat", quietly = TRUE)) {
  counts <- matrix(
    c(1, 0, 3, 0, 2, 1),
    nrow = 2,
    dimnames = list(
      c("Gene1", "Gene2"),
      c("Cell1", "Cell2", "Cell3")
    )
  )
  obj <- Seurat::CreateSeuratObject(counts = counts)
  path <- tempfile(fileext = ".rds")
  saveRDS(obj, path)
  inspect_sc(path)
  unlink(path)
}


scFlex documentation built on Sept. 29, 2026, 5:10 p.m.