OSCR

Brain network reconfiguration during reward prediction error processing.

Code ↔ Paper

18 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

One block of code here has a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

The 18 matches
  1. [1] § METHODS › Experimental Procedures ↔ behavioral_analysis/dn_ba_02_task_logs_processing.ipynb, lines 26 to 105 · score 0.97 · fixation circle, decision phase indicated, right thumb, circle represented, trial began, punished box · Report a mismatch
  2. [2] § METHODS › Experimental Procedures ↔ behavioral_analysis/dn_ba_02_task_logs_processing.ipynb, lines 26 to 105 · score 0.92 · lab computer, MRI scan, explicitly instructed, inaccurate behavioral, prior expectations, feedback indicating · Report a mismatch
  3. [3] § METHODS › Beta-Series Correlation ↔ activation_analysis/dn_aa_01_first_level.ipynb, lines 163 to 291 · score 0.92 · FirstLevelModel, left button press, right button press, decision onset, outcome phase, motion parameter · Report a mismatch
  4. [4] § METHODS › Beta-Series Correlation ↔ connectivity_analysis/ppi/dn_pp_01_ppi_linear_model.ipynb, lines 1 to 71 · score 0.84 · head motion parameter, left button press, right button press, outcome phase, expected probability, convolved · Report a mismatch
  5. [5] § METHODS › Brain Parcellation ↔ connectivity_analysis/ppi/dn_pp_03_analysis_300ROI.ipynb, lines 45 to 88 · score 0.83 · cingulo opercular, dorsal attention, ventral attention, auditory, somatomotor, salience · Report a mismatch
  6. [6] § RESULTS › Functional Networks Involved in RPE Processing ↔ connectivity_analysis/ppi/dn_pp_03_analysis_300ROI.ipynb, lines 45 to 88 · score 0.74 · cingulo opercular, dorsal attention, ventral attention, auditory, somatomotor, salience · Report a mismatch
  7. [7] § METHODS › The Behavioral Model Space ↔ behavioral_analysis/dn_ba_03_single_subject_model_fit.ipynb, lines 10 to 45 · score 0.69 · loss aversion, inverse temperature, reward magnitudes, Choice probability, softmax, Utility · Report a mismatch
  8. [8] § METHODS › The Behavioral Model Space ↔ behavioral_analysis/dn_ba_07_parameter_recovery.ipynb, lines 22 to 72 · score 0.69 · inverse temperature, reward magnitudes, softmax, Utility, minus, box · Report a mismatch
  9. [9] § RESULTS › Behavioral Modeling of RPE Coding in Reward-Seeking and Punishment-Avoiding Contexts ↔ behavioral_analysis/matjags-dn/dn_bm_05_results_reporting.ipynb, lines 25 to 118 · score 0.66 · exceedance probabilities, PDCI model, submodel, PDCD, PICD, PICI · Report a mismatch
  10. [10] § METHODS › Bayesian Modeling ↔ behavioral_analysis/matjags-dn/dn_bm_02_model_selection.ipynb, lines 1 to 28 · score 0.57 · model selection, protected exceedance probabilities, MCMC, matjags, Bayesian, submodel · Report a mismatch
  11. [11] § METHODS › Experimental Procedures ↔ activation_analysis/dn_aa_01_first_level.ipynb, lines 163 to 291 · score 0.54 · decision phase, outcome phase, ITI, button, pressing, fMRI · Report a mismatch
  12. [12] § METHODS › Community-Level Agreement ↔ connectivity_analysis/bsc/dn_bs_10_agreement_monte_carlo.ipynb, lines 60 to 98 · score 0.54 · Monte Carlo, shuffled, agreement, LSN, connections, network · Report a mismatch
  13. [13] § RESULTS › Behavioral Modeling of RPE Coding in Reward-Seeking and Punishment-Avoiding Contexts ↔ behavioral_analysis/matjags-dn/dn_bm_02_model_selection.ipynb, lines 178 to 198 · score 0.53 · Bayes Factor, PDCD, PICD, PICI, marginalized, PDCI · Report a mismatch
  14. [14] § METHODS › Participants ↔ activation_analysis/dn_aa_02_exclusion.ipynb, lines 90 to 131 · score 0.53 · framewise displacement, FD, motion · Report a mismatch
  15. [15] § METHODS › Bayesian Modeling ↔ behavioral_analysis/matjags-dn/models/HLM_sequential_split.m, lines 39 to 79 · score 0.53 · Markov Chain, MATLAB, HLM, matjags, model · block oscr:b:MWS5ZF9XYFX48-D · Report a mismatch
  16. [16] § METHODS › Bayesian Modeling ↔ behavioral_analysis/dn_ba_06_beta_distribution.ipynb, lines 162 to 182 · score 0.52 · beta distribution, lognormal, uniform, model, behaviorally · Report a mismatch
  17. [17] § METHODS › Bayesian Modeling ↔ behavioral_analysis/matjags-dn/dn_bm_05_results_reporting.ipynb, lines 25 to 118 · score 0.52 · behavioral parameters, hierarchical, submodels, PDCD, PICD, PICI · Report a mismatch
  18. [18] § METHODS › Bayesian Modeling ↔ behavioral_analysis/matjags-dn/dn_bm_04_parameter_estimation.ipynb, lines 22 to 47 · score 0.52 · behavioral parameters, hierarchical, submodels, PDCD, PICD, PICI · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Jupyter notebook · 390 lines · 17 KB · MIT · 2 matches

  1. # %% [markdown]
  2. # ## Processing PRL task logs
  3. #
  4. # This script process raw, but validated PRL task logs. Script features:
  5. # - creates new useful variables and removes other not used ones
  6. # - aggregates behavioral data into single, easy to work DataFrame
  7. # - creates metadata describing aggregated behavioral data
  8. # - provides `plot_response` function for intuitive response pattern visualisation
  9. #
  10. # ---
  11. # **Last update**: 07.01.2020
  12. #
  13. # **Todo**: Clean REF
  14. # %%
  15. import matplotlib.pyplot as plt
  16. import matplotlib
  17. import pandas as pd
  18. import numpy as np
  19. import json
  20. import os
  21. import scipy.io
  22. path_root = '/home/kmb/Desktop/Neuroscience/Projects/BONNA_decide_net/'
  23. # %% [markdown]
  24. # ### The probabilistic reversal learning task
  25. #
  26. # During the fMRI scanning session participants carried out the PRL task in two conditions: (1) reward-seeking and (2) punishment-avoiding. Participants were instructed to repeatedly choose between yellow and blue boxes in order to collect as many points as possible in the reward-seeking condition or loose as little points as possible in the punishment-avoiding condition (**Fig. 1**). One of the boxes had the probability to be correct (rewarding or non-punishing depending on the condition) p = 0.8 and the other one p = 0.2. This reward contingency changed four times throughout each task condition. Reward probabilities were unknown to the subjects and had to be learned from experience. Each box had also associated reward magnitude, randomly selected at the beginning of each trial. These reward magnitudes represented as numbers within the box indicated possible gain in the reward-seeking condition or possible loss in the punishment-avoiding condition. To be successful in this task decision maker had to correctly estimate reward probabilities from experience and take into account reward magnitudes to choose an option with higher expected value.
  27. #
  28. # Each task condition was associated with the separate fMRI run and consisted of N=110 trials. Each trial began with the decision phase indicated by the question mark appearing within the fixation circle. During decision phase subject had 2 s to choose one of the boxes by pressing button on the response grip with either left or right thumb. Decision phase was followed by a variable inter-stimulus-interval (ISI; 3-7 s, jittered), after which an outcome was presented for 2 s. During the outcome phase fixation circle was colored accordingly to rewarded or punished box and the number within the circle represented number of gained or lost points (see **Fig. 1**). Outcome phase was followed by a variable inter-trial-interval (ITI; 3-7 s, jittered).
  29. #
  30. #
  31. # The number of points which subject gathered in the reward-seeking condition or the remaining number of points in the punishment-avoiding conditions was represented by the gray account bar on the bottom of the screen. Subjects were informed that if they manage to fill half of the bar or the entire bar in the reward-seeking condition they will receive 10 PLN or 20 PLN respectively. In the punishment-avoiding condition subjects were informed that they will receive 20 PLN if they are left with more than half of the bar, 10 PLN if they are left with less than half of the bar or that do not receive any money if they lose all of their points. To maintain constant level of motivation throughout the task, incentives thresholds were set such that all participants acquired 10 PLN from either task.
  32. #
  33. #
  34. # PsychoPy software (v. 1.90.1, www.psychopy.org (Peirce, 2007)) was used for task presentation on the MRI compatible NNL goggles (NordicNeuroLab, Bergen, Norway). Behavioral responses were collected using MRI compatible NNL response grips (NordicNeuroLab, Bergen, Norway), which were hold in both hands. Each condition lasted approximately 24 min. The order of task conditions as well as the colors for left and right box (yellow and blue) were counterbalanced across subjects. Before the MRI scan, subjects practiced both task conditions on the lab computer.
  35. # Heterogeneity in the prior expectations regarding the task structure may lead to heterogeneity in behavior even in simple tasks leading to inaccurate behavioral modelling (Shteingart and Loewenstein, 2014). To tackle this challenge, we explicitly instructed participants that one of the boxes will be more frequently rewarded in the reward-seeking condition or punished in the punishment-avoiding condition and that this contingency may reverse several times during the task. In order to further ensure that participants grasp correct model of the task environment, they were provided with the feedback indicating which box is more frequently correct during the first phase of the training.
  36. # %% [markdown]
  37. # Function `process_log_df()` cleans behavioral response dataframe changing data types, inverting interpretation of certain variables depending on task condition and drops irrelevant columns.
  38. # %%
  39. def process_log_df(df):
  40. '''Cleaning and pre-processing of log dataframe.
  41. Args:
  42. df (pd.Dataframe): raw log dataframe
  43. Returns:
  44. info (dictionary): contains task metadata
  45. df_clean (pd.Dataframe): pre-processed log dataframe
  46. '''
  47. df_clean = df.copy(deep=True)
  48. # Grab additional info
  49. info = {}
  50. info['n_trials'] = df_clean.shape[0]
  51. info['n_blocks'] = 5
  52. info['condition'] = df_clean['condition'][0]
  53. info['subject'] = df_clean['subject_id'][0]
  54. info['group'] = df_clean['group'][0]
  55. # Reaname non-intuitive columns according to guidlines
  56. df_clean.rename(columns={'block': 'block_bci'}, inplace=True)
  57. df_clean.rename(columns={'rwd': 'side_bci'}, inplace=True)
  58. if info['condition'] == 'pun':
  59. df_clean['block'] = (-1) * df_clean['block_bci']
  60. df_clean['side'] = (-1) * df_clean['side_bci']
  61. else:
  62. df_clean['block'] = df_clean['block_bci']
  63. df_clean['side'] = df_clean['side_bci']
  64. # Convert subject responses to integers
  65. df_clean.loc[df['response'] == 'a', 'response'] = -1
  66. df_clean.loc[df['response'] == 'd', 'response'] = 1
  67. try:
  68. df_clean.loc[df_clean['response'] == 'None', 'response'] = 0
  69. except:
  70. pass
  71. # Convert reaction time to float
  72. df_clean['rt'] = pd.to_numeric(df_clean['rt'], errors='coerce')
  73. # Reverse incorrect sign for punishment variables
  74. if info['condition'] == 'pun':
  75. df_clean['won_bool'] = ~ df_clean['won_bool']
  76. df_clean['won_magn'] *= (-1)
  77. df_clean['magn_left'] *= (-1)
  78. df_clean['magn_right'] *= (-1)
  79. # Drop unnecessary columns
  80. df_clean = df_clean[['block', 'block_bci', 'side', 'side_bci',
  81. 'magn_left', 'magn_right',
  82. 'response', 'rt',
  83. 'won_bool', 'won_magn', 'acc_after_trial',
  84. 'onset_iti', 'onset_iti_plan', 'onset_iti_glob',
  85. 'onset_dec', 'onset_dec_plan', 'onset_dec_glob',
  86. 'onset_isi', 'onset_isi_plan', 'onset_isi_glob',
  87. 'onset_out', 'onset_out_plan', 'onset_out_glob']]
  88. return info, df_clean
  89. # %% [markdown]
  90. # (1) load logs for all subjects
  91. #
  92. # (2) cleaning them using `process_log_df()` function
  93. #
  94. # (3) aggregate them to single list containing all dataframes accompanied with metadata
  95. # %%
  96. path_logs = os.path.join(
  97. path_root,
  98. 'data/main_fmri_study/sourcedata/behavioral/task_logs'
  99. )
  100. subjects = [f'm{sub:02}' for sub in range(2, 34)]
  101. df_all_rew, df_all_pun = [], []
  102. for subject in subjects:
  103. # Load behavioral responses for signle subject
  104. path_rew = f"{path_logs}/sub-{subject}/{subject}_prl_DecideNet_rew.csv"
  105. path_pun = f"{path_logs}/sub-{subject}/{subject}_prl_DecideNet_pun.csv"
  106. df_rew = pd.read_csv(path_rew)
  107. df_pun = pd.read_csv(path_pun)
  108. # Clean behavioral responses
  109. info_rew, df_rew = process_log_df(df_rew)
  110. info_pun, df_pun = process_log_df(df_pun)
  111. df_all_rew.append((info_rew, df_rew))
  112. df_all_pun.append((info_pun, df_pun))
  113. # %% [markdown]
  114. # ### Create single variable to represent all behavioral responses
  115. # Use aggregated lists of clean dataframes (`df_all_rew` and `df_all_pun`) and convert them to single numpy array representing all behavioral responses and task onsets. Size of aggregated array is: n_subjects x n_conditions x n_trials x 21. Array metadata decoding dimensions is stored in variable `meta`.
  116. # %%
  117. out_path = os.path.join(path_root, 'data/main_fmri_study/sourcedata/behavioral')
  118. filename = "behavioral_data_clean_all_REF"
  119. beh = np.zeros((len(subjects), 2, 110, 23))
  120. # Create & save metadata
  121. meta = {}
  122. meta['dim1'] = subjects
  123. meta['dim2'] = ['rew', 'pun']
  124. meta['dim3'] = [f'trial_{i+1}' for i in range(110)]
  125. meta['dim4'] = list(df_all_rew[0][1].keys())
  126. path_meta = os.path.join(out_path, f"{filename}.json")
  127. with open(path_meta, 'w') as f:
  128. json.dump(meta, f, indent=4)
  129. # Create & save numpy aggregated array
  130. for i, (df_rew, df_pun) in enumerate(zip(df_all_rew, df_all_pun)):
  131. beh[i, 0] = np.array(df_rew[1], dtype='float')
  132. beh[i, 1] = np.array(df_pun[1], dtype='float')
  133. path_beh_npy = os.path.join(out_path, f"{filename}.npy")
  134. path_beh_mat = os.path.join(out_path, f"{filename}.mat")
  135. # Save to both numpy and MATLAB formats
  136. np.save(path_beh_npy, beh)
  137. scipy.io.savemat(path_beh_mat, {'beh': beh}, appendmat=False)
  138. # %% [markdown]
  139. # ### Visualisation of subject responses
  140. # Function `plot_response()` creates friendly visualisation of subject responses throughout the task. Visualisation consists of:
  141. # - **top panel**: represents internal task structure
  142. # - blue and yellow blocks show stable phases for which box reward probabilities do not change (color is coding more profitable side; blue=left, yellow=right)
  143. # - dark blue line show reward magnitude for the left box
  144. # - yellow and blue dots show winning sides (rewarded / not punished)
  145. # - **middle panel**: represents subject's reaction times and account balance
  146. # - red line: reaction time,
  147. # - red rectangles: highlight misses
  148. # - black dashed line: account balance throughout the task
  149. # - dark shaded area: trials for which subject crossed reward threshold
  150. # - **bottom panel**: represetnes subject's trialwise responses
  151. # - green dot = rewarded / not punished; red dot = not rewarded / punished
  152. # - dark dashed line: idle time (how many stable trials subject experienced)
  153. # - colored rectangles: which side is more profitable in terms of reward magnitude
  154. # %% [markdown]
  155. # Load aggregated behavioral data.
  156. # %%
  157. import sys
  158. sys.path.append(os.path.join(path_root, 'code'))
  159. from dn_utils.behavioral_models_REF import load_behavioral_data
  160. path_beh = os.path.join(path_root, 'data/main_fmri_study/sourcedata/behavioral/')
  161. beh, meta = load_behavioral_data(path_beh)
  162. n_subjects = len(meta['dim1'])
  163. # %%
  164. def plot_response(beh, meta, subject, condition, save=False, **kwargs):
  165. '''Visualising useful aspects of subjects responses.
  166. Args:
  167. beh (np.array): aggregated behavioral responses
  168. meta (dict): description of beh array coding
  169. subject (int): subject index
  170. condition (int): task condition index
  171. 0 for reward condition or 1 for punishment condition
  172. save (bool): should I save your plot?
  173. ...
  174. **out_path (Str): path to folder to save plot
  175. '''
  176. col_blu = "#56B4E9" # left
  177. col_yel = "#F0E442" # right
  178. col_blu_d = "#0B3A54"
  179. # Get proper task & response features
  180. block_bci = beh[subject, condition, :, meta['dim4'].index('block_bci')]
  181. side_bci = beh[subject, condition, :, meta['dim4'].index('side_bci')]
  182. magn_left = beh[subject, condition, :, meta['dim4'].index('magn_left')]
  183. magn_right = beh[subject, condition, :, meta['dim4'].index('magn_right')]
  184. response = beh[subject, condition, :, meta['dim4'].index('response')]
  185. rt = beh[subject, condition, :, meta['dim4'].index('rt')]
  186. won_bool = beh[subject, condition, :, meta['dim4'].index('won_bool')]
  187. acc_after_trial = beh[subject, condition, :, meta['dim4'].index('acc_after_trial')]
  188. magn_diff = magn_right - magn_left
  189. n_blocks = np.nonzero(np.diff(block_bci))[0].shape[0] + 1
  190. n_trials = beh.shape[2]
  191. x_trials = np.arange(1, n_trials+1)
  192. # Determine begin and end of the blocks and rewarded side
  193. blocks = np.zeros((2, n_blocks+1), dtype='int')
  194. blocks[0, 0:n_blocks] = np.hstack((
  195. np.ones((1), dtype=int),
  196. np.nonzero(np.diff(beh[subject, condition, :, 0]))[0] + 2
  197. ))
  198. blocks[0, n_blocks] = n_trials
  199. blocks[1, 0:n_blocks] = beh[subject, condition, blocks[0][:-1], 0]
  200. if condition == 1: blocks[1, :] *= (-1)
  201. # Create plot
  202. fig, (ax1, ax2, ax3) = plt.subplots(3, 1, sharex=True,
  203. figsize=(20, 10), facecolor='w')
  204. ### Subplot 1 ###########################################################
  205. # True reward contingencies (more profitable side)
  206. for i in range(n_blocks):
  207. if blocks[1, i] == -1: col = col_blu
  208. else: col = col_yel
  209. ax1.fill_between(
  210. x=[blocks[0, i], blocks[0, i+1]],
  211. y1=-1, y2=1,
  212. color=col, alpha=.5)
  213. # Rewarded / punished side
  214. if condition == 1:
  215. ax1.scatter(x_trials, (-1)*side_bci*.9, c=(-1)*side_bci,
  216. cmap='cividis', vmin=-1.5, vmax=1.5)
  217. else:
  218. ax1.scatter(x_trials, side_bci*.9, c=side_bci,
  219. cmap='cividis', vmin=-1.5, vmax=1.5)
  220. ax1.set_ylim(-1, 1)
  221. ax1.set_yticks([-0.9, 0.9])
  222. ax1.set_yticklabels(['left', 'right'])
  223. ax1.set_ylabel('Better option')
  224. # Magnitude for left box
  225. ax1b = ax1.twinx()
  226. ax1b.plot(x_trials, magn_left, color=col_blu_d)
  227. ax1b.set_ylabel('$x(t)$ for left box', color=col_blu_d)
  228. ax1b.set_xlim(1, n_trials)
  229. if condition == 1:
  230. ax1b.set_ylim(-50, 0)
  231. else:
  232. ax1b.set_ylim(0, 50)
  233. ax1b.set_xlim(1, n_trials)
  234. ### Subplot 2 ###########################################################
  235. # Misses
  236. for miss in np.argwhere(np.isnan(rt)):
  237. ax2.fill_between(
  238. x=[miss[0]+.5, miss[0]+1.5],
  239. y1=0, y2=1.5,
  240. color='r', alpha=.5)
  241. # Reaction times
  242. ax2.plot(x_trials, rt, 'r')
  243. ax2.set_ylabel('reaction time $[s]$', color='r')
  244. ax2.set_xticks(blocks[0, 1:-1])
  245. ax2.set_ylim(0, 1.5)
  246. ax2.grid(axis='x')
  247. # Account
  248. ax2b = ax2.twinx()
  249. ax2b.plot(x_trials, acc_after_trial, 'k--')
  250. ax2b.set_ylabel('account balance')
  251. # Crossing predefined task threshold
  252. if condition == 1:
  253. acc_thr = np.ones(x_trials.shape) * 650
  254. ax2b.fill_between(x_trials, acc_after_trial, acc_thr,
  255. where=acc_after_trial <=acc_thr,
  256. color='k', alpha=.2)
  257. else:
  258. acc_thr = np.ones(x_trials.shape) * 1150
  259. ax2b.fill_between(x_trials, acc_after_trial, acc_thr,
  260. where=acc_after_trial >=acc_thr,
  261. color='k', alpha=.2)
  262. ### Subplot 3 ###########################################################
  263. # Idle time (repeated winning / not loosing side)
  264. idle = np.zeros(side_bci.shape)
  265. for i in range(1, len(side_bci)):
  266. current = side_bci[i]
  267. last_trials = np.flip(side_bci[:i] == current)
  268. t = 0
  269. while last_trials[t] == True:
  270. t += 1
  271. if t == len(last_trials):
  272. break
  273. if condition == 1: idle[i] = t * current * (-1)
  274. else: idle[i] = t * current
  275. ax3.plot(x_trials, idle, 'k')
  276. ax3.set_ylim(-np.max(np.abs(idle)) - 2, np.max(np.abs(idle)) + 2)
  277. ax3.set_ylabel('Idle time')
  278. # Difference in magnitude
  279. norm = matplotlib.colors.Normalize(-45, 45)
  280. colors = [[norm(-45), col_blu],
  281. [norm(0), "white"],
  282. [norm(45), col_yel]]
  283. cmap = matplotlib.colors.LinearSegmentedColormap.from_list("", colors)
  284. ax3b = ax3.twinx()
  285. for trial in range(n_trials):
  286. ax3b.fill_between(
  287. x=[trial+.5, trial+1.5],
  288. y1=-1, y2=1,
  289. color=cmap(norm(magn_diff[trial])), alpha=.7)
  290. # Subject respnses
  291. ax3b.scatter(x_trials, response*.75, c=won_bool,
  292. cmap='RdYlGn', vmin=-.2, vmax=1.2, s=50)
  293. ax3b.set_ylim(-1, 1)
  294. ax3b.set_yticks([-0.75, 0, .75])
  295. ax3b.set_yticklabels(['left', 'miss', 'right'])
  296. ax3b.grid(axis='both')
  297. ax3b.spines['top'].set_color(col_yel)
  298. ax3b.spines['top'].set_linewidth(3)
  299. ax3b.spines['bottom'].set_color(col_blu)
  300. ax3b.spines['bottom'].set_linewidth(3)
  301. if save:
  302. if "out_path" in kwargs: out_path = kwargs["out_path"] + "/"
  303. else: out_path = ""
  304. filename = f"{out_path}sub-{meta['dim1'][subject]}_{meta['dim2'][condition]}_respplot"
  305. plt.savefig(filename)
  306. plt.close()
  307. # %% [markdown]
  308. # Show example plot.
  309. # %%
  310. plot_response(beh, meta, 5, 0)
  311. # %% [markdown]
  312. # Generate and save response plots.
  313. # %%
  314. out_path = os.path.join(path_root, 'code/behavioral_analysis/figures/respplots');
  315. for i in range(n_subjects):
  316. # Save respplots to file
  317. plot_response(beh, meta, i, 0,
  318. save=True, out_path=out_path);
  319. plot_response(beh, meta, i, 1,
  320. save=True, out_path=out_path);

