Skip to content

IsabHox/AnticipatoryModality

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnticipatoryModality

Code for: Modality-specific predictive templates in pre-stimulus EEG activity

Authors: [Isabelle Hoxha, Sylvain Chevallier, Arnaud Delorme, Michel-Ange Amorim]
Contact: isabellehoxha[at]gmail.com

Overview

This repository contains the code used to preprocess EEG data, perform multivariate decoding analyses, and model behavioral data for the study:

Modality-specific predictive templates in pre-stimulus EEG activity

The project investigates anticipatory neural activity and its role in perceptual decision-making using EEG and computational modeling. In particular, it focuses on how pre-stimulus brain activity encodes modality-specific expectations and how these anticipatory states influence subsequent decision processes.

Repository structure

  • src/ — scripts
  • stats/ — files for statistical tests run outside of Python
  • figures/ — figures of the paper
  • results/ — files generated by the scripts

Requirements

Python 3.11

Main dependencies:

  • numpy
  • scipy
  • pandas
  • scikit-learn
  • mne
  • matplotlib
  • seaborn
  • pyddm

How to run the analysis

0. Download the data

The corresponding data can be found at https://zenodo.org/records/19595833

1. ERP analysis

python src/ERP_analysis.py

will reproduce the figures and processing for the ERP analysis shown in the paper.

For the link between pre- and post-stimulus activity, run src/link_pre_post.py

2. Decoding analysis

Decoding is done in 3 steps:

  • src/gridsearch.py will perform the gridsearch on the frequency bands explored
  • src/cued_decoding_full.py will then get the test accuracy on cued trials
  • src/uncued_semisupervised.py will fit uncued data using a model trained on cued trials

Intersubject variability analysis can be performed using src/intersubject_variability.py

3. Behavioral modeling

The code src/DDM_fits.py fits diffusion decision models.

4. Figures

The figures can be found in the corresponding folder, and are generated with the scripts mentioned above.

Data

The dataset is available on Zenodo

Due to size constraints, data are not included in this repository.

Reproducibility notes

  • Random seeds are fixed where relevant
  • Cross-validation procedures use stratified splits
  • Frequency band selection is performed on training data only
  • Final models are evaluated on held-out test sets

Important methodological notes

  • Decoding is performed on time-domain EEG signals after band-pass filtering
  • Filtering is causal, preventing contamination from post-stimulus activity
  • Frequency band selection is performed at the group level
  • Analyses are designed to avoid circularity and ensure proper generalization

Reproducing the paper

To reproduce the main results:

  1. Download the dataset
  2. Run the scripts :)

License

This code is released under the GPL-3.0 license.

Citation

To be announced soon! In the mean time, you can cite our preprint:

Hoxha, I., Chevallier, S., Delorme, A., & Amorim, M.-A. (2023). EEG anticipatory activity depends on sensory modality [Preprint]. Neuroscience. https://doi.org/10.1101/2023.09.27.559806

About

Code to decode the content of anticipation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages