Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support h5ad via reference spec #1811

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

keller-mark
Copy link
Member

@keller-mark keller-mark commented Feb 23, 2024

Fixes #483

Depends on manzt/zarrita.js#153

Background

Create a reference spec JSON for a local or remote H5AD file using kerchunk:

from kerchunk.hdf import SingleHdf5ToZarr
import json

h5_url = "https://storage.googleapis.com/vitessce-demo-data/habib-2017/habib17.processed.h5ad"
h5chunks = SingleHdf5ToZarr(h5_url, inline_threshold=300)
with open("habib17.reference.json", 'wb') as f:
    f.write(json.dumps(h5chunks.translate()).encode());

(to read back in using Zarr-python):

import fsspec
import zarr

fs = fsspec.filesystem('reference', fo='habib17.reference.json')
m = fs.get_mapper('')

group = zarr.group(store=m)
group['/obs/CellType/categories'][()]

TODO:

  • document this feature
  • deploy a demo
  • clarify what happens if the H5AD is moved (since the remote URL contained in the JSON won't match) (Add options for ReferenceStore manzt/zarrita.js#155)
  • clarify what happens if the reference is created locally but then hosted remotely (since the local path contained in the JSON won't match the remote URL) (Add options for ReferenceStore manzt/zarrita.js#155)
  • new view config version for obsSets.anndata.zarr and obsFeatureColumns.anndata.zarr options schema changes (array to object) (see comments in packages/schemas/src/file-def-options.ts)
  • create utility function in vitessce-python repo for creation of reference spec for local and remote H5AD files

Change List

Checklist

  • Ensure PR works with all demos on the dev.vitessce.io homepage
  • Open (draft) PR's into vitessce-python and vitessce-r if this is a release PR
  • Documentation added or updated

Copy link
Contributor

github-actions bot commented Feb 23, 2024

Size Change: +8.94 kB (0%)

Total Size: 13 MB

Filename Size Change
./packages/main/prod/dist/index-********.js 7.24 MB +8.94 kB (0%)
ℹ️ View Unchanged
Filename Size
./packages/main/prod/dist/blosc-********.js 612 kB
./packages/main/prod/dist/browser-********.js 16.2 kB
./packages/main/prod/dist/chunk-INHXZS53-********.js 558 B
./packages/main/prod/dist/deflate-********.js 243 B
./packages/main/prod/dist/gzip-********.js 693 B
./packages/main/prod/dist/hglib-********.js 4.33 MB
./packages/main/prod/dist/index.min.js 902 B
./packages/main/prod/dist/jpeg-********.js 15.3 kB
./packages/main/prod/dist/lerc-********.js 47.2 kB
./packages/main/prod/dist/lz4-********.js 43.9 kB
./packages/main/prod/dist/lzw-********.js 2.1 kB
./packages/main/prod/dist/packbits-********.js 576 B
./packages/main/prod/dist/pako.esm-********.js 68.6 kB
./packages/main/prod/dist/raw-********.js 168 B
./packages/main/prod/dist/webimage-********.js 836 B
./packages/main/prod/dist/zlib-********.js 695 B
./packages/main/prod/dist/zstd-********.js 643 kB

compressed-size-action

@keller-mark keller-mark changed the title Support reference spec h5ad Support h5ad via reference spec Feb 23, 2024
Base automatically changed from keller-mark/zip-support to main March 4, 2024 14:13
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.

Read HDF5 based formats directly in JS
1 participant