Skip to main content

PyPI version Full Tests Auto-release codecov documentation License

NWB conversion tools

NWB Conversion Tools is a package for creating NWB files by converting and combining neural data in proprietary formats and adding essential metadata.

Under heavy construction. API is changing rapidly.

Features:

  • Command line interface
  • Python API
  • Leverages SpikeExtractor to support conversion from a number or proprietary formats.

Installation

To install the latest stable release of nwb-conversion-tools though PyPI, type:

pip install nwb-conversion-tools

For more flexibility we recommend installing the latest version directly from GitHub. The following commands create an environment with all the required dependencies and the latest updates:

git clone https://github.com/catalystneuro/nwb-conversion-tools
cd nwb-conversion-tools
conda env create -f make_env.yml
conda activate nwb_conversion_env

Note that this will install the package in editable mode.

Finally, if you prefer to avoid conda altogether, the following commands provide a clean installation within the current environment:

pip install git+https://github.com/catalystneuro/nwb-conversion-tools.git@master

Dependencies

NWB Conversion Tools relies heavily on SpikeExtractors for electrophysiology and on ROIExtractors for optophysiology data.

You can use a graphical interface for your converter with NWB Web GUI.

Catalogue

v0.9.3

Buzsáki Lab: buzsaki-lab-to-nwb

This project is an ongoing effort for the Ripple U19 conversion of extracellular electrophysiology data to NWB format, including final publishing of each dataset on DANDI. Currently spans 7 major publications and over 14 TB of data on the DANDI Archive. Most of the data consists of raw recordings, LFP, spike sorted units, and behavior with can consist of a mix of mental state tracking, position tracking through mazes, and trial stimulus events.

Shenoy lab: shenoy-lab-to-nwb:

The Shenoy lab is one of the pioneers in developing BCIs for people with paralysis. They are part of the BrainGate team and were the winners of the 2019 BCI award. They use extracellular recordings from Utah arrays and Neuropixels in primates.

v0.9.2

Brody Lab: brody-lab-to-nwb

The Brody lab has a long history with extracellular electrophysiology experiements spanning multiple acquisition systems. This project served two purposes - to allow the conversion of older data from Neuralynx and SpikeGadgets to NWB, and also their newer, larger data using Neuropixels (SpikeGLX). These recordings, some of which exceeded more than 250 GB (several hours worth!), were paired with rich trials tables containing catagorical events and temporal stimuli.

v0.8.10

Feldman Lab: feldman-lab-to-nwb

The Feldman lab utilizes a Neuropixels (SpikeGLX) system along with multiple sophisticated behavior systems for manipulating whisker stimulation in mice. These give rise to very complex trials tables tracking multiple event times throughout the experiments, including multiple event trains within trials.

v0.8.1

Hussaini Lab: hussaini-lab-to-nwb

v0.7.2

Movson lab: movshon-lab-to-nwb

v0.7.0

Tank Lab: tank-lab-to-nwb

Neuropixel (SpikeGLX) recordings of subjects navigating a virtual reality! Behavior contains a huge variety of NWB data types including positional and view angle over time, collision detection, and more! Paired with a specific extension for parsing experiment metadata.

Groh lab: mease-lab-to-nwb

Utilizing the CED recording interface, this project paired ecephys channels with optogenetic stimulation via laser pulses, and mechnical pressure stimulation over time - all of which are channels of data extracted from the common .smrx files!

Giocomo lab: giocomo-lab-to-nwb

Other labs that use NWB standard

For Developers

Running GIN tests locally

nwb-conversion-tools verifies the integrity of all code changes by running a full test suite on short examples of real data from the formats we support. There are two classes of tests in this regard; tests/test_internals does not require any data to be present and represents the 'minimal' expected behavior for our package, whereas tests/test_on_data requires the user to both perform a full install of dependencies (pip install -r requirements-full.txt) as well as download the associated data for each modality.

Install testing dependencies

We provide two easy ways of installing all the dependencies required for testing:

  1. The first is a conda based solution that creates an environment with all the dependencies already installed.
git clone https://github.com/catalystneuro/nwb-conversion-tools
cd nwb-conversion-tools
conda env create -f make_env_testing.yml
conda activate nwb_conversion_testing_env

Note that this will also install datalad which is the endorsed way of downloading the testing data plus pytest and pytest-cov which are the tools that we use on our continuous integration suit.

  1. The same can be accomplished by using pip. In a clean environment run:
git clone https://github.com/catalystneuro/nwb-conversion-tools
cd nwb-conversion-tools
pip install .[test, full]

Notice that this method does not install datalad.

Downloading the data

Datalad (conda install datalad) is the recommended way for downloading the data. To do this; simply call:

For electrophysiology data:

datalad install -rg https://gin.g-node.org/NeuralEnsemble/ephy_testing_data

For optical physiology data:

datalad install -rg https://gin.g-node.org/CatalystNeuro/ophys_testing_data

For behavioral data:

datalad install -rg https://gin.g-node.org/CatalystNeuro/behavior_testing_data

Test configuration file

Once the data is downloaded to your system, you must manually modify the config file (example) located in ./tests/test_on_data/gin_test_config.json so its corresponding LOCAL_PATH key points to the correct folder on your system that contains the dataset folder (e.g., ephy_testing_data for testing ecephys). The code will automatically detect that the tests are being run locally, so all you need to do ensure the path is correct to your specific system.

The output of these tests is, by default, stored in a temporary directory that is then cleaned after the tests finish running. To examine these files for quality assessment purposes, set the flag SAVE_OUTPUTS=true in the gin_test_config.json file and modify the variable OUTPUT_PATH in the respective test if necessary.

Build the documentation

For building the documentation locally, the following procedure can be followed. Create a clean environment and type the following commands in your terminal:

git clone https://github.com/catalystneuro/nwb-conversion-tools
cd nwb-conversion-tools
pip install -e .[docs]

These commands install both the latest version of the repo and the dependencies necessary to build the documentation. Note that the argument -e makes you install editable

Now, to build the documention issue the following command in your terminal:

sphinx-build -b html docs ./docs/_build/

This builds the html under /docs/_build/ (from your root directory, where you have installed nwb-conversion-tools). This allows you to review the outcome of the process localy before commiting code.

Metadata

Release files for nwb-conversion-tools 0.11.38

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nwb-conversion-tools 0.11.38
File Size Uploaded
nwb-conversion-tools-0.11.38.tar.gz 93.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nwb-conversion-tools 0.11.38
File Interpreter ABI Platform
nwb_conversion_tools-0.11.38-py3-none-any.whl Python 3 none any Details

Total release size: 216.5 kB

Release files / nwb-conversion-tools-0.11.38.tar.gz

Download URL nwb-conversion-tools-0.11.38.tar.gz
Size 93.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3c42a0ed4f559a2218f8eae0978efb75761fb77d8ce08b8ce6172bbb955790f8
BLAKE2b-256 checksum
How to use checksums
a8c2ac51d88751ddeb4214c5c7417cae4eac801a8be0b54702c536820166e9f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / nwb_conversion_tools-0.11.38-py3-none-any.whl

Download URL nwb_conversion_tools-0.11.38-py3-none-any.whl
Size 122.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c00bf4136d7dbe4d8d1eef680198c42597a0838cf997f7133588551bb47234b7
BLAKE2b-256 checksum
How to use checksums
ea0cb90b543c6023d05601a5fb5d754f145e7a373ee5343f3ac825d509659db1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.11.38 This release

2 release files

0.9.9

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.8.1

2 release files

0.7.2

2 release files

0.7.0

1 release file

0.6.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page