Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Buffalo-lab-data-to-nwb

Scripts which convert Buffalo lab data to NWB format. Currently we only support conversion for processed data.

authors: Luiz Tauffer, Maija Honig, Ryan Ly, Ben Dichter

Install

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

Use

The conversion function can be used in different forms:

1. Imported and run from a python script:
Here's an example: we'll grab raw data (.ncs files) and processed data (.mat and .nex5 files) and convert them to .nwb files.

from buffalonwb.conversion_module import conversion_function
from pathlib import Path
import yaml

base_path = Path(BASE_PATH_TO_FILES)

# Source files
source_paths = dict()
source_paths['raw Nlx'] = {'type': 'dir', 'path': base_path.joinpath("RawNlxCSCs")}
source_paths['processed Nlx'] = {'type': 'dir', 'path': str(base_path.joinpath('ProcessedNlxData'))}
source_paths['processed behavior'] = {'type': 'file', 'path': str(base_path.joinpath('ProcessedBehavior/MatFile_2017-04-27_11-41-21.mat'))}
source_paths['sorted spikes'] = {'type': 'file', 'path': str(base_path.joinpath('SortedSpikes/2017-04-27_11-41-21_sorted.nex5'))}

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

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

kwargs_fields = {
    'skip_raw': True,
    'skip_processed': False,
    'no_lfp_iterator': False,
}

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

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

$ python conversion_module.py [raw_nlx_dir] [lfp_mat_dir]
  [sorted_spikes_nex5_file] [behavior_file] [output_file] [metadata_file]
  [-skipraw] [-skipprocessed] [-lfpiterator]

IMPORTANT:
[raw_nlx_dir] and [lfp_mat_dir] should be paths to directories
[sorted_spikes_nex5_file] [behavior_file] [output_file] [metadata_file] should be paths to files

optional inputs add these after the positional arguments to use additional options
"-skipraw" (will skip adding raw data to nwb file)
"-skipprocessed" (will skip adding processed data to nwb file)
"-lfpiterator" (change lfp data method to dataChunkIterator (for large data))


3. Graphical User Interface:
To use the GUI, just run the auxiliary function nwb_gui.py from terminal:

$ python nwb_gui.py

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 visually exploring the data in the end file with nwb-jupyter-widgets.

Metadata

Release files for buffalo-lab-data-to-nwb 0.post0.dev137

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

Source distribution (sdist)

Source distribution for buffalo-lab-data-to-nwb 0.post0.dev137
File Size Uploaded
buffalo-lab-data-to-nwb-0.post0.dev137.tar.gz 43.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for buffalo-lab-data-to-nwb 0.post0.dev137
File Interpreter ABI Platform
buffalo_lab_data_to_nwb-0.post0.dev137-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 75.6 kB

Release files / buffalo-lab-data-to-nwb-0.post0.dev137.tar.gz

Download URL buffalo-lab-data-to-nwb-0.post0.dev137.tar.gz
Size 43.4 kB
Tags Source
SHA-256 checksum
How to use checksums
de6bca586b99193fa0540b5eefb8cedbbb7e19c7803a2fb7ccbe267028a565b3
BLAKE2b-256 checksum
How to use checksums
3453296244779c640c99cfb8d7e94e96ef2f85d1b0a3ecd6b5a059c4d02f56a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.5

Release files / buffalo_lab_data_to_nwb-0.post0.dev137-py2.py3-none-any.whl

Download URL buffalo_lab_data_to_nwb-0.post0.dev137-py2.py3-none-any.whl
Size 32.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
944a7f1a319209e06b6cddf28c5630be8c765717c65a62bc34791e8dbd7d577d
BLAKE2b-256 checksum
How to use checksums
e6d1e67c7d7b8532e2d9267ba274c2a2597a2676133476db386caa89280a048d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.5

Release history Release notifications | RSS feed

This release
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