Sovereign 8s.is mirror of standardgalactic/extinction-learning-study
  • Python 65.5%
  • MATLAB 20%
  • R 14.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-02-28 15:36:57 +01:00
scripts Add files via upload 2025-10-28 13:25:48 +01:00
source-data Add files via upload 2026-02-28 15:35:53 +01:00
README.md First commit 2025-07-20 13:10:24 +02:00
requirements.txt Add files via upload 2025-10-28 10:52:11 +01:00

extinction-learning-study

A collection of scripts used in the manuscript "Predicting individual differences of fear and cognitive learning and extinction"

########## GENERAL INFORMATION #############

All scripts are provided in the folder scripts. Each script has an associated .txt file with a summary of its functionality, instructions how to run it, and which libraries and files are required.

############ ORDER OF SCRIPTS ###############

The scripts should be run in the following order:

  1. pipeline_BIDS.py This script will convert all files (functional, structural, diffusion, physiological, behavioural) into an appropriate BIDs format.

  2. pipeline_fmriprep.py This script will run fmriprep on BIDs functional and anatomical data, and create the corresponding preprocessed files.

  3. pipeline_denoising.py This script performs denoising of the preprocessed functional images from step 2.

  4. pipeline_ROIs.py This script uses the preprocessed anatomical images as well as corresponding freesurfer outputs from step 2 to create subject-specific ROIs.

  5. pipeline_suit.m This script uses the preprocessed anatomical images as well as corresponding freesurfer outputs from step 2 to create subject-specific cerebellum ROIs.

  6. pipeline_FC.py This script computes different types of functional connectivity metrics within selected ROIs (step 4) from the denoised functional images from step 3.

  7. pipeline_SC.py This script computes structural connectivity within selected ROIs (step 4) from the dwi images.

  8. pipeline_EC.m This script computes effective connectivity within selected ROIs (step 4) from the denoised functional images from step 3.

  9. pipeline_EDA.m, pipeline_EDA_DCM.m, pipeline_EDA_SF These scripts computes EDA learning metrics (based on DCM or SF) from EDA raw data stored in BIDs.

  10. pipeline_learning.R This script computes learning metrics either from EDA (step 9) or behavioural data within selected ROIs (step 4) from the denoised functional images from step 3.

  11. pipeline_modelling.R This script predicts learning (step 10) from brain connectivity measures (steps 6, 7 and 8).

  12. pipeline_generalisability1.R This script computes generalisation of predictions from step 11.

  13. pipeline_LOGO.py This script computes generalisation of predictions from step 11 using LOGO.

############## DEPENDENCIES #################

All scripts either require python, R or matlab to be installed (check specific scripts for details).

The python scripts (.py) require the latest versions of the following libraries: ast, bctpy, collections, csv, datetime, functools, errno, gzip, itertools, json, multiprocessing, nibabel, nilearn, nipype, numpy, operator, os, pandas as pd, pathlib, pathlib2, psutil, pydicom, pycwt, re, scipy, shlex, shutil, sklearn, string, subprocess, tslearn, warnings (these libraries can be installed using: pip install [lib])

The R scripts (.r) require the latest version of the following libraries: lme4, emmeans, ggplot2, ggcorrplot, dplyr, stringr, tibble, tidyr, lmerTest, car, caret, glmnet, doMC (these libraries can be installed using: install.libraries("lib")

The matlab scripts (.m) require SUIT, PsPM and SPM toolboxes.