Multimodal Pipeline
The multimodal pipeline runs the ephys and miniscope sub-pipelines, then aligns their time bases for phase-locked and event-aligned analysis. Alignment is implemented through MiniscopeDataManager.sync_timestamps (which calls into EphysDataManager.get_sync_timestamps when TTL-based sync is used), not by hard-coding a single vendor.
Quick Start
Prerequisites
- Ensure your project directory has:
experiments.csvwith both calcium imaging directory and ephys directory-
analysis_parameters.csvwith parameters for both modalities -
Ensure the correct data managers are selected for those directories (see Creating new data loaders). Typical lab setups:
- Neuralynx + UCLA Miniscope V3: TTL pulses on an ephys channel + CSV/JSON miniscope metadata.
- ONIX RHS2116 + UCLA Miniscope V4: hardware clock
.rawstreams; sync may rely on clock alignment rather than TTL extraction — yoursync_timestamps/get_sync_timestampsimplementations must reflect that.
Command Line
# Run with explicit project path
python -m ace_neuro.pipelines.multimodal --line-num 97 --project-path /my/project
# Run with explicit project and data paths
python -m ace_neuro.pipelines.multimodal --line-num 97 --project-path /my/project --data-path /my/raw_data
# Run in headless mode
python -m ace_neuro.pipelines.multimodal --line-num 97 --project-path /my/project --headless
Python API
from ace_neuro.pipelines.multimodal import MultimodalPipeline
api = MultimodalPipeline()
api.run(
line_num=97,
project_path="/my/project",
data_path="/my/raw_data",
headless=True
)
Pipeline Steps
- Ephys sub-pipeline: Loads channels via
EphysDataManager.create(...)(Neuralynx or RHS2116, depending on files inephys directory). - Miniscope sub-pipeline: Loads movies and metadata via
MiniscopeDataManager.create(...)(UCLA V3 or ONIX V4, depending on files incalcium imaging directory). - Timestamp synchronization: Calls
sync_neuralynx_miniscope_timestamps, which delegates tominiscope_dm.sync_timestamps(ephys_dm=...). Neuralynx-specific cleanup of event lists runs only when the ephys manager isNeuralynxDataManager. - TTL / frame mapping: Maps aligned calcium times to ephys sample indices where TTL-based framing applies.
- Phase-based event analysis (optional): Computes calcium event phases relative to ephys oscillations when event indices are available.
- Phase histograms: Circular histograms of event-phase distributions when phases are computed.
Key Parameters
| Parameter | Description | Default |
|---|---|---|
delete_TTLs |
Remove problematic TTL events | True |
fix_TTL_gaps |
Correct gaps in TTL timing | False in MultimodalPipeline.run (CLI defaults may differ — see python -m ace_neuro.pipelines.multimodal defaults) |
only_experiment_events |
Restrict to experimental time window | True |
all_TTL_events |
Use all detected TTL events | True |
ca_events |
Analyze calcium events | False in API default; CLI template sets True |
time_range |
Time window to analyze (seconds) | None |
All ephys and miniscope parameters from their respective pipelines also apply here.
Data Requirements
The experiments.csv row must include:
calcium imaging directory: Path to miniscope recordings (resolved relative todata_path).ephys directory: Path to ephys recordings (resolved relative todata_path).
Those directories should contain one coherent acquisition from the same session. The expected file types depend on which built-in (or custom) loaders match; they are not limited to “Neuralynx folders only” or “UCLA V3 only.” If multimodal alignment fails, verify TTL availability, sync_timestamps behavior for your pair of loaders, and Creating new data loaders.