dn_ba_02_task_logs_processing.ipynb at commit e0d6323, under MIT · at the source

Overview

Authors: Kamil Bonna1,2, Oliver J. Hulme3,4,5, Simon R. Steinkamp3, David Meder3, Maria E. C. van der Weij3, Włodzisław Duch1,6, Karolina Finc7
  1. Centre for Modern Interdisciplinary Technologies, Nicolaus Copernicus University in Toruń, Toruń, Poland
  2. Institute of Cognitive Science, Faculty of Philosophy and Social Sciences, Nicolaus Copernicus University in Toruń, Toruń, Poland
  3. Danish Research Centre for Magnetic Resonance, Department of Radiology and Nuclear Medicine, Copenhagen University Hospital - Amager and Hvidovre, Copenhagen, Denmark
  4. London Mathematical Laboratory, London, UK
  5. Department of Psychology, University of Copenhagen, Copenhagen, Denmark
  6. Department of Informatics, Institute of Engineering and Technology, Faculty of Physics, Astronomy and Informatics, Nicolaus Copernicus University in Toruń, Toruń, Poland
  7. Institute of Advanced Studies, Centre for Modern Interdisciplinary Technologies, Nicolaus Copernicus University in Toruń, Toruń, Poland
Journal: Network neuroscience (Cambridge, Mass.), volume 10, issue 3, pages 853-883
Dates: received 2 October 2023; accepted 22 December 2025; published online 28 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1162/netn.a.544 · PMID 42730454 · PMCID PMC13569333 · OpenAlex W4384407593
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: fMRI (modality), human (organism), cognitive (subfield)
Methods: Statistics, Connectivity, Graphs, fMRI & imaging, Single-unit activity, calcium imaging
Keywords: Decision making, fMRI, Network reconfiguration, Modularity, Reward prediction error, RPE, Reinforcement learning
Topic: Functional Brain Connectivity Studies (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: National Science Centre (2020/36/T/HS6/00104)
Citations: not cited yet (Europe PMC); 71 references in the paper

Abstract

Learning from experience is theorized to be driven by reward prediction error (RPE) signals that reflect updates to our expectations of reward. Despite numerous studies on the neural correlates of RPEs, the question of how large-scale networks (LSN) in the brain reconfigure in response to an RPE learning signal remains open. Here, we examine how functional networks change in response to RPEs depending on the context. In our study, participants performed a probabilistic reversal learning task while we acquired fMRI data in two experimental settings: reward-seeking and punishment-avoiding. Participants’ behavior was best explained by models with different learning rates for positive and negative RPEs. Furthermore, no evidence was found for context-dependent learning rates. Using behaviorally fitted RPE models, we performed a whole-brain network analysis. This analysis revealed classical reward structures, where striatal reward networks emerge as modules when the community structure is examined at a finer resolution, and a ventromedial prefrontal network emerges at a coarser resolution. Using the same behavioral model, we found that, compared with negative RPEs, positive RPEs increased within-network integration and decreased between-community integration. This indicates that there are distinctly different neural processes for positive and negative RPEs.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 18 matches between paragraphs and lines of code.

kbonna/decidenet

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: e0d63237383a71808d1e40103a86777fbad46076, 30 June 2022
Languages: Jupyter (59), Python (18), MATLAB (12), Shell (1)
Size: 106 files, 90 scripts
Software Heritage: archived
Found in: “DATA AND CODE AVAILABILITY”
Holds: README, license file, environment (environment.yml), tests, 59 notebooks
Not found: CITATION.cff, continuous integration, documentation
Tools: NumPy (40 files), pandas (34 files), Matplotlib (27 files), SciPy (16 files), statsmodels (11 files), Nilearn (8 files), seaborn (8 files), NiBabel (7 files), Brain Connectivity Toolbox (5 files), PyBIDS (3 files), scikit-learn (3 files), Plotly (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
57 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 55 scripts, each with its path and the digest of its content;
  • 18 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data and code availability

All code used for neuroimaging and behavioral data processing and statistical data analyses are publicly available at https://github.com/kbonna/decidenet. The raw fMRI data are available from the corresponding author on request.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 7 keywords, 1 funder, 68 references.

Cite

This paper

Bonna, K., Hulme, O. J., Steinkamp, S. R., Meder, D., van der Weij, M. E. C., Duch, W., & Finc, K. (2026). Brain network reconfiguration during reward prediction error processing. Network neuroscience (Cambridge, Mass.), 10(3), 853-883. https://doi.org/10.1162/netn.a.544

BibTeX

@article{bonna2026brain,
author = {Bonna, Kamil and Hulme, Oliver J. and Steinkamp, Simon R. and Meder, David and van der Weij, Maria E. C. and Duch, Włodzisław and Finc, Karolina},
title = {{Brain network reconfiguration during reward prediction error processing}},
journal = {Network neuroscience (Cambridge, Mass.)},
year = {2026},
month = aug,
volume = {10},
number = {3},
pages = {853--883},
publisher = {MIT Press},
issn = {2472-1751},
doi = {10.1162/netn.a.544},
url = {https://doi.org/10.1162/netn.a.544},
pmid = {42730454},
pmcid = {PMC13569333}
}

RIS

TY - JOUR
AU - Bonna, Kamil
AU - Hulme, Oliver J.
AU - Steinkamp, Simon R.
AU - Meder, David
AU - van der Weij, Maria E. C.
AU - Duch, Włodzisław
AU - Finc, Karolina
TI - Brain network reconfiguration during reward prediction error processing
T2 - Network neuroscience (Cambridge, Mass.)
J2 - Netw Neurosci
PY - 2026
DA - 2026/08/28
VL - 10
IS - 3
SP - 853
EP - 883
SN - 2472-1751
PB - MIT Press
DO - 10.1162/netn.a.544
UR - https://doi.org/10.1162/netn.a.544
LA - en
ER -

CSL-JSON

{
"id": "10.1162/netn.a.544",
"type": "article-journal",
"title": "Brain network reconfiguration during reward prediction error processing",
"container-title": "Network neuroscience (Cambridge, Mass.)",
"author": [
{
"family": "Bonna",
"given": "Kamil"
},
{
"family": "Hulme",
"given": "Oliver J."
},
{
"family": "Steinkamp",
"given": "Simon R."
},
{
"family": "Meder",
"given": "David"
},
{
"family": "van der Weij",
"given": "Maria E. C."
},
{
"family": "Duch",
"given": "Włodzisław"
},
{
"family": "Finc",
"given": "Karolina"
}
],
"container-title-short": "Netw Neurosci",
"volume": "10",
"issue": "3",
"page": "853-883",
"DOI": "10.1162/netn.a.544",
"PMID": "42730454",
"PMCID": "PMC13569333",
"ISSN": "2472-1751",
"publisher": "MIT Press",
"URL": "https://doi.org/10.1162/netn.a.544",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
28
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1002/hbm.26587 [code]
Cortical timescales and the modular organization of structural and functional brain networks.
Journal: Human brain mapping
In common: Brain Connectivity Toolbox, Nilearn, statsmodels, 6 other tools, fMRI, 11 references
[2] doi:10.1002/hbm.25988
Reinforcement learning with associative or discriminative generalization across states and actions: fMRI at 3 T and 7 T.
Journal: Human brain mapping
In common: fMRI, cognitive, 14 references
[3] doi:10.1016/j.nicl.2022.103139 [code]
Altered brain network topology in children with auditory processing disorder: A resting-state multi-echo fMRI study.
Journal: NeuroImage. Clinical
In common: Brain Connectivity Toolbox, Nilearn, NiBabel, 6 other tools, fMRI, 9 references
[4] doi:10.1016/j.neuroimage.2021.118843 [code]
Functional brain network community structure in childhood: Unfinished territories and fuzzy boundaries.
Journal: NeuroImage
In common: PyBIDS, Brain Connectivity Toolbox, Nilearn, 7 other tools, 6 references
[5] doi:10.1162/netn_a_00402 [code]
The impact of functional correlations on task information coding.
Journal: Network neuroscience (Cambridge, Mass.)
In common: Brain Connectivity Toolbox, Nilearn, statsmodels, 7 other tools, fMRI, 5 references
[6] doi:10.1016/j.dcn.2021.101027 [code]
A transdiagnostic data-driven study of children's behaviour and the functional connectome.
Journal: Developmental cognitive neuroscience
In common: Brain Connectivity Toolbox, Nilearn, NiBabel, 6 other tools, fMRI, 6 references
[7] doi:10.1038/s41467-025-64424-9 [code]
Neurocomputational basis of learning when choices simultaneously affect both oneself and others.
Journal: Nature communications
In common: Nilearn, statsmodels, NiBabel, 5 other tools, 6 references
[8] doi:10.1038/s41586-025-08888-1 [code]
Adversarial testing of global neuronal workspace and integrated information theories of consciousness.
Journal: Nature
In common: Nilearn, statsmodels, NiBabel, 6 other tools, cognitive, 6 references
[9] doi:10.7554/elife.75474 [code]
The interpretation of computational model parameters depends on the context.
Journal: eLife
In common: statsmodels, seaborn, scikit-learn, 4 other tools, 6 references
[10] doi:10.1038/s41562-025-02324-0 [code]
Hybrid neural-cognitive models reveal how memory shapes human reward learning.
Journal: Nature human behaviour
In common: pandas, NumPy, cognitive, 8 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1162/netn.a.544.svg)](https://openscicode.org/badge/doi/10.1162/netn.a.544)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1162/netn.a.544.svg
   :target: https://openscicode.org/badge/doi/10.1162/netn.a.544
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1162/netn.a.544"><img src="https://openscicode.org/badge/doi/10.1162/netn.a.544.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.