Skip to contents

Convert another AnnData object to an HDF5AnnData object

Usage

as_HDF5AnnData(
  adata,
  file,
  compression = c("none", "gzip", "lzf"),
  chunk_size = "auto",
  mode = c("w-", "r", "r+", "a", "w", "x")
)

Arguments

adata

An AnnData object to be converted to HDF5AnnData

file

The file name (character) of the .h5ad file

compression

The compression algorithm to use when writing the HDF5 file. Can be one of "none", "gzip" or "lzf". Defaults to "none".

chunk_size

The target chunk size in bytes to use when writing HDF5 datasets. When "auto" (default), the chunk size is determined automatically using an algorithm that mimics h5py's auto-chunking behaviour. Set to NULL to disable chunking (contiguous storage, the rhdf5 default), or a number to use a specific target size in bytes.

mode

The mode to open the HDF5 file:

  • a creates a new file or opens an existing one for read/write

  • r opens an existing file for reading

  • r+ opens an existing file for read/write

  • w creates a file, truncating any existing ones

  • w-/x are synonyms, creating a file and failing if it already exists

Value

An HDF5AnnData object with the same data as the input AnnData object.