% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/h5_readers.R
\name{read_h5}
\alias{read_h5}
\title{Read 10X Genomics H5 file}
\usage{
read_h5(
  file_path,
  feature_format = "gene_name",
  unique.features = TRUE,
  verbose = FALSE
)
}
\arguments{
\item{file_path}{Character. Path to the 10X H5 file.}

\item{feature_format}{Character. Which feature identifier to use for gene names.
Options: "gene_name" (default, uses feature names) or "gene_ids" (uses feature IDs).}

\item{unique.features}{Logical. Make feature names unique. Default TRUE.}

\item{verbose}{Logical. Print progress messages. Default FALSE.}
}
\value{
Sparse matrix (dgCMatrix) with genes as rows and cells as columns.
}
\description{
Reads a 10X Genomics HDF5 file (CellRanger v2/v3 format) and converts
it to a sparse dgCMatrix suitable for use with gedi R6 object.
}
\examples{
\donttest{
# read_h5() expects a 10x Genomics filtered_feature_bc_matrix.h5 file.
# The example body runs only when such a file is on disk and hdf5r is
# installed; otherwise it is silently skipped.
h5_file <- "filtered_feature_bc_matrix.h5"
if (file.exists(h5_file) &&
    requireNamespace("hdf5r", quietly = TRUE)) {
  expr_matrix <- read_h5(h5_file)
  expr_matrix_ids <- read_h5(h5_file, feature_format = "gene_ids")
}
}

}
