Skip to contents

Fetch data from the hdf5 file and returns a Seurat object

Usage

FetchH5(
  data_file,
  meta_file,
  name = NULL,
  features = NULL,
  layer = NULL,
  assay = NULL,
  metanames = NULL,
  reduction = NULL
)

Arguments

data_file

The path to the hdf5 file containing the data.

meta_file

The path to the hdf5 file containing the metadata.

name

The name of the dataset in the hdf5 file. If not specified, the function will attempt to find the shared group name in both files.

features

The names of the genes or features to fetch. If specified, only these features will be fetched.

layer

The layer for the counts in the hdf5 file. If not specified, the first layer will be used.

assay

The name of the assay to use. If not specified, the default assay in the hdf5 file will be used.

metanames

The names of the metadata columns to fetch.

reduction

The name of the reduction to fetch.

Value

A Seurat object with the fetched data.

Examples

data(pancreas_sub)
pancreas_sub <- standard_scop(pancreas_sub)
#>  [2026-05-14 06:12:05] Start standard processing workflow...
#>  [2026-05-14 06:12:06] Checking a list of <Seurat>...
#> ! [2026-05-14 06:12:06] Data 1/1 of the `srt_list` is "unknown"
#>  [2026-05-14 06:12:06] Perform `NormalizeData()` with `normalization.method = 'LogNormalize'` on 1/1 of `srt_list`...
#>  [2026-05-14 06:12:08] Perform `Seurat::FindVariableFeatures()` on 1/1 of `srt_list`...
#>  [2026-05-14 06:12:08] Use the separate HVF from `srt_list`
#>  [2026-05-14 06:12:08] Number of available HVF: 2000
#>  [2026-05-14 06:12:08] Finished check
#>  [2026-05-14 06:12:08] Perform `Seurat::ScaleData()`
#>  [2026-05-14 06:12:09] Perform pca linear dimension reduction
#>  [2026-05-14 06:12:09] Use stored estimated dimensions 1:20 for Standardpca
#>  [2026-05-14 06:12:09] Perform `Seurat::FindClusters()` with `cluster_algorithm = 'louvain'` and `cluster_resolution = 0.6`
#>  [2026-05-14 06:12:10] Reorder clusters...
#>  [2026-05-14 06:12:10] Skip `log1p()` because `layer = data` is not "counts"
#>  [2026-05-14 06:12:10] Perform umap nonlinear dimension reduction
#>  [2026-05-14 06:12:10] Perform umap nonlinear dimension reduction using Standardpca (1:20)
#>  [2026-05-14 06:12:14] Perform umap nonlinear dimension reduction using Standardpca (1:20)
#>  [2026-05-14 06:12:19] Standard processing workflow completed
PrepareSCExplorer(pancreas_sub, base_dir = "./SCExplorer")
#>  [2026-05-14 06:12:19] Create SCExplorer base directory: ./SCExplorer
#>  [2026-05-14 06:12:19] Set the project name of each <Seurat> to their dataset name
#>  [2026-05-14 06:12:19] Prepare data for object: "SeuratProject"
#>  [2026-05-14 06:12:19] Write the expression matrix to: ./SCExplorer/data.hdf5
#>  [2026-05-14 06:12:22] Write the meta information to: ./SCExplorer/meta.hdf5
srt <- FetchH5(
  data_file = "./SCExplorer/data.hdf5",
  meta_file = "./SCExplorer/meta.hdf5",
  features = c("Ins1", "Ghrl"),
  metanames = c("SubCellType", "Phase"),
  reduction = "UMAP"
)
CellDimPlot(
  srt,
  group.by = c("SubCellType", "Phase"),
  reduction = "UMAP"
)

FeatureDimPlot(
  srt,
  features = c("Ins1", "Ghrl"),
  reduction = "UMAP"
)