Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions 001471/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Example Sessions for Dandiset 001471

This submission provides a notebook showcasing 4 example sessions for the Dandiset 001471.

This notebook provides an example of how to access the critical data and metadata for each of the 2 primary data streams:

- Behavioral events during the social task
- DeepLabCut pose estimation

It also showcases each of the 3 different session types:

- 100% Reward
- 50% Reward
- Opaque Control

It also showcases each of the 2 different genotypes:

- Fmr1-/y
- WT
14 changes: 14 additions & 0 deletions 001471/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# run: conda env create --file environment.yml
name: jadhav_notebook_env
channels:
- conda-forge
dependencies:
- python==3.12
- ipykernel
- matplotlib
- dandi
- networkx
- pip
- pip:
- remfile
- jadhav-lab-to-nwb @ git+https://github.com/catalystneuro/jadhav-lab-to-nwb.git@main
2,318 changes: 2,318 additions & 0 deletions 001471/example_notebook.ipynb

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions 001471/stream_nwbfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from pynwb import NWBHDF5IO
import remfile
import h5py
from dandi.dandiapi import DandiAPIClient

def stream_nwbfile(DANDISET_ID, file_path):
'''Stream NWB file from DANDI archive.

Parameters
----------
DANDISET_ID : str
Dandiset ID
file_path : str
Path to NWB file in DANDI archive

Returns
-------
nwbfile : NWBFile
NWB file
io : NWBHDF5IO
NWB IO object (for closing)

Notes
-----
The io object must be closed after use.
'''
with DandiAPIClient() as client:
client.dandi_authenticate()
asset = client.get_dandiset(DANDISET_ID, 'draft').get_asset_by_path(file_path)
s3_url = asset.get_content_url(follow_redirects=1, strip_query=False)
file_system = remfile.File(s3_url)
file = h5py.File(file_system, mode="r")
io = NWBHDF5IO(file=file, load_namespaces=True)
nwbfile = io.read()
return nwbfile, io