anndata.AnnData.write_zarr#

AnnData.write_zarr(store, *, chunks=None, convert_strings_to_categoricals=True, consolidate_metadata=True, use=None, compat=<WriteCompat.V0_13: '0.13'>)[source]#

Write a hierarchical Zarr array store.

Parameters:
store StoreLike

The filename, a MutableMapping, or a Zarr storage class.

chunks tuple[int, ...] | None

Chunk shape.

convert_strings_to_categoricals bool

Convert string columns to categorical.

consolidate_metadata bool

Whether to consolidate the metadata of the store after writing.

use AdRef | RefAcc | MapAcc | Sequence[AdRef | RefAcc | MapAcc] | None

Only write the element(s) referenced by this accessor (or list of accessors) into an existing AnnData store, e.g. A.obs["a"] (a single column, updating the column order), A.obs, A.X, A.layers["counts"], A.layers, A.obsm["pca"], or A.obsp. Lists such as [A.X, *A.obs[["a", "b"]]] are written together after validating all entries.

compat WriteConfig | WriteCompatStr

Which anndata version’s write behavior to target, see WriteCompat.