Package: hu-neuro-pipeline
hu-neuro-pipelineSingle trial EEG pipeline at theAbdel Rahman Lab for Neurocognitive Psychology, Humboldt-Universität zu BerlinBased on Frömer, R., Maier, M., & Abdel Rahman, R. (2018).
Group-level EEG-processing pipeline for flexible single trial-based analyses including linear mixed models.Frontiers in Neuroscience,12, 48.https://doi.org/10.3389/fnins.2018.000481. Installation1.1 For Python usersInstall the pipeline viapipfrom thePython Package Index(PyPI):python3-mpipinstallhu-neuro-pipelineTo install the latest development version fromGitHub:python3-mpipinstallgit+https://github.com/alexenge/hu-neuro-pipeline.git1.2 For R usersFirst installreticulateandMinicondafor being able to import Python packages into R:install.packages("reticulate")reticulate::install_miniconda()Then install the pipeline viapipfrom thePython Package Index(PyPI):reticulate::py_install("hu-neuro-pipeline",pip=TRUE)To install the latest development version fromGitHub:reticulate::py_install("git+https://github.com/alexenge/hu-neuro-pipeline.git",pip=TRUE)2. Usage2.1 For Python usersHere is a fairly minimal example for a (fictional) N400/P600 experiment with two experimental factors:semantics(e.g., related versus unrelated words) and emotionalcontext(e.g., emotionally negative versus neutral).frompipelineimportgroup_pipelinetrials,evokeds,config=group_pipeline(raw_files='Results/EEG/raw',log_files='Results/RT',output_dir='Results/EEG/export',besa_files='Results/EEG/cali',triggers=[201,202,211,212],skip_log_conditions={'semantics':'filler'},components={'name':['N400','P600'],'tmin':[0.3,0.5],'tmax':[0.5,0.9],'roi':[['C1','Cz','C2','CP1','CPz','CP2'],['Fz','FC1','FC2','C1','Cz','C2']]},average_by={'related':'semantics == "related"','unrelated':'semantics == "unrelated"'})In this example we have specified:The paths to the raw EEG data, to the behavioral log files, to the desired output directory, and to the BESA files for ocular correctionFour different EEGtriggerscorresponding to each of the four cells in the 2 × 2 designThe fact that log files contain additional trials from a semantic'filler'condition (which we want to skip because they don't have corresponding EEG triggers)Thea prioridefined time windows and regions of interest for the N400 and P600componentsThe log file columns (average_by) for which we want to obtain by-participant averaged waveforms (i.e., for all main and interaction effects)2.2 For R usersHere is the same example as above but for using the pipeline from R:# Import Python modulepipeline<-reticulate::import("pipeline")# Run the group level pipelineres<-pipeline$group_pipeline(raw_files="Results/EEG/raw",log_files="Results/RT",output_dir="Results/EEG/export",besa_files="Results/EEG/cali",triggers=c(201,202,211,212),skip_log_conditions=list("semantics"="filler"),components=list("name"=list("N400","P600"),"tmin"=list(0.3,0.5),"tmax"=list(0.5,0.9),"roi"=list(c("C1","Cz","C2","CP1","CPz","CP2"),c("Fz","FC1","FC2","C1","Cz","C2"))),average_by=list(related="semantics == 'related'",unrelated="semantics == 'unrelated'"))# Extract resultstrials<-res[[1]]evokeds<-res[[2]]config<-res[[3]]3. Processing detailsSee thedocumentationfor more details about how to use the pipeline and how it works under the hood.