mantispy.io.read

Contents

mantispy.io.read#

mantispy.io.read(path, backed=None, migrate_schema=True)#

Read a mantispy h5ad or zarr store, checking its schema version.

Parameters:
  • path (str | Path) – File to read. A .zarr suffix selects the zarr reader.

  • backed (Literal['r', 'r+'] | None (default: None)) – "r" leaves X on disk and reads it a group at a time. obs and var are always in memory, so QC, feature flags and metadata work unchanged, but a function that rewrites X needs copy=True or key_added=. h5ad only; zarr stores are read whole.

  • migrate_schema (bool (default: True)) – Bring an older but known schema up to the current one on read. Set it to False to see the version the file carries.

Return type:

AnnData

Returns:

The object, backed or in memory. adata.to_memory() loads a backed one into memory.

Raises:

ValueErrorbacked was given for a zarr store, or the file carries a schema version this build cannot migrate from or was told not to migrate.