-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from catalystneuro/000971
000971
- Loading branch information
Showing
7 changed files
with
881 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
*.DS_Store | ||
*__pycache__/ | ||
*.ipynb_checkpoints/ | ||
output/ | ||
output/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Example Sessions for Dandiset 000971 | ||
|
||
This submission provides 2 notebooks showcasing example sessions for the Dandiset 000971, which corresponds to the 2022 Current Biology paper: [Dopamine signaling in the dorsomedial striatum promotes compulsive behavior](https://doi.org/10.1016/j.cub.2022.01.055.) by Seiler et al. | ||
|
||
Each notebook provides an example of how to access the critical data and metadata from the 2 types of experiments in the dataset: | ||
|
||
- `fiber_photometry_example_notebook.ipynb` showcases one example session from the 000971 dataset containing operant behavior and concurrent fiber photometry recordings. | ||
- `optogenetics_example_notebook.ipynb` showcases one example session from the 000971 dataset containing operant behavior and concurrent excitatory optogenetic stimulation. |
Binary file added
BIN
+1.23 KB
000971/lernerlab/seiler_2024/__pycache__/stream_nwbfile.cpython-310.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# run: conda env create --file environment.yaml | ||
name: lerner_notebook_env | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python==3.10 | ||
- ipywidgets | ||
- pip | ||
- pip: | ||
- matplotlib | ||
- lerner-lab-to-nwb @ git+https://github.com/catalystneuro/lerner-lab-to-nwb.git@main |
524 changes: 524 additions & 0 deletions
524
000971/lernerlab/seiler_2024/fiber_photometry_example_notebook.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
301 changes: 301 additions & 0 deletions
301
000971/lernerlab/seiler_2024/optogenetics_example_notebook.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from pynwb import NWBHDF5IO | ||
from fsspec import filesystem | ||
from h5py import File | ||
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: | ||
asset = client.get_dandiset(DANDISET_ID, 'draft').get_asset_by_path(file_path) | ||
s3_url = asset.get_content_url(follow_redirects=1, strip_query=True) | ||
fs = filesystem("http") | ||
file_system = fs.open(s3_url, "rb") | ||
file = File(file_system, mode="r") | ||
io = NWBHDF5IO(file=file, load_namespaces=True) | ||
nwbfile = io.read() | ||
return nwbfile, io |