Skip to content

sgkit zarr 3 migration - #1362

Merged
jeromekelleher merged 8 commits into
sgkit-dev:mainfrom
jpfeuffer:jpfeuffer-sgkit-zarr-3-migration
Oct 21, 2026
Merged

jeromekelleher merged 8 commits into
sgkit-dev:mainfrom
jpfeuffer:jpfeuffer-sgkit-zarr-3-migration

Conversation

@jpfeuffer

@jpfeuffer jpfeuffer commented Oct 16, 2026 •

Copy link
Copy Markdown

Require Zarr Python ≥3 and xarray ≥2026.9.0, updating storage APIs, string codecs, dependency locks and CI accordingly. The default on-disk Zarr format remains 2; format 3 is opt-in.

Remove the legacy BGEN reader and converters (read_bgen, bgen_to_zarr, rechunk_bgen), the deprecated PLINK reader/writer module (read_plink, plink_to_zarr, write_plink, zarr_to_plink), their optional extras and the cbgen, rechunker and bed-reader dependencies.

Use bio2zarr for conversion to Zarr and vcztools for export. Update migration guidance and remaining validation callers. BGEN conversion requires the work in sgkit-dev/bio2zarr#507; the corresponding exporter work is sgkit-dev/vcztools#440.

Retain sgkit.io.bgen.unpack_variables for existing legacy packed datasets without requiring cbgen, preserving its original import path.

jpfeuffer and others added 7 commits October 15, 2026 17:16
Preserve the default Zarr format 2 storage, support current string codecs and store types, and replace the incompatible deprecated BGEN rechunker backend with Xarray and Dask. Update the lockfile, minimum-version CI, regression tests and documentation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Drop bgen_to_zarr and rechunk_bgen following the maintainer decision. Preserve direct BGEN reading and legacy store unpacking, with tested manual read/chunk/save instructions while bio2zarr BGEN support is pending. Prominently document conversion via bio2zarr in the README, changelog, user guide and API reference.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Expose unpack_variables without the optional BGEN backend, preserve its old import path, and defer native reader imports until BGEN file access. Add blocked-backend import and unpacking regressions, preserve actionable dependency errors, and document the dependency-free API for issue 1331.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Delegate BGEN conversion to bio2zarr, remove the bgen extra and reader-only fixtures, and update dependency locking and wheel CI. Retain only dependency-free legacy unpacking and its compatibility import. Document the packed-store signature, reconstruction, missingness, lazy execution, and when not to unpack.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Clarify that BGEN reading and conversion are already removed, unlike the retained deprecated PLINK API, and point users to bio2zarr and legacy-store unpacking guidance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Restore the existing general wheel smoke script by removing the added BGEN export/dependency assertions and synthetic unpacking example, as requested. Leave established behavioral tests unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add the fsspec intersphinx inventory so StoreLike type annotations resolve FSMap. Use eager variable-length sample strings in the legacy packed-store fixture rather than unstable fixed-width UTF32 under Zarr format 3. Keep probability data chunked and warnings strict.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jpfeuffer

Copy link
Copy Markdown
Author

fixed the docs!

@jeromekelleher

Copy link
Copy Markdown
Member

I haven't looked through the details of this, but I'm all for removing the legacy readers and trying to make a slimmer, more maintainable sgkit - so I'm +1 on this in principle

@tomwhite

Copy link
Copy Markdown
Member

The default on-disk Zarr format remains 2.

I think this is reasonable for now. We've used zarr format v3 successfully where it's required for icechunk (using bio2zarr and vczstore). We should probably merge sgkit-dev/vcf-zarr-spec#42 now.

I'm all for removing the legacy readers

Me too - plink is deprecated so it can be removed too now.

@jpfeuffer

Copy link
Copy Markdown
Author

Okay! Can do, too!

Move remaining validation callers to bio2zarr and document the conversion migration. Remove the PLINK extra, native dependency, fixtures and wheel smoke test.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@jeromekelleher jeromekelleher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks @jpfeuffer !

@jeromekelleher

Copy link
Copy Markdown
Member

@Billyzhang1229 @tomwhite would you like to have a look over?

@tomwhite tomwhite left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

It's not clear to me why BGEN unpack_variables is needed - are there users who need it? Adding it introduces something else to maintain. Could it be a standalone script attached to a GH issue?

@jpfeuffer

Copy link
Copy Markdown
Author

I was actually using it. The old converter/rechunker here produced files in a packed representation that you needed to use this unpacking to get e.g. dosages.

see #1331

In the new bgen converter I actually don't use a packed representation so this should not be needed anymore. Unless we decide to support such a layout to save space with strictly diploid biallelic data. I kept it so people have a function to still unpack that old zarr representations.

@jpfeuffer

Copy link
Copy Markdown
Author

but yeah, happy to discuss in a follow-up issue. probably better suited there.

@jeromekelleher

Copy link
Copy Markdown
Member

I'm going to go ahead and merge them, thanks @jpfeuffer !

@jeromekelleher
jeromekelleher merged commit a8bc952 into sgkit-dev:main Oct 21, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move to Zarr >= 3 Remove (c)bgen dependency for unpack_variables?

3 participants