Skip to content

Convert: h5ad ↔ zarr #22

Description

@Claptar

Part of #20. Depends on #21.

Goal

adata convert data.h5ad -o data.zarr [--zarr-format 2|3]
adata convert data.zarr -o data.h5ad

This already works implicitly through adata subset in.h5ad -o out.zarr, which proves copy_store_contents handles every backend pair. A dedicated, discoverable command is what's missing.

Plan

  • Thin converter over storage.copy_store_contents.
  • Keep the source's chunking and compression by default; add --rechunk and --compressor for zarr targets.
  • Write consolidated metadata for zarr targets.
  • zarr v3 by default from an h5ad source (existing behaviour); follow the source format for zarr → zarr.
  • Refuse -o - and output == input.

Tests

  • All six pairings of h5ad / zarr2 / zarr3.
  • Open the result with anndata.read_zarr / read_h5ad under the integration marker.
  • Perf guard: one read per chunk, no full materialisation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions