Skip to content

Commit

Permalink
updated README to include install from pypi and NWB conversion, and l…
Browse files Browse the repository at this point in the history
…ink to readme in setup.cfg (for PyPI description)
  • Loading branch information
calebweinreb committed Jan 29, 2024
1 parent 6389267 commit 4f73a39
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 7 deletions.
41 changes: 35 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SNUB (Systems Neuro Browser)
# Systems Neuro Browser (SNUB)

## [Read the documentation!](https://snub.readthedocs.io/en/latest/)

Expand All @@ -9,18 +9,17 @@ SNUB is a visual interface for systems neuroscience. Using a set of linked data-

## Installation

Create and activate a new conda environment with python≥3.8, clone this repo, and install via pip
Create and activate a new conda environment with python≥3.8 and install via pip
```
conda create -n snub python=3.8
conda activate snub
git clone https://github.com/calebweinreb/SNUB.git
pip install -e SNUB
pip install systems-neuro-browser
```
To speed up selections, `pip install ncls`. To use the 3D mesh viewer, install `pip install PyOpenGL PyOpenGL_accelerate`. The docs include more detailed [installation instructions](https://snub.readthedocs.io/en/latest/install.html).
To speed up selections, `pip install ncls`. To use the 3D pose viewer, install `pip install PyOpenGL PyOpenGL_accelerate`. The docs include more detailed [installation instructions](https://snub.readthedocs.io/en/latest/install.html).

## Getting Started

* Download the [example project](https://www.dropbox.com/sh/ujr3ttdc3gsxtqt/AAAKLL9iaF54cOwPKRPMTENIa?dl=0).
* Download the [example project](https://zenodo.org/records/10578025/files/miniscope_project.zip?download=1).
* Launch SNUB from the command line with the command `snub`.
* Go to `File > Open Project`, navigate to the project directory, and hit `Choose` with the directory selected.
* Alternatively, launch SNUB directly with the project path `snub /path/to/project/directory`.
Expand All @@ -38,3 +37,33 @@ snub.io.project.create_project(project_directory, duration=1800)
snub.io.project.add_video(project_directory, 'path/to/my_video.avi', name='IR_camera')
snub.io.project.add_splikeplot(project_directory, 'my_ephys_data', spike_times, spike_labels)
```

## Convert an NWB file

We provide a rudimentary tool for automatically generating SNUB datasets from Neurodata Without Borders (NWB) files, which contain raw and processed data from neuroscience recordings. The data in NWB files are stored hierarchically, and each component of the hierarchy has a specific neurodata type that reflects the measurement modality (e.g, "Units" for spike trains, "ImageSeries" for video). Our conversion tool generates a SNUB display element for each supported neurodata type. Users can optionally restrict this process to a subset of the NWB hierarchy (e.g., include pose tracking while excluding electrophysiology, or include just a subset of electrophysiology measurements). Here's an example:

```
# Run from the command line
# Download NWB file
dandi download https://api.dandiarchive.org/api/dandisets/000540/versions/0.230515.0530/assets/94307bee-459c-424e-b3a0-1e86b23f04b2/download/
# Download associated video and create directory for it
dandi download https://api.dandiarchive.org/api/dandisets/000540/versions/0.230515.0530/assets/942b0806-2c8b-4289-a072-9e965884fcb6/download/
mkdir sub-SLR087_ses-20180706_obj-14ua2bs_behavior+image
mv 9557b48e-46f0-45f2-a700-a2e15318c5bc_external_file_0.avi sub-SLR087_ses-20180706_obj-14ua2bs_behavior+image/
```

```
# Run in python
import os, snub
# Define paths
nwb_file = "sub-SLR087_ses-20180706_obj-14ua2bs_behavior+image.nwb"
name = os.path.splitext(os.path.basename(nwb_file))[0]
project_directory = os.path.join(os.path.dirname(nwb_file), f"SNUB-{name}")
# Make SNUB plot that includes video and torso tracking
snub.io.create_project_from_nwb(project_directory, nwb_file, branches=['torso_dlc', 'ImageSeries'])
```
7 changes: 6 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
[metadata]
author = Caleb Weinreb
author_email = [email protected]
url = https://github.com/dattalab/SNUB
url = https://github.com/calebweinreb/SNUB
description = Systems Neuro Browser
long_description = file:README.md
long_description_content_type = text/markdown
classifiers =
Programming Language :: Python :: 3
Operating System :: OS Independent



[options]
packages = find:
include_package_data = True
Expand Down

0 comments on commit 4f73a39

Please sign in to comment.