Skip to content

General pipeline used for analyzing EEG data where Raw EEG data gets transformed into ERPS and Stats are done in R (Mixed effects models)

License

Notifications You must be signed in to change notification settings

CognitiveNeuroLab/Pipeline_EEG_to_ERP_EEGlab_stats_R

 
 

Repository files navigation

EEG pipeline

Douwe John Horsthuis 2024-02-28

Contributors Forks Stargazers MIT License LinkedIn

Logo

EEG pipeline using EEGlab

This EEG pipeline is made to analyze data collected with a biosemi system, using however many channels you want. There are several cleaning steps (e.g. channel rejection, ICA, epoch rejection) after which stats can be done using R studio. This pipeline contains several scripts, organized alphabetically. Each script runs a loop on all the participants, making sure that the same steps are taken for each participant. The reason it is not one big script is, because after running each script it would be a good moment to check if you are happy with the data.

All plots are made using the average data of 38 controls participants while they are doing a go-no-go task.

If you have questions or suggestions please reach out to douwehorsthuis@gmail.com

For in dept explanations check the WIKI

Link to wiki

  1. About the project
  2. Pipeline order
  3. Contributing
  4. Updates
  5. License
  6. Contact
  7. Acknowledgements

About The Project

This EEG pipeline is made to analyze data collected with a biosemi system, using however many channels you want. There are several cleaning steps (e.g. channel rejection, ICA, epoch rejection) after which stats can be done using R studio. It is scalable to multiple groups and variables such as filter strength, and rejection thresholds are changeable, but are pre-tested and worked for multiple publications.

Built With

Back to top

Publications

The following are the papers that we published using this pipeline.

Horsthuis, D. J., Molholm, S.,Foxe, J. J., & Francisco, A. A.(2023) Event-related potential (ERP) evidence for visual processing differences in children and adults with cystinosis (CTNS gene mutations)Orphanet Journal of Rare Diseases 18 (1), 389

Francisco, A. A., Foxe, J. J., Horsthuis, D. J., & Molholm, S. (2022). Early visual processing and adaptation as markers of disease, not vulnerability: EEG evidence from 22q11.2 deletion syndrome, a population at high risk for schizophrenia. Schizophr 8, 28.

Francisco, A. A., Berruti, A. S., Kaskel, F. J., Foxe, J. J., & Molholm, S. (2021). Assessing the integrity of auditory processing and sensory memory in adults with cystinosis (CTNS gene mutations). Orphanet Journal of Rare Diseases, 16(1), 1-10. (unique settings: re-referenced to TP8 and epochs are −100 to 400ms using a baseline of −50 to 0ms.)

Francisco, A. A., Foxe, J. J., Horsthuis, D. J., DeMaio, D., & Molholm, S. (2020). Assessing auditory processing endophenotypes associated with Schizophrenia in individuals with 22q11. 2 deletion syndrome. Translational psychiatry, 10(1), 1-11 (unique settings: re-referenced to TP8 and epochs are −100ms to 400ms using a baseline of −100ms to 0ms)

Francisco, A. A., Horsthuis, D. J., Popiel, M., Foxe, J. J., & Molholm, S. (2020). Atypical response inhibition and error processing in 22q11. 2 Deletion Syndrome and schizophrenia: Towards neuromarkers of disease progression and risk. NeuroImage: Clinical, 27, 102351. (unique settings: 0.1 Hz high pass filter (0.1 Hz transition bandwidth, filter order 16896) and epochs are −100 ms to 1000 using a baseline of −100 ms to 0 ms)

Francisco, A. A., Foxe, J. J., Horsthuis, D. J., & Molholm, S. (2020). Impaired auditory sensory memory in Cystinosis despite typical sensory processing: A high-density electrical mapping study of the mismatch negativity (MMN). NeuroImage: Clinical, 25, 102170. (unique settings: re-referenced to TP8 and epochs are −100ms to 400ms using a baseline of −100ms to 0ms)

Back to top

Visual representation of the pipeline

Back to top

Pipeline order

Here we describe the order of the scripts. The order is obvious sometimes (for example there is no way to do anything without the first script), but less so in other moments (for example, when do you interpolate channels). For more in-dept explanations see Pipeline extended, or click on the step you want to know more about, and you will be send to the wiki page for more info.

merging and creating a set extention
Cleaning Optional
Downsampling
Filtering general
Filtering in dept
Adding channel info
Deleting channels automatic
Deleting channels manual
Interpolation
Average reference
PCA
ICA
Delete bad components IC
re-referencing (optional)
Epoching
Reaction time
Grandmeans
Dashboards

All explanations are in the process of being moved to the wiki page

Link to wiki

Back to top

Issues

See the open issues for a list of proposed features (and known issues).

Contributing

Please contact me if you see anything in this pipeline that you think could be improved. I’m always looking to improve the pipeline!
Back to top

Updates

5/7/2021 - adding C_manual_check script + biosemi160sfp file
6/17/2021- updating the re-referencing situation. We used to do this in the first script when loading the BDF file, but this caused problems <<<<<<< HEAD with flat channels not being flat anymore.
6/17/2021 - updating
D_reref_exclextrn_avgref_ica_autoexcom,only deleting eye-components from now on.
10/17/2022 - Working on a QA dashboard that will show you both individual subject and group related information to see without hassle how your data look
12/20/2022 - Added a script that is optional so that you can see how much data get’s deleted when you clean your data and what would be the best settings for your data. 2/14/2024 - major update to get everything smoothed out. All programs should run without issues. There is a visualization step at the end. There is now a reaction time script.
2/28/2024 - major update where all the scripts are re-written in a way that they flawlessly should run together while being adaptable without having to change the underling code.

Back to top

License

Distributed under the MIT License. See LICENSE for more information.

Back to top

Contact

Douwe John Horsthuis - @douwejhorsthuis - douwehorsthuis@gmail.com

Project Link: https://github.com/DouweHorsthuis/EEG_to_ERP_pipeline_stats_R

Back to top

Acknowledgements

Back to top

About

General pipeline used for analyzing EEG data where Raw EEG data gets transformed into ERPS and Stats are done in R (Mixed effects models)

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • MATLAB 98.9%
  • R 1.1%