NWB conversion scripts for Constantinople lab data to the Neurodata Without Borders data format.
You can install the latest release of the package with pip:
pip install constantinople-lab-to-nwb
We recommend that you install the package inside a virtual environment. A simple way of doing this is to use a conda environment from the conda
package manager (installation instructions). Detailed instructions on how to use conda environments can be found in their documentation.
Once you have installed the package with pip, you can run any of the conversion scripts in a notebook or a python file:
Another option is to install the package directly from Github. This option has the advantage that the source code can be modifed if you need to amend some of the code we originally provided to adapt to future experimental differences. To install the conversion from GitHub you will need to use git
(installation instructions). We also recommend the installation of conda
(installation instructions) as it contains all the required machinery in a single and simple instal
From a terminal (note that conda should install one in your system) you can do the following:
git clone https://github.com/catalystneuro/constantinople-lab-to-nwb
cd constantinople-lab-to-nwb
conda env create --file make_env.yml
conda activate constantinople-lab-to-nwb-env
This creates a conda environment which isolates the conversion code from your system libraries. We recommend that you run all your conversion related tasks and analysis from the created environment in order to minimize issues related to package dependencies.
Alternatively, if you want to avoid conda altogether (for example if you use another virtual environment tool) you can install the repository with the following commands using only pip:
git clone https://github.com/catalystneuro/constantinople-lab-to-nwb
cd constantinople-lab-to-nwb
pip install -e .
Note: both of the methods above install the repository in editable mode.
To run a specific conversion, you might need to install first some conversion specific dependencies that are located in each conversion directory:
pip install -r src/constantinople_lab_to_nwb/schierek_embargo_2024/schierek_embargo_2024_requirements.txt
You can run a specific conversion with the following command:
python src/constantinople_lab_to_nwb/schierek_embargo_2024/schierek_embargo_2024_convert_session.py
Each conversion is organized in a directory of its own in the src
directory:
constantinople-lab-to-nwb/
├── LICENSE
├── make_env.yml
├── pyproject.toml
├── README.md
├── requirements.txt
├── setup.py
└── src
├── constantinople_lab_to_nwb
│ ├── conversion_directory_1
│ └── schierek_embargo_2024
│ ├── schierek_embargo_2024_behaviorinterface.py
│ ├── schierek_embargo_2024_convert_session.py
│ ├── schierek_embargo_2024_metadata.yml
│ ├── schierek_embargo_2024_nwbconverter.py
│ ├── schierek_embargo_2024_requirements.txt
│ ├── schierek_embargo_2024_notes.md
│ └── __init__.py
│ ├── conversion_directory_b
└── __init__.py
For example, for the conversion schierek_embargo_2024
you can find a directory located in src/constantinople-lab-to-nwb/schierek_embargo_2024
. Inside each conversion directory you can find the following files:
schierek_embargo_2024_convert_sesion.py
: this script defines the function to convert one full session of the conversion.schierek_embargo_2024_requirements.txt
: dependencies specific to this conversion.schierek_embargo_2024_metadata.yml
: metadata in yaml format for this specific conversion.schierek_embargo_2024_behaviorinterface.py
: the behavior interface. Usually ad-hoc for each conversion.schierek_embargo_2024_nwbconverter.py
: the place where theNWBConverter
class is defined.schierek_embargo_2024_notes.md
: notes and comments concerning this specific conversion.
The directory might contain other files that are necessary for the conversion but those are the central ones.