Skip to content

How to merge two NWB HDF5 files into an NWB Zarr? #94

Answered by rly
rly asked this question in Q&A
Discussion options

You must be logged in to vote

The overall workflow is something like:

  1. Open and read behavior HDF5 file with pynwb
  2. Open and read ophys HDF5 file with pynwb
  3. Add behavior objects from behavior NWBFile to ophys NWBFile - like you have in your code
  4. Export modified ophys NWBFile to Zarr using hdmf_zarr.NWBZarrIO:
with NWBZarrIO(zarr_filename, mode='w') as export_io:
    export_io.export(src_io=read_io, write_args=dict(link_data=False))

That particular workflow of open, add, export from HDF5 to Zarr may have some rough edges. Let me know if you run into any issues!

import pynwb
import hdmf_zarr

ophys_nwb_file_path = "/Users/rly/Downloads/dataset-5c19bc2b-3332-40b0-9ff3-a801f32b020b/multiplane-ophys_753906_2025-01-30_11-20…

Replies: 1 comment

Comment options

rly
Mar 4, 2025
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by rly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant