Skip to content

Commit

Permalink
Merge pull request #104 from catalystneuro/leifer
Browse files Browse the repository at this point in the history
Add 001075 example figure
  • Loading branch information
bendichter authored Oct 1, 2024
2 parents c079629 + 89b2791 commit 10c444a
Show file tree
Hide file tree
Showing 6 changed files with 635 additions and 0 deletions.
187 changes: 187 additions & 0 deletions 001075/001075_notebook_environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
name: leifer_notebooks_created_8_29_2024
channels:
- defaults
dependencies:
- bzip2=1.0.8=h2bbff1b_6
- ca-certificates=2024.7.2=haa95532_0
- expat=2.6.2=hd77b12b_0
- libffi=3.4.4=hd77b12b_1
- openssl=3.0.14=h827c3e9_0
- pip=24.2=py312haa95532_0
- python=3.12.4=h14ffc60_1
- setuptools=72.1.0=py312haa95532_0
- sqlite=3.45.3=h2bbff1b_0
- tk=8.6.14=h0416ee5_0
- vc=14.40=h2eaa2aa_0
- vs2015_runtime=14.40.33807=h98bb1dd_0
- wheel=0.43.0=py312haa95532_0
- xz=5.4.6=h8cc25b3_1
- zlib=1.2.13=h8cc25b3_1
- pip:
- aiobotocore==2.14.0
- aiohappyeyeballs==2.4.0
- aiohttp==3.10.5
- aioitertools==0.11.0
- aiosignal==1.3.1
- annotated-types==0.7.0
- anyio==4.4.0
- argon2-cffi==23.1.0
- argon2-cffi-bindings==21.2.0
- arrow==1.3.0
- asciitree==0.3.3
- asttokens==2.4.1
- async-lru==2.0.4
- attrs==24.2.0
- babel==2.16.0
- beautifulsoup4==4.12.3
- bidsschematools==0.7.2
- bleach==6.1.0
- botocore==1.35.7
- certifi==2024.8.30
- cffi==1.17.0
- charset-normalizer==3.3.2
- ci-info==0.3.0
- click==8.1.7
- click-didyoumean==0.3.1
- colorama==0.4.6
- comm==0.2.2
- contourpy==1.3.0
- cycler==0.12.1
- dandi==0.63.1
- dandischema==0.10.3
- debugpy==1.8.5
- decorator==5.1.1
- defusedxml==0.7.1
- dnspython==2.6.1
- email-validator==2.2.0
- etelemetry==0.3.1
- executing==2.0.1
- fasteners==0.19
- fastjsonschema==2.20.0
- fonttools==4.53.1
- fqdn==1.5.1
- frozenlist==1.4.1
- fscacher==0.4.1
- fsspec==2024.6.1
- h11==0.14.0
- h5py==3.11.0
- hdmf==3.14.3
- hdmf-zarr==0.8.0
- httpcore==1.0.5
- httpx==0.27.2
- humanize==4.10.0
- idna==3.8
- interleave==0.2.1
- ipykernel==6.29.5
- ipython==8.26.0
- ipywidgets==8.1.5
- isodate==0.6.1
- isoduration==20.11.0
- jaraco-classes==3.4.0
- jaraco-context==6.0.1
- jaraco-functools==4.0.2
- jedi==0.19.1
- jinja2==3.1.4
- jmespath==1.0.1
- joblib==1.4.2
- json5==0.9.25
- jsonpointer==3.0.0
- jsonschema==4.23.0
- jsonschema-specifications==2023.12.1
- jupyter==1.1.0
- jupyter-client==8.6.2
- jupyter-console==6.6.3
- jupyter-core==5.7.2
- jupyter-events==0.10.0
- jupyter-lsp==2.2.5
- jupyter-server==2.14.2
- jupyter-server-terminals==0.5.3
- jupyterlab==4.2.5
- jupyterlab-pygments==0.3.0
- jupyterlab-server==2.27.3
- jupyterlab-widgets==3.0.13
- keyring==25.3.0
- keyrings-alt==5.0.2
- kiwisolver==1.4.5
- markupsafe==2.1.5
- matplotlib==3.9.2
- matplotlib-inline==0.1.7
- mistune==3.0.2
- more-itertools==10.4.0
- multidict==6.0.5
- natsort==8.4.0
- nbclient==0.10.0
- nbconvert==7.16.4
- nbformat==5.10.4
- nest-asyncio==1.6.0
- notebook==7.2.2
- notebook-shim==0.2.4
- numcodecs==0.13.0
- numpy==1.26.4
- nwbinspector==0.5.1
- overrides==7.7.0
- packaging==24.1
- pandas==2.2.2
- pandocfilters==1.5.1
- parso==0.8.4
- pillow==10.4.0
- platformdirs==4.2.2
- prometheus-client==0.20.0
- prompt-toolkit==3.0.47
- psutil==6.0.0
- pure-eval==0.2.3
- pycparser==2.22
- pycryptodomex==3.20.0
- pydantic==2.8.2
- pydantic-core==2.20.1
- pygments==2.18.0
- pynwb==2.8.1
- pyout==0.7.3
- pyparsing==3.1.4
- python-dateutil==2.9.0.post0
- python-json-logger==2.0.7
- pytz==2024.1
- pywin32==306
- pywin32-ctypes==0.2.3
- pywinpty==2.0.13
- pyyaml==6.0.2
- pyzmq==26.2.0
- referencing==0.35.1
- remfile==0.1.13
- requests==2.32.3
- rfc3339-validator==0.1.4
- rfc3986-validator==0.1.1
- rfc3987==1.3.8
- rpds-py==0.20.0
- ruamel-yaml==0.18.6
- ruamel-yaml-clib==0.2.8
- s3fs==2024.6.1
- scipy==1.14.1
- semantic-version==2.10.0
- send2trash==1.8.3
- six==1.16.0
- sniffio==1.3.1
- soupsieve==2.6
- stack-data==0.6.3
- tenacity==9.0.0
- terminado==0.18.1
- threadpoolctl==3.5.0
- tinycss2==1.3.0
- tornado==6.4.1
- tqdm==4.66.5
- traitlets==5.14.3
- types-python-dateutil==2.9.0.20240821
- typing-extensions==4.12.2
- tzdata==2024.1
- uri-template==1.3.0
- urllib3==2.2.2
- wcwidth==0.2.13
- webcolors==24.8.0
- webencodings==0.5.1
- websocket-client==1.8.0
- widgetsnbextension==4.0.13
- wrapt==1.16.0
- yarl==1.9.4
- zarr==2.18.2
- zarr-checksum==0.4.2
prefix: C:\Users\theac\anaconda3\envs\leifer_notebooks_created_8_29_2024
115 changes: 115 additions & 0 deletions 001075/001075_paper_figure_1d.ipynb

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions 001075/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 001075 - Neural signal propagation atlas of Caenorhabditis elegans

## How to cite

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



## Setup

Install [Conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) on your machine.
Install `git` and clone the example notebook repository:

```bash
conda install git
git clone https://github.com/dandi/example-notebooks.git
```

Then create a specific environment for this notebook using:

```bash
conda env create --file example-notebooks/001075/001075_notebook_environment.yml
```

Then activate the environment:

```bash
conda activate leifer_notebooks_created_8_29_2024
```

Finally, start Jupyter:

```bash
jupyter notebook
```

And select the notebook `001075_paper_figure_1d.ipynb` from the file explorer in the browser.

If interested in creating your own plots, refer to the code in `utils_001075` for how to handle the data streams.

Note that all timing information is aligned to the NeuroPAL imaging system.



## Help

- Dataset: https://dandiarchive.org/dandiset/001075/0.240930.1859
- Original publication: [Neural signal propagation atlas of Caenorhabditis elegans](https://www.nature.com/articles/s41586-023-06683-4)
- [Visualize (Neurosift)](https://neurosift.app/?p=/dandiset&dandisetId=001075&dandisetVersion=0.240930.1859)
- Note: the files are split by 'imaging' (raw) and 'segmentation' (processed). To view both, select a combined
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).
- [NWB file basics](https://pynwb.readthedocs.io/en/stable/tutorials/general/plot_file.html#sphx-glr-tutorials-general-plot-file-py)
- [How to read NWB files](https://pynwb.readthedocs.io/en/stable/tutorials/general/scratch.html#sphx-glr-tutorials-general-scratch-py)
- [Data analysis with NWB files](https://pynwb.readthedocs.io/en/stable/tutorials/general/scratch.html#sphx-glr-tutorials-general-scratch-py)
4 changes: 4 additions & 0 deletions 001075/utils_001075/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from ._waterfall import plot_waterfall
from ._stream_nwbfile import stream_nwbfile

__all__ = ["plot_waterfall", "stream_nwbfile"]
21 changes: 21 additions & 0 deletions 001075/utils_001075/_stream_nwbfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from typing import Literal

import dandi.dandiapi
import h5py
import pynwb
import remfile

def stream_nwbfile(subject_id: str, session_id: str, session_type: Literal["imaging", "segmentation"]) -> pynwb.NWBFile:
dandiset_id = "001075"
dandifile_path = f"sub-{subject_id}/sub-{subject_id}_ses-{session_id}_desc-{session_type}_ophys+ogen.nwb"

dandi_client = dandi.dandiapi.DandiAPIClient()
dandiset = dandi_client.get_dandiset(dandiset_id=dandiset_id)
dandifile = dandiset.get_asset_by_path(path=dandifile_path)
s3_url = dandifile.get_content_url()
byte_stream = remfile.File(url=s3_url)
file = h5py.File(name=byte_stream)
io = pynwb.NWBHDF5IO(file=file)
nwbfile = io.read()

return nwbfile
Loading

0 comments on commit 10c444a

Please sign in to comment.