Skip to contents

Materializes the counts matrix as a dgCMatrix and hands it to the SCX Rust engine, which writes the AnnData layout directly. v1 writes only: X (counts assay), obs (colData), var (rowData), and uns (metadata coerced to JSON via jsonlite). obsm, obsp, varm, and additional layers are not yet supported and will be silently dropped.

Usage

write_h5ad(sce, path, assay = "counts", slot = "X", dtype = "f32")

Arguments

sce

A SingleCellExperiment (or any object with counts(), colData(), rowData(), metadata()).

path

Output .h5ad path.

assay

Name of the assay to use as X. Default "counts".

slot

Where the matrix goes in the file: "X" (default) or "layers/<name>", e.g. "layers/counts", which writes it there and leaves X absent.

dtype

Output X dtype: "f32", "f64", "i32", "u32". Default "f32" (matches scx convert default).

Value

path, invisibly.