Skip to content

Commit 10c444a

Browse files
authored
Merge pull request #104 from catalystneuro/leifer
Add 001075 example figure
2 parents c079629 + 89b2791 commit 10c444a

File tree

6 files changed

+635
-0
lines changed

6 files changed

+635
-0
lines changed
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
name: leifer_notebooks_created_8_29_2024
2+
channels:
3+
- defaults
4+
dependencies:
5+
- bzip2=1.0.8=h2bbff1b_6
6+
- ca-certificates=2024.7.2=haa95532_0
7+
- expat=2.6.2=hd77b12b_0
8+
- libffi=3.4.4=hd77b12b_1
9+
- openssl=3.0.14=h827c3e9_0
10+
- pip=24.2=py312haa95532_0
11+
- python=3.12.4=h14ffc60_1
12+
- setuptools=72.1.0=py312haa95532_0
13+
- sqlite=3.45.3=h2bbff1b_0
14+
- tk=8.6.14=h0416ee5_0
15+
- vc=14.40=h2eaa2aa_0
16+
- vs2015_runtime=14.40.33807=h98bb1dd_0
17+
- wheel=0.43.0=py312haa95532_0
18+
- xz=5.4.6=h8cc25b3_1
19+
- zlib=1.2.13=h8cc25b3_1
20+
- pip:
21+
- aiobotocore==2.14.0
22+
- aiohappyeyeballs==2.4.0
23+
- aiohttp==3.10.5
24+
- aioitertools==0.11.0
25+
- aiosignal==1.3.1
26+
- annotated-types==0.7.0
27+
- anyio==4.4.0
28+
- argon2-cffi==23.1.0
29+
- argon2-cffi-bindings==21.2.0
30+
- arrow==1.3.0
31+
- asciitree==0.3.3
32+
- asttokens==2.4.1
33+
- async-lru==2.0.4
34+
- attrs==24.2.0
35+
- babel==2.16.0
36+
- beautifulsoup4==4.12.3
37+
- bidsschematools==0.7.2
38+
- bleach==6.1.0
39+
- botocore==1.35.7
40+
- certifi==2024.8.30
41+
- cffi==1.17.0
42+
- charset-normalizer==3.3.2
43+
- ci-info==0.3.0
44+
- click==8.1.7
45+
- click-didyoumean==0.3.1
46+
- colorama==0.4.6
47+
- comm==0.2.2
48+
- contourpy==1.3.0
49+
- cycler==0.12.1
50+
- dandi==0.63.1
51+
- dandischema==0.10.3
52+
- debugpy==1.8.5
53+
- decorator==5.1.1
54+
- defusedxml==0.7.1
55+
- dnspython==2.6.1
56+
- email-validator==2.2.0
57+
- etelemetry==0.3.1
58+
- executing==2.0.1
59+
- fasteners==0.19
60+
- fastjsonschema==2.20.0
61+
- fonttools==4.53.1
62+
- fqdn==1.5.1
63+
- frozenlist==1.4.1
64+
- fscacher==0.4.1
65+
- fsspec==2024.6.1
66+
- h11==0.14.0
67+
- h5py==3.11.0
68+
- hdmf==3.14.3
69+
- hdmf-zarr==0.8.0
70+
- httpcore==1.0.5
71+
- httpx==0.27.2
72+
- humanize==4.10.0
73+
- idna==3.8
74+
- interleave==0.2.1
75+
- ipykernel==6.29.5
76+
- ipython==8.26.0
77+
- ipywidgets==8.1.5
78+
- isodate==0.6.1
79+
- isoduration==20.11.0
80+
- jaraco-classes==3.4.0
81+
- jaraco-context==6.0.1
82+
- jaraco-functools==4.0.2
83+
- jedi==0.19.1
84+
- jinja2==3.1.4
85+
- jmespath==1.0.1
86+
- joblib==1.4.2
87+
- json5==0.9.25
88+
- jsonpointer==3.0.0
89+
- jsonschema==4.23.0
90+
- jsonschema-specifications==2023.12.1
91+
- jupyter==1.1.0
92+
- jupyter-client==8.6.2
93+
- jupyter-console==6.6.3
94+
- jupyter-core==5.7.2
95+
- jupyter-events==0.10.0
96+
- jupyter-lsp==2.2.5
97+
- jupyter-server==2.14.2
98+
- jupyter-server-terminals==0.5.3
99+
- jupyterlab==4.2.5
100+
- jupyterlab-pygments==0.3.0
101+
- jupyterlab-server==2.27.3
102+
- jupyterlab-widgets==3.0.13
103+
- keyring==25.3.0
104+
- keyrings-alt==5.0.2
105+
- kiwisolver==1.4.5
106+
- markupsafe==2.1.5
107+
- matplotlib==3.9.2
108+
- matplotlib-inline==0.1.7
109+
- mistune==3.0.2
110+
- more-itertools==10.4.0
111+
- multidict==6.0.5
112+
- natsort==8.4.0
113+
- nbclient==0.10.0
114+
- nbconvert==7.16.4
115+
- nbformat==5.10.4
116+
- nest-asyncio==1.6.0
117+
- notebook==7.2.2
118+
- notebook-shim==0.2.4
119+
- numcodecs==0.13.0
120+
- numpy==1.26.4
121+
- nwbinspector==0.5.1
122+
- overrides==7.7.0
123+
- packaging==24.1
124+
- pandas==2.2.2
125+
- pandocfilters==1.5.1
126+
- parso==0.8.4
127+
- pillow==10.4.0
128+
- platformdirs==4.2.2
129+
- prometheus-client==0.20.0
130+
- prompt-toolkit==3.0.47
131+
- psutil==6.0.0
132+
- pure-eval==0.2.3
133+
- pycparser==2.22
134+
- pycryptodomex==3.20.0
135+
- pydantic==2.8.2
136+
- pydantic-core==2.20.1
137+
- pygments==2.18.0
138+
- pynwb==2.8.1
139+
- pyout==0.7.3
140+
- pyparsing==3.1.4
141+
- python-dateutil==2.9.0.post0
142+
- python-json-logger==2.0.7
143+
- pytz==2024.1
144+
- pywin32==306
145+
- pywin32-ctypes==0.2.3
146+
- pywinpty==2.0.13
147+
- pyyaml==6.0.2
148+
- pyzmq==26.2.0
149+
- referencing==0.35.1
150+
- remfile==0.1.13
151+
- requests==2.32.3
152+
- rfc3339-validator==0.1.4
153+
- rfc3986-validator==0.1.1
154+
- rfc3987==1.3.8
155+
- rpds-py==0.20.0
156+
- ruamel-yaml==0.18.6
157+
- ruamel-yaml-clib==0.2.8
158+
- s3fs==2024.6.1
159+
- scipy==1.14.1
160+
- semantic-version==2.10.0
161+
- send2trash==1.8.3
162+
- six==1.16.0
163+
- sniffio==1.3.1
164+
- soupsieve==2.6
165+
- stack-data==0.6.3
166+
- tenacity==9.0.0
167+
- terminado==0.18.1
168+
- threadpoolctl==3.5.0
169+
- tinycss2==1.3.0
170+
- tornado==6.4.1
171+
- tqdm==4.66.5
172+
- traitlets==5.14.3
173+
- types-python-dateutil==2.9.0.20240821
174+
- typing-extensions==4.12.2
175+
- tzdata==2024.1
176+
- uri-template==1.3.0
177+
- urllib3==2.2.2
178+
- wcwidth==0.2.13
179+
- webcolors==24.8.0
180+
- webencodings==0.5.1
181+
- websocket-client==1.8.0
182+
- widgetsnbextension==4.0.13
183+
- wrapt==1.16.0
184+
- yarl==1.9.4
185+
- zarr==2.18.2
186+
- zarr-checksum==0.4.2
187+
prefix: C:\Users\theac\anaconda3\envs\leifer_notebooks_created_8_29_2024

001075/001075_paper_figure_1d.ipynb

Lines changed: 115 additions & 0 deletions
Large diffs are not rendered by default.

001075/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# 001075 - Neural signal propagation atlas of Caenorhabditis elegans
2+
3+
## How to cite
4+
5+
Randi, Francesco; Sharma, Anuj; Dvali, Sophie; Leifer, Andrew M. (2024) Neural signal propagation atlas of Caenorhabditis elegans (Version 0.240930.1859) [Data set]. DANDI archive. https://doi.org/10.48324/dandi.001075/0.240930.1859
6+
7+
8+
9+
## Setup
10+
11+
Install [Conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) on your machine.
12+
Install `git` and clone the example notebook repository:
13+
14+
```bash
15+
conda install git
16+
git clone https://github.com/dandi/example-notebooks.git
17+
```
18+
19+
Then create a specific environment for this notebook using:
20+
21+
```bash
22+
conda env create --file example-notebooks/001075/001075_notebook_environment.yml
23+
```
24+
25+
Then activate the environment:
26+
27+
```bash
28+
conda activate leifer_notebooks_created_8_29_2024
29+
```
30+
31+
Finally, start Jupyter:
32+
33+
```bash
34+
jupyter notebook
35+
```
36+
37+
And select the notebook `001075_paper_figure_1d.ipynb` from the file explorer in the browser.
38+
39+
If interested in creating your own plots, refer to the code in `utils_001075` for how to handle the data streams.
40+
41+
Note that all timing information is aligned to the NeuroPAL imaging system.
42+
43+
44+
45+
## Help
46+
47+
- Dataset: https://dandiarchive.org/dandiset/001075/0.240930.1859
48+
- Original publication: [Neural signal propagation atlas of Caenorhabditis elegans](https://www.nature.com/articles/s41586-023-06683-4)
49+
- [Visualize (Neurosift)](https://neurosift.app/?p=/dandiset&dandisetId=001075&dandisetVersion=0.240930.1859)
50+
- Note: the files are split by 'imaging' (raw) and 'segmentation' (processed). To view both, select a combined
51+
view for the same session: [example](https://neurosift.app/?p=/nwb&url=https://api.dandiarchive.org/api/assets/5feda038-0c84-494a-a0e0-c3ef8ec194d1/download/&url=https://api.dandiarchive.org/api/assets/40a6799b-4835-4170-89bb-9a866082e503/download/&dandisetId=001075&dandisetVersion=draft).
52+
- [NWB file basics](https://pynwb.readthedocs.io/en/stable/tutorials/general/plot_file.html#sphx-glr-tutorials-general-plot-file-py)
53+
- [How to read NWB files](https://pynwb.readthedocs.io/en/stable/tutorials/general/scratch.html#sphx-glr-tutorials-general-scratch-py)
54+
- [Data analysis with NWB files](https://pynwb.readthedocs.io/en/stable/tutorials/general/scratch.html#sphx-glr-tutorials-general-scratch-py)

001075/utils_001075/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from ._waterfall import plot_waterfall
2+
from ._stream_nwbfile import stream_nwbfile
3+
4+
__all__ = ["plot_waterfall", "stream_nwbfile"]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from typing import Literal
2+
3+
import dandi.dandiapi
4+
import h5py
5+
import pynwb
6+
import remfile
7+
8+
def stream_nwbfile(subject_id: str, session_id: str, session_type: Literal["imaging", "segmentation"]) -> pynwb.NWBFile:
9+
dandiset_id = "001075"
10+
dandifile_path = f"sub-{subject_id}/sub-{subject_id}_ses-{session_id}_desc-{session_type}_ophys+ogen.nwb"
11+
12+
dandi_client = dandi.dandiapi.DandiAPIClient()
13+
dandiset = dandi_client.get_dandiset(dandiset_id=dandiset_id)
14+
dandifile = dandiset.get_asset_by_path(path=dandifile_path)
15+
s3_url = dandifile.get_content_url()
16+
byte_stream = remfile.File(url=s3_url)
17+
file = h5py.File(name=byte_stream)
18+
io = pynwb.NWBHDF5IO(file=file)
19+
nwbfile = io.read()
20+
21+
return nwbfile

0 commit comments

Comments
 (0)