NomisCiri / eeg_manypipes_arc

This project contains all code to reproduce the Analyses of the EEG manypipes project
MIT License
1 stars 1 forks source link

Run analysis DOI

eeg_manypipes_arc -- EEGManyPipelines Analysis Code

This project contains all code to reproduce the analyses of the EEG manypipes project.

It is hosted on GitHub: https://github.com/NomisCiri/eeg_manypipes_arc

The archived code can be found on Zenodo: https://doi.org/10.5281/zenodo.6549049

This is a contribution by Stefan Appelhoff, Simon Ciranka, and Casper Kerrén from the Center of Adaptive Rationality (ARC)

Original documentation provided by the organizers can be found in the organizer_documentation directory.

sourcedata and derivatives of this project are stored on GIN: https://gin.g-node.org/sappelhoff/eeg_manypipes_arc

UPDATE 2023-01-23 -- AT REQUEST OF THE EEG MANY PIPELINES STEERING COMMITTEE, WE TURNED THE ACCESS TO THE DATA REPOSITORY TO PRIVATE.

The report for the analysis is in REPORT.txt

Installation

To run the code, you need to install the required dependencies first. We recommend that you follow these steps (assumed to be run from the root of this repository):

  1. Download Miniconda for your system: https://docs.conda.io/en/latest/miniconda.html (this will provide you with the conda command)
  2. Use conda to install mamba: conda install mamba -n base -c conda-forge (for more information, see: https://github.com/mamba-org/mamba; NOTE: We recommend that you install mamba in your base environment.)
  3. Use the environment.yml file in this repository to create the emp ("EEGManyPipelines") environment: mamba env create -f environment.yml
  4. Activate the environment as usual with conda activate emp
  5. After the first activation, run the following to activate pre-commit hooks: pre-commit install

Obtaining the data

We recommend that you make use of the data hosted on GIN via Datalad.

If you followed the installation steps above, you should almost have a working installation of Datalad in your environment. The last step that is (probably) missing, is to install git-annex.

Depending on your operating system, do it as follows:

Use the following steps to download the data:

  1. clone: datalad clone https://gin.g-node.org/sappelhoff/eeg_manypipes_arc
  2. go to root of cloned dataset: cd eeg_manypipes_arc
  3. get a specific piece of the data datalad get sourcedata/eeg_eeglab/EMP01.set
  4. ... or get all data: datalad get *

Note that if you do not get all the data (step 4. above), the data that you did not get is not actually present on your system. There is merely a symbolic link to a remote location (GIN). Furthermore, the entire EEG data (even after get) is "read only"; if you need to edit or overwrite the files (not recommended), you can run datalad unlock *.

Continuous integration

Under .github/workflows/run_analysis.yml we have specified a test workflow that may be helpful for you to inspect.

Running the code

Before running the code on your system you must:

  1. Obtain the data (see above)
  2. Edit config.py to include the path to your data (see FPATH_DS variable)

Description of files

All other files are related to the analysis.

The Python script that are doing the heavy lifting have names that are prefixed with two integers 00, 01, 02, ... This indicates the order in which to run the scripts.

The 00 are optional to run.

The preprocessing scripts are those from 01 to 06. These operate on single subjects.

Note that these scripts can be easily run from the command line and that you can specify certain arguments there (see the scripts for more detail). This allows running several subjects from the command line like below:

for i in {1..33}
do
    python -u 01_find_bads.py \
        --sub=$i \
        --overwrite=True
done

Finally, there is one script for testing each of the four hypotheses.


All outputs of these analyses are stored on GIN

https://gin.g-node.org/sappelhoff/eeg_manypipes_arc