This is the code and data archive accompanying the publication
Gutzen, R., De Bonis, G., De Luca, C., Pastorelli, E., Capone, C., Allegra Mascaro, A. L., Resta, F., Manasanch, A., Pavone, F. S., Sanchez-Vives, M. V., Mattia, M., Grün, S., Paolucci, P. S., & Denker, M. (2023). "Using a modular and adaptable analysis pipeline to compare slow cerebral rhythms across heterogeneous datasets". Cell Reports Methods
The above publication also introduces the software
Collaborative Brain Wave Analysis Pipeline (Cobrawap). RRID:SCR_022966. https://cobrawap.readthedocs.io
conda create -f environment.yaml
) and activate it.cobrawap init
and follow the instructions to
DATA\_SETS
) in the stage01_data_entry/config/config_<profile>.yaml files to the corresponding data locations.To produce all the possible pipeline outputs <cobrawap_output>/<profile><variant>/stage05_(channel_)wave_characterization/<event-type>_<measure-type>_measures.csv, set the event-type and measure-type accordingly and execute:
cobrawap run --profile=<profile>
Profiles: The names that are used for the individual recordings and their corresponding configurations are listed in project_utils/profiles.txt.
Variants: Variants are alternative configurations for a profile and can be specified by appending a corresponding label to the profile with a '|', e.g. <profile>|minimatrigger
. Here, additional variants for spatial downsampling and alternative trigger detection are applied to all LENS datasets: |macrodim3, |macrodim5, |macrodim7, |macrodim9, |macrodim11, |minimatrigger.
Measure types: There are two alternative final stages of the pipeline stage05_wave_characterization and stage05_channel_wave_characterization, corresponding to calculating either wave-wise or channel-wise characteristic measures. You can select between them in the top-level pipeline config <cobrawap_configs>/configs/config.yaml.
Event types: The wave characterization in the pipeline output can be either given for all wavefronts or all wavemodes (wavemode = average of similar wavefronts). You can select between them by setting the parameter EVENT_NAME
in the corresponding stage05 config file. Also change the prefix of the STAGE_OUTPUT
accordingly as wavefronts
or wavemodes
.
In the folder aggregate_pipeline_output run snakemake (snakemake -c1
) to create the combined dataframes from the individual pipeline outputs:
In folder plot_figures:
snakemake -c1
to produce Figure 5 and 6.plot_wavemodes_dashboard.ipynb
to produce Figure 4 and S3 (change profile name in notebook accordingly).plot_trigger_detection_f-anesthesia.ipynb
to produce Figure S4.plot_examples_frames.ipynb
to produce wave frames in Figure 2.
cobrawap run --profile=IDIBAPS_WBS_WT4|25Hz
.