mantispy.io.write#

mantispy.io.write(adata, path, compression=None, compression_opts=None)[source]#

Validate and write adata as h5ad (default) or zarr (.zarr suffix).

Parameters:
adata AnnData

Object to write, stamped with the current schema version before it is checked.

path str | Path

Where to write it. A .zarr suffix selects the zarr writer.

compression Literal['gzip', 'lzf'] | None (default: None)

Passed to write_h5ad(); "gzip" shrinks a large imaging table substantially at the cost of write time. Ignored for the zarr writer, which compresses by default.

compression_opts int | None (default: None)

The compression level passed alongside compression (h5ad only).

Raises:

ValueError – The object does not satisfy the schema, with every failure validate() found in the message.

Return type:

None

Notes

An object from an earlier mantispy is migrated first, so it is never relabelled as current without its content being brought up to date. A write that fails validation leaves uns["mantispy"] as it was.