Skip to main content

jaeger-lab-data-to-nwb

Convert Jaeger lab data to NWB format.

Currently includes:

  • FRET optical imaging (rsd)
  • Intan electrophysiology (rhd)
  • Labview behavioral data (txt)
  • Optogenetics stimulation data (txt)
  • Treadmill behavior (csv)
  • Bpod behavioral data (mat)

Authors: Luiz Tauffer and Ben Dichter

Install

To clone the repository and set up a conda environment, do:

$ git clone https://github.com/ben-dichter-consulting/jaeger-lab-to-nwb.git
$ conda env create -f jaeger_lab_to_nwb/make_env.yml
$ source activate jaeger_nwb

Alternatively, to install directly in an existing environment:

$ pip install git+https://github.com/ben-dichter-consulting/jaeger-lab-to-nwb.git

Use

After activating the correct environment, the conversion function can be used in different forms:

1. Imported and run from a python script:
Here's an example: we'll grab the data from a specific experiment, with several electrophysiology and behavioral data files stored base_path, and save it to a single nwb file.

import pynwb
from jaeger_lab_to_nwb.conversion_module import conversion_function
from pathlib import Path
import yaml

base_path = Path(PATH_TO_FILES)

# Source files
source_paths = dict()
source_paths['dir_ecephys_rhd'] = {'type': 'dir', 'path': base_path}
source_paths['file_electrodes'] = {'type': 'file', 'path': base_path.joinpath('UD09_impedance_1.csv')}
source_paths['dir_behavior_treadmill'] = {'type': 'dir', 'path': base_path}

# Output .nwb file
f_nwb = 'my_experiment.nwb'

# Load metadata from YAML file
metafile = 'metafile.yml'
with open(metafile) as f:
    metadata = yaml.safe_load(f)

# Lab-specific kwargs
kwargs_fields = {
    'add_rhd': True,
    'add_treadmill': True
}

conversion_function(source_paths=source_paths,
                    f_nwb=f_nwb,
                    metadata=metadata,
                    **kwargs_fields)

# Read nwb file and check its content
with pynwb.NWBHDF5IO(f_nwb, 'r') as io:
    nwb = io.read()
    print(nwb)

2. Command line:
Similarly, the conversion function can be called from the command line in terminal:

$ python conversion_module.py [output_file] [metafile] [--file_behavior_bpod]
[--dir_behavior_treadmill] [--dir_ecephys_rhd] [--file_electrodes]
[--dir_behavior_labview] [--dir_cortical_imaging] [--add_bpod] [--add_rhd]
[--add_treadmill] [--add_labview] [--add_ophys]

For example, the same experiment converted above with a python script could be converted with this command line input:

$ python conversion_module.py my_experiment.nwb metafile.yml --add_rhd --add_treadmill
--dir_behavior_treadmill PATH_TO_FILES --dir_ecepys_rhd PATH_TO_FILES
--file_electrodes PATH_TO_FILES\UD09_impedance_1.csv

3. Graphical User Interface:
To use the GUI, just type in the terminal:

$ nwbn-gui-jaeger [--experiment_name]

The GUI eases the task of editing the metadata of the resulting nwb file, it is integrated with the conversion module (conversion on-click) and allows for quick visual exploration the data in the end file with nwb-jupyter-widgets.

Metadata

Release files for jaeger-lab-to-nwb 0.1.0

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

Source distribution (sdist)

Source distribution for jaeger-lab-to-nwb 0.1.0
File Size Uploaded
jaeger_lab_to_nwb-0.1.0.tar.gz 20.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jaeger-lab-to-nwb 0.1.0
File Interpreter ABI Platform
jaeger_lab_to_nwb-0.1.0-py2-none-any.whl Python 2 none any Details

Total release size: 51.7 kB

Release files / jaeger_lab_to_nwb-0.1.0.tar.gz

Download URL jaeger_lab_to_nwb-0.1.0.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
011885f29d9f251fcb88fe9960a090b7d8461516be6393e515bcca6d69a405df
BLAKE2b-256 checksum
How to use checksums
17d46b4dc9514cc6e0dfa800d2185af0662f8a26c95a0a34518d34b5af6e7d19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / jaeger_lab_to_nwb-0.1.0-py2-none-any.whl

Download URL jaeger_lab_to_nwb-0.1.0-py2-none-any.whl
Size 31.5 kB
Tags Python 2
SHA-256 checksum
How to use checksums
4a4715bcea1aa3b1f597e8cc2372ad6d5cea3ffb979e45dd6d8b4c2d9f1b2e69
BLAKE2b-256 checksum
How to use checksums
280a74fdbad1c5188e1bc69acae24876772f24e82c577385ec2219fdc690482e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

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