A lightweight collection of functions for managing the experimental data recorded in the
BeNeuro Lab, and a CLI tool called bnd
for easy access to this functionality.
Play around with it and raise Github issues if anything fails
-
Install
conda
-
Clone repo
git clone [email protected]:BeNeuroLab/bnd.git cd ./beneuro_experimental_data_organization
-
Open either Miniconda prompt or Miniforge promt and run the following command. This may take some time:
conda env create --file=env.yml
or if you want the processing depedencies:
conda env create --file=processing_env.yml
If you installed the base environment and want to update later on:
conda env --file=processing_env.yml
-
Create your configuration file:
bnd init # Provide the path to local and remote data storage bnd --help # Start reading about the functions!
Complete your experimental session on animal M099. Then:
bnd up M099
Now, you want to process your data into a pyaldata format. Its a good idea to do this on one of the lab workstations:
bnd dl M099_2025_01_01_10_00 -v # Downloads everything
bnd to-pyal M099_2025_01_01_10_00 # Run kilosort, nwb conversion, and pyaldata conversion
bnd up M099_2025_01_01_10_00 # Uploads new files to server
If you want specific things during your pipeline (e.g., dont run kilosort, use a custom channel map) read the API below.
Create a .env file (if there isnt one) to store the paths to the local and remote data storage.
Show the contents of the config file.
Check if there are any new commits on the repo's main branch.
Update the bnd tool by pulling the latest commits from the repo's main branch.
Upload data from session or animal name to the server. If the file exists on the server, it won't be replaced. Every file in the session folder will get uploaded.
Example usage to upload everything of a given session:
bnd up M017_2024_03_12_18_45
bnd up M017
Download experimental data from a given session from the remote server.
Example usage to download everything:
bnd dl M017_2024_03_12_18_45 -v # will download everything, including videos
bnd dl M017_2024_03_12_18_45 # will download everything, except videos
bnd dl M017_2024_03_12_18_45 --max-size=50 # will download files smaller than 50MB
Convert session data into a pyaldata dataframe and saves it as a .mat
If no .nwb file is present it will automatically generate one and if a nwb file is present it will skip it. If you want to generate a new one run bnd to-nwb
If no kilosorted data is available it will not kilosort by default. If you want to kilosort add the flag -k
Example usage:
bnd to-pyal M037_2024_01_01_10_00 # Kilosorts data, runs nwb and converts to pyaldata
bnd to-pyal M037_2024_01_01_10_00 -K # converts to pyaldata without kilosorting (if no .nwb file is present)
bnd to-pyal M037_2024_01_01_10_00 -c # Use custom mapping during nwb conversion if custom_map.json is available (see template in repo). -C uses available default mapping
Convert session data into a nwb file and saves it as a .nwb
If no kilosorted data is available it will not kilosort by default. If you want to kilosort add the flag -k
Example usage:
bnd to-nwb M037_2024_01_01_10_00 # Kilosorts data and run nwb
bnd to-nwb M037_2024_01_01_10_00 -K # converts to nwb without kilosorting (if no .nwb file is present)
bnd to-nwb M037_2024_01_01_10_00 -c # Use custom mapping during conversion if custom_map.json is available (see template in repo). Option `-C` uses available default mapping
Kilosorts data from a single session on all available probes and recordings
Example usage:
bnd ksort M037_2024_01_01_10_00
- Add
AniposeInterface
in nwb conversion - Implement Npx2.0 functionality