Convert another AnnData object to an HDF5AnnData object
Arguments
- adata
An
AnnDataobject to be converted toHDF5AnnData- file
The file name (character) of the
.h5adfile- 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 toNULLto 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. When
groupis not"/", these apply to the groupgrouprather than the whole file:acreates a new file or opens an existing one for read/write. The group atgroupis created if it doesn't exist yet.ropens an existing file for reading, the groupgroupmust already exist.r+opens an existing file for read/write, the groupgroupmust already exist.wcreates a file, truncating any existing ones. Whengroup != "/", the file is created if missing but otherwise left untouched, and only the groupgroupis deleted and recreated. HDF5 doesn't free the space used by the deleted group, see the "File size" section ofwrite_h5ad().w-/xare synonyms, creating a file and failing if it already exists. Whengroup != "/", they instead fail if the groupgroupalready exists.
- backed
Whether the object is disk backed and returns DelayedArray::DelayedArray object for matrix data. Can only be
TRUEwhenmode == "r".- group
The path to the group within the HDF5 file that the
AnnDatais stored at. Defaults to"/", the file root. Can be used to write anAnnDatato a group inside a file that also contains other content, e.g. a modality inside a.h5mufile.
Value
An HDF5AnnData object with the same data as the input AnnData
object.
See also
Other object converters:
as_AnnData(),
as_InMemoryAnnData(),
as_ReticulateAnnData(),
as_Seurat(),
as_SingleCellExperiment(),
as_ZarrAnnData(),
reticulate-helpers