The NWB extension for storing Turner lab specific metadata
Project description
ndx-turner-metadata Extension for NWB
The NWB extension for storing Turner lab specific metadata.
Extends pynwb.file.LabMetaData
to store the MPTP treatment status of the subject.
Installation
pip install ndx_turner_metadata
Usage
from uuid import uuid4
from datetime import datetime
from dateutil.tz import tzlocal
from pynwb import NWBFile, NWBHDF5IO
from ndx_turner_metadata import TurnerLabMetaData
# Create NWBFile
nwbfile = NWBFile(
session_description="session_description",
identifier=str(uuid4()),
session_start_time=datetime(1970, 1, 1, tzinfo=tzlocal()),
)
# Create LabMetaData
lab_meta_data = TurnerLabMetaData(
name="MPTPMetaData",
MPTP_status="pre-MPTP",
)
# Add to NWBFile
nwbfile.add_lab_meta_data(lab_meta_data=lab_meta_data)
# Write LabMetaData to NWB file
nwbfile_path = "metadata.nwb"
with NWBHDF5IO(nwbfile_path, mode="w") as io:
io.write(nwbfile)
# Check LabMetaData was added to the NWB file
with NWBHDF5IO(nwbfile_path, mode="r", load_namespaces=True) as io:
read_nwbfile = io.read()
read_nwbfile_lab_metadata = read_nwbfile.lab_meta_data["MPTPMetaData"]
This extension was created using ndx-template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ndx_turner_metadata-0.1.0.tar.gz
(12.2 kB
view details)
Built Distribution
File details
Details for the file ndx_turner_metadata-0.1.0.tar.gz
.
File metadata
- Download URL: ndx_turner_metadata-0.1.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 913bc0a3e928040654cf6d542bdfd68540bf2fd719b3a201003735b27fbd6d6b |
|
MD5 | 73f24360d9a0bce5d6bbae36d926549d |
|
BLAKE2b-256 | 45300f572f84e1aee25c3e2571ffe6d09aed34ce899ea6736794ee14c551c2d3 |
File details
Details for the file ndx_turner_metadata-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: ndx_turner_metadata-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19091e7f7d96e9f95041d507fbe370941fd9242c1bb47e91074f09d997cfe7b5 |
|
MD5 | c2c06181e31db4e9301b1351ea13bbf1 |
|
BLAKE2b-256 | 279151309c61365755bd90ba5864eb9c8f0bb28e2894e088085ce6de3a5f9889 |