Skip to content
Draft
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
10 changes: 10 additions & 0 deletions 001699/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Example Sessions for Dandiset 001699

This submission provides four notebooks showcasing example sessions for the Dandiset 001699. The notebooks cover both age groups (juvenile and adult) and both genotypes (wild-type and Fmr1 knockout).

The notebooks provide examples of how to access the critical data and metadata from the sessions in the dataset:

- `example_notebook_juvenile_wt.ipynb` showcases an example juvenile wild-type session (subject H3022, session H3022-210806) containing task epochs, position tracking, sleep classification, raw electrophysiology, LFP, spike-sorted units, and histology images.
- `example_notebook_juvenile_ko.ipynb` showcases an example juvenile Fmr1 knockout session (subject H3016, session H3016-210422) containing task epochs, position tracking, sleep classification, raw electrophysiology, LFP, spike-sorted units, and histology images.
- `example_notebook_adult_wt.ipynb` showcases an example adult wild-type session (subject H4813, session H4813-220728) containing task epochs, position tracking, sleep classification, raw electrophysiology, LFP, spike-sorted units, and histology images.
- `example_notebook_adult_ko.ipynb` showcases an example adult Fmr1 knockout session (subject H4817, session H4817-220828) containing task epochs, position tracking, sleep classification, raw electrophysiology, LFP, spike-sorted units, and histology images.
14 changes: 14 additions & 0 deletions 001699/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# run: conda env create --file environment.yml
name: dudchenko_notebook_env
channels:
- conda-forge
dependencies:
- python==3.13
- ipykernel
- matplotlib
- numpy
- pip
- pip:
- dandi
- remfile
- pynwb
1,531 changes: 1,531 additions & 0 deletions 001699/example_notebook_adult_ko.ipynb

Large diffs are not rendered by default.

1,560 changes: 1,560 additions & 0 deletions 001699/example_notebook_adult_wt.ipynb

Large diffs are not rendered by default.

1,535 changes: 1,535 additions & 0 deletions 001699/example_notebook_juvenile_ko.ipynb

Large diffs are not rendered by default.

1,535 changes: 1,535 additions & 0 deletions 001699/example_notebook_juvenile_wt.ipynb

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions 001699/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
Loading