Skip to contents

Read or write a sparse matrix from an anndata hdf5 file. These functions will automatically transpose matrices when converting to/from the AnnData format. This is because the AnnData convention stores cells as rows, whereas the R convention stores cells as columns. If this behavior is undesired, call t() manually on the matrix inputs and outputs of these functions.

Usage

open_matrix_anndata_hdf5(path, group = "X", buffer_size = 16384L)

write_matrix_anndata_hdf5(
  mat,
  path,
  group = "X",
  buffer_size = 16384L,
  chunk_size = 1024L,
  gzip_level = 0L
)

Arguments

path

Path to the hdf5 file on disk

group

The group within the hdf5 file to write the data to. If writing to an existing hdf5 file this group must not already be in use

buffer_size

For performance tuning only. The number of items to be buffered in memory before calling writes to disk.

chunk_size

For performance tuning only. The chunk size used for the HDF5 array storage.

gzip_level

Gzip compression level. Default is 0 (no compression)

Value

AnnDataMatrixH5 object, with cells as the columns.