This repository contains tools for computing electrophysiology features and performing region inference from neural recordings.
- First, activate the IBL conda environment:
conda activate iblenv
- Clone the
ibleatools
repository, andcd
into it
cd ...yourpath/ibleatools
- Once in the
ibleatools
folder, install the required packages using pip:
pip install -e .
The main interface is through main.py
, which can be run using a configuration file:
python main.py --config config.yaml
The configuration is managed through a YAML file. To avoid committing local changes, the actual configuration file (config.yaml
) is ignored by git. Instead, a template file (config_template.yaml
) is provided. To use the tool:
- Copy the template file to create your local configuration:
cp config_template.yaml config.yaml
- Edit
config.yaml
with your specific settings:
# Required parameters
pid: "5246af08-0730-40f7-83de-29b5d62b9b6d" # Probe ID
t_start: 300.0 # Start time in seconds
duration: 3.0 # Duration in seconds
# Operation mode
mode: "both" # Options: 'features', 'inference', or 'both'
# Optional parameters
features_path: "/path/to/output_dir" # Path to output directory.
model_path: "/path/to/model" # Path to the model directory for region inference
-
Required Parameters:
pid
: Probe ID for the recordingt_start
: Start time in secondsduration
: Duration of the analysis in seconds
-
Operation Mode:
mode
: Specifies which operations to performfeatures
: Only compute featuresinference
: Only perform region inferenceboth
: Perform both feature computation and region inference
-
Optional Parameters:
output_dir
: Path to output directorymodel_path
: Path to the model directory for region inference. If not provided, a default path will be used
The tool performs two main operations:
-
Feature Computation:
- Computes various electrophysiology features from the raw data
- Saves features in Parquet format for efficient storage and retrieval
-
Region Inference:
- Uses pre-trained models to infer brain regions
- Can be run independently if features are already computed
- Features are saved in Parquet format for efficient storage
- Region inference results include predicted regions and their probabilities
- All operations are logged for tracking and debugging