This repository contains data and code for the manuscript "Midbrain signaling of identity prediction errors depends on orbitofrontal cortex networks"
The code has been tested using R (4.1.2)/RStudio (2022.07.1), Matlab (version R2020b, Mathworks Inc).
Source data are published with the manuscript. To run the code with the source data, put source data in the same directory with the source code folder.
- All figure panels (in 'Figs' folder) can be replicated by runing the SourceCode using SourceData
- All source codes are written in R, but require some packages to run the code
- The 'Setup.R' code listed all R packages. If any package cannot be loaded, then it needs to be installed by running install.package(package_name)
- The 'Setup.R' code also has some common theme settings for using ggplot2
- source data for all 10 ROIs are stored in the same spreadsheet 'GlobalConnectedness.xlsx'
- 10 ROIs are: Targeted OFC seed and LPFC stimulation site (Fig 2c), two functional OFC and LPFC ROIs (Supplementary Fig 2), and six additional ROIs (Supplementary Fig 3).
- running code 'GlobalConn.R'
- running code 'Behavior.R' (Fig 4)
- Fig 4c,d,e require Behavioral modeling results (see below)
- We have separate code and data for analyses in different ROIs:
- midbrain and LPFC: code 'iPE.R' (Fig 5b,c, Supplementary Fig 5b,c)
- left OFC: code 'iPE_lOFC.R' (Supplementary Fig 5d)
- additional ROIs: code 'iPE_others.R' (Supplementary Fig 6)
- We have included code for running this analysis on the lateral OFC functional ROI 'MVPA.R' (Fig 6d)
- Illustration of the learning model using different learning rates: 'Beh_Simu_illustration.R' (Fig3a)
- Simulations of behavioral accuracy, identity prediction errors, and pattern similarity with different learning rates: 'Beh_Simu_varied_paras.R' (Fig 3b,c; Fig 6b)
- code 'summary_screening.R' (Supplementary Fig 1)
- code 'CompareMotion.R' (Supplementary Fig 4)
- plot the change of motion across time and test if motion can explain away the TMS effect on global connectedness
- two learning model variants: diff & same
- model parameters estimated: mu, alpha, theta
- Folder 'JagsSamples' contains the posterior estimates of each model after running 'Run_Model_jags.R' code
- contains matlab code for (1) extracting and filtering functional imaging data, (2) conducting global connectedness calculation