OSCR

Region-specific weighting of sensory intensity and reward prediction error by dopamine signals.

Code ↔ Paper

8 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.

The 8 matches
  1. [1] § STAR★Methods › Quantification and statistical analysis ↔ Figure_S4B.py, lines 1–42 · score 0.81 · fold cross validation, Cross validated R2, training folds, S4B, stratified, held
  2. [2] § STAR★Methods › Method details › Multi-site fiber photometry ↔ Figure_1B.py, lines 131–171 · score 0.76 · high pass filtered, tone onset, isosbestic, smoothed, fluorescence, subtracted
  3. [3] § STAR★Methods › Quantification and statistical analysis ↔ Figure_S5EFG.py, lines 1–35 · score 0.65 · Model fit, R2 score, sensory preference, OT, TS
  4. [4] § STAR★Methods › Quantification and statistical analysis ↔ Figure_3IJ.py, lines 1–33 · score 0.59 · cross correlation, resolved regression, lag, reinforcement, fitting, model
  5. [5] § STAR★Methods › Quantification and statistical analysis › Statistics and reproducibility ↔ Figure_S3.py, lines 100–181 · score 0.55 · post hoc, Holm corrected, S3, ANOVA, models
  6. [6] § STAR★Methods › Quantification and statistical analysis › Statistics and reproducibility ↔ Figure_1FGH_2BCDE.py, lines 100–181 · score 0.53 · post hoc, Holm corrected, ANOVA, models
  7. [7] § Results › Dopamine displays high noise correlations within striatal and cortico-amygdalar circuits ↔ Figure_5_S6.py, lines 1–29 · score 0.52 · noise correlation, S6A, S6B, uncued reward, shuffled, baseline
  8. [8] § Results › Dopamine signals across brain regions reflect distinct sensory and reward prediction error components ↔ Figure_S5EFG.py, lines 1–35 · score 0.50 · Sensory preference, S5G, S5E, S5F, OT, mPFC

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 466 lines · 17 KB · MIT · 2 matches

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. """
  4. Created on Wed Nov 26 16:21:46 2025
  5. @author: vbp
  6. Model fit for the additional target regions (TS, NAc_c, OT), for Figure
  7. S5E, S5F, S5G.
  8. IMPORTANT: unlike the main-region regression scripts, this one does NOT
  9. fit alpha/delta per session — it uses fixed values (alpha=0.83, delta=0.82)
  10. for every session and region. These values are the population mean from best_value_fixed2.csv data.
  11. Fig S5E - R2 score across all 7 regions (OT, NAc_c, NAc_lat, DS, BLA, TS, mPFC)
  12. Fig S5F - R2 score, full model vs. shuffled-regressor controls, for
  13. OT, NAc_c, TS only
  14. Fig S5G - sensory preference index across all 7 regions (+ ANOVA)
  15. Data can be downloaded here: https://doi.org/10.17605/OSF.IO/DV724
  16. """
  17. from itertools import combinations
  18. import numpy as np
  19. import pandas as pd
  20. import seaborn as sns
  21. import matplotlib
  22. import matplotlib.pyplot as plt
  23. from scipy import stats
  24. import statsmodels.api as sm
  25. import statsmodels.formula.api as smf
  26. from statsmodels.stats.anova import anova_lm
  27. from statsmodels.stats.multicomp import pairwise_tukeyhsd
  28. from sklearn.linear_model import Ridge
  29. # %% Figure formatting
  30. def set_up_figure_format():
  31. """Set consistent style/rcParams for all figures in this script."""
  32. sns.set_theme(
  33. font="Helvetica", font_scale=0.75, style='ticks',
  34. rc={"axes.spines.right": False, "axes.spines.top": False},
  35. palette=["#ff595e", "#ff924c", "#52a675", "#4267ac"],
  36. )
  37. matplotlib.rcParams['pdf.fonttype'] = 42
  38. matplotlib.rcParams['ps.fonttype'] = 42
  39. matplotlib.rcParams['axes.spines.right'] = False
  40. matplotlib.rcParams['axes.spines.top'] = False
  41. matplotlib.rcParams['axes.linewidth'] = 0.5
  42. matplotlib.rcParams['ytick.major.width'] = 0.5
  43. matplotlib.rcParams['xtick.major.width'] = 0.5
  44. matplotlib.rcParams['xtick.minor.width'] = 0.5
  45. matplotlib.rcParams['ytick.minor.width'] = 0.5
  46. matplotlib.rcParams['xtick.major.size'] = 3
  47. matplotlib.rcParams['ytick.major.size'] = 3
  48. matplotlib.rcParams['xtick.minor.size'] = 1.5
  49. matplotlib.rcParams['ytick.minor.size'] = 1.5
  50. matplotlib.rcParams['image.cmap'] = 'mako'
  51. matplotlib.rcParams['lines.linewidth'] = 0.75
  52. plt.close('all')
  53. # %% Model encodings
  54. def encode_motivational(trmtx, alpha, negative_scale=1, punish_value=-1.0):
  55. """Encode each trial's motivational (reward-value) regressor R."""
  56. raw = trmtx[['ToneID', 'Reward?']].to_numpy()
  57. out = []
  58. for v in raw:
  59. if v[0] == 3 and v[1] == 5: # Uncued reward
  60. out.append(1)
  61. elif v[0] == 2 and v[1] == 5: # Cued reward
  62. out.append(1 - alpha)
  63. elif v[0] == 2 and v[1] == 0: # Reward omission
  64. out.append((-alpha) * negative_scale)
  65. elif v[0] == 3 and v[1] < 0: # Uncued air puff
  66. out.append(punish_value * negative_scale)
  67. elif v[0] == 2 and v[1] < 0: # Omission + air puff
  68. out.append((-alpha + punish_value) * negative_scale)
  69. elif v[0] == 3 and v[1] == 0: # Nothing
  70. out.append(0)
  71. else:
  72. raise ValueError(f"Unexpected motivational level (Tone='{v[0]}', Outcome='{v[1]}')")
  73. out = np.array(out)
  74. return out / np.std(out)
  75. def encode_sensory(trmtx, delta):
  76. """Encode each trial's sensory-intensity regressor S."""
  77. raw = trmtx[['ToneID', 'Reward?']].to_numpy()
  78. out = []
  79. for v in raw:
  80. if v[0] == 3 and v[1] == 5: # Uncued reward
  81. out.append(1 - delta)
  82. elif v[0] == 2 and v[1] == 5: # Cued reward
  83. out.append(1 - delta)
  84. elif v[0] == 2 and v[1] == 0: # Reward omission
  85. out.append(0)
  86. elif v[0] == 3 and v[1] < 0: # Uncued air puff
  87. out.append(1)
  88. elif v[0] == 2 and v[1] < 0: # Omission + air puff
  89. out.append(1)
  90. elif v[0] == 3 and v[1] == 0: # Nothing
  91. out.append(0)
  92. else:
  93. raise ValueError(f"Unexpected motivational level (Tone='{v[0]}', Outcome='{v[1]}')")
  94. out = np.array(out)
  95. return out / np.std(out)
  96. # %% Stats: one-way ANOVA with Tukey HSD post-hocs
  97. def oneway_anova_with_posthocs(df: pd.DataFrame, dv: str = "val", condition: str = "condition",
  98. *, alpha: float = 0.05, typ: int = 2):
  99. """
  100. One-way ANOVA on dv across levels of 'condition', with Tukey HSD post-hoc
  101. tests (OLS model: dv ~ C(condition); ANOVA table is Type II by default).
  102. Returns a dict with anova_table, partial_eta_sq, model, tukey_condition
  103. (long/tidy Tukey results), p_adj_matrix / reject_matrix (square matrices
  104. for heatmaps), assumption checks (Shapiro/Jarque-Bera, Levene), and
  105. group_sizes.
  106. """
  107. needed = {dv, condition}
  108. missing = needed - set(df.columns)
  109. if missing:
  110. raise ValueError(f"DataFrame is missing required columns: {missing}")
  111. data = df[[dv, condition]].dropna().copy()
  112. if data.empty:
  113. raise ValueError("No data left after dropping NA rows.")
  114. if not pd.api.types.is_categorical_dtype(data[condition]):
  115. data[condition] = data[condition].astype("category")
  116. if data[condition].nunique() < 2:
  117. raise ValueError("Need at least two levels in 'condition' to run one-way ANOVA.")
  118. formula = f"{dv} ~ C({condition})"
  119. model = smf.ols(formula, data=data).fit()
  120. aov = anova_lm(model, typ=typ)
  121. cond_row = f"C({condition})"
  122. if cond_row not in aov.index:
  123. raise RuntimeError(f"Could not find factor '{cond_row}' in ANOVA table.")
  124. ss_effect = aov.loc[cond_row, "sum_sq"]
  125. ss_error = aov.loc["Residual", "sum_sq"]
  126. partial_eta_sq = float(ss_effect / (ss_effect + ss_error)) if (ss_effect + ss_error) > 0 else np.nan
  127. try:
  128. shapiro_W, shapiro_p = stats.shapiro(model.resid)
  129. except Exception:
  130. jb_stat, jb_p, _, _ = sm.stats.jarque_bera(model.resid)
  131. shapiro_W, shapiro_p = np.nan, jb_p
  132. groups = [data.loc[data[condition] == lvl, dv].values for lvl in data[condition].cat.categories]
  133. levene_stat, levene_p = stats.levene(*groups, center="median")
  134. tukey = pairwise_tukeyhsd(endog=data[dv].values, groups=data[condition].values, alpha=alpha)
  135. tukey_df = pd.DataFrame(tukey._results_table.data[1:], columns=tukey._results_table.data[0])
  136. for col in ["meandiff", "lower", "upper", "p-adj"]:
  137. tukey_df[col] = pd.to_numeric(tukey_df[col], errors="coerce")
  138. tukey_df["reject"] = tukey_df["reject"].astype(bool)
  139. levels = list(data[condition].cat.categories)
  140. p_mat = pd.DataFrame(np.nan, index=levels, columns=levels, dtype=float)
  141. r_mat = pd.DataFrame(False, index=levels, columns=levels, dtype=bool)
  142. np.fill_diagonal(p_mat.values, 0.0)
  143. np.fill_diagonal(r_mat.values, False)
  144. for _, row in tukey_df.iterrows():
  145. g1 = str(row["group1"])
  146. g2 = str(row["group2"])
  147. p = float(row["p-adj"])
  148. rej = bool(row["reject"])
  149. if g1 in p_mat.index and g2 in p_mat.columns:
  150. p_mat.loc[g1, g2] = p
  151. p_mat.loc[g2, g1] = p
  152. r_mat.loc[g1, g2] = rej
  153. r_mat.loc[g2, g1] = rej
  154. return {
  155. "anova_table": aov,
  156. "partial_eta_sq": partial_eta_sq,
  157. "model": model,
  158. "tukey_condition": tukey_df,
  159. "p_adj_matrix": p_mat,
  160. "reject_matrix": r_mat,
  161. "assumptions": {
  162. "shapiro_resid": (shapiro_W, shapiro_p),
  163. "levene_across_conditions": (levene_stat, levene_p),
  164. },
  165. "group_sizes": data.groupby(condition, observed=True)[dv].size(),
  166. }
  167. # %% Load data and select sessions
  168. #
  169. # Two-stage selection, additive (OR'd into the same mask, not reset in
  170. # between): stage 1 keeps multi-site sessions across the 4 main regions;
  171. # stage 2 adds sessions recorded from the 3 additional-target regions.
  172. set_up_figure_format()
  173. DATA_PATH = 'Data/av_and_probcond_raster.npy'
  174. data = np.load(DATA_PATH, allow_pickle=True).item()
  175. trmtx = data['trmtx']
  176. raster_all_data = data['raster']
  177. t_raster = data['t_raster']
  178. ls_sess = trmtx['sessid'].unique()
  179. idx_select = np.zeros((len(trmtx)), dtype=bool)
  180. ls_loc_multisite_filter = ['DS', 'NAc_lat', 'BLA', 'mPFC', 'NAc_c']
  181. for sess in ls_sess:
  182. sub_loc = trmtx['loc'][trmtx['sessid'] == sess].unique()
  183. exp = trmtx['experiment'][trmtx['sessid'] == sess].unique()
  184. if len(sub_loc) > 2:
  185. if set(sub_loc).issubset(ls_loc_multisite_filter):
  186. if set(['Av']).issubset(exp):
  187. idx_select = idx_select | ((trmtx['sessid'] == sess).to_numpy() & (trmtx['experiment'] == 'Av').to_numpy())
  188. ls_loc_target_filter = ['TS', 'NAc_c', 'OT']
  189. for sess in ls_sess:
  190. sub_loc = trmtx['loc'][trmtx['sessid'] == sess].unique()
  191. exp = trmtx['experiment'][trmtx['sessid'] == sess].unique()
  192. if len(sub_loc) > 0:
  193. if set(sub_loc).issubset(ls_loc_target_filter):
  194. if set(['Av']).issubset(exp):
  195. idx_select = idx_select | ((trmtx['sessid'] == sess).to_numpy() & (trmtx['experiment'] == 'Av').to_numpy())
  196. trmtx_sub = trmtx.iloc[idx_select, :].copy()
  197. raster_sub = raster_all_data[idx_select, :]
  198. t_raster += 0.125
  199. crop_win = [-0.5, 3.5]
  200. raster_sub = raster_sub[:, (t_raster > crop_win[0]) & (t_raster < crop_win[1])]
  201. t_raster = t_raster[(t_raster > crop_win[0]) & (t_raster < crop_win[1])]
  202. ls_loc_all = ['DS', 'TS', 'NAc_lat', 'NAc_c', 'OT', 'BLA', 'mPFC']
  203. ls_sess = trmtx_sub['sessid'].unique()
  204. # %% Model parameters
  205. ls_trial = [
  206. [3, 5], # Uncued reward
  207. [2, 5], # Cued reward
  208. [2, 0], # Reward omission
  209. [3, -1], # Uncued air puff
  210. [2, -1], # Reward omission & air puff
  211. ]
  212. ls_trial_type = ['uncued rew', 'cued rew', 'omission', 'uncued pun', 'omission pun']
  213. fit_win = [1.5, 2.5] # window used to fit the model (relative to cue)
  214. negative_scale = 0.5
  215. mean_post_reinf = np.mean(raster_sub[:, (t_raster > fit_win[0]) & (t_raster < fit_win[1])], axis=1)
  216. bl = np.mean(raster_sub[:, (t_raster > fit_win[0] - 0.25) & (t_raster < fit_win[0])], axis=1)
  217. mean_post_reinf -= bl
  218. # %% Fit with fixed alpha/delta (see note at top of file) for every region
  219. # TODO: confirm 0.83 / 0.82 are the intended values (e.g. population mean
  220. # alpha/delta from the main-region model) and document their provenance.
  221. FIXED_ALPHA = 0.83
  222. FIXED_DELTA = 0.82
  223. results_fixed_all = []
  224. for sess in ls_sess:
  225. sensory = encode_sensory(trmtx_sub, FIXED_DELTA)
  226. motivational = encode_motivational(trmtx_sub, FIXED_ALPHA, negative_scale=negative_scale)
  227. for loc in ls_loc_all:
  228. idx_trial_select = (trmtx_sub['sessid'] == sess) & (trmtx_sub['loc'] == loc)
  229. if idx_trial_select.sum() == 0:
  230. continue
  231. idx_trial_select = idx_trial_select.to_numpy()
  232. y = mean_post_reinf[idx_trial_select]
  233. X = np.array([motivational[idx_trial_select], sensory[idx_trial_select]]).T
  234. clf = Ridge(alpha=0)
  235. clf.fit(X, y)
  236. results_fixed_all.append({
  237. 'an': trmtx_sub.loc[idx_trial_select]['anid'].unique()[0],
  238. 'sess': sess,
  239. 'loc': loc,
  240. 'alpha_learning': FIXED_ALPHA,
  241. 'delta_punish': FIXED_DELTA,
  242. 'b0': clf.intercept_,
  243. 'b_motiv': clf.coef_[0],
  244. 'b_senso': clf.coef_[1],
  245. 'r2_score': clf.score(X, y),
  246. })
  247. results_fixed_all = pd.DataFrame(results_fixed_all)
  248. best_value_fixed = results_fixed_all.loc[results_fixed_all.groupby(['sess', 'loc'])['r2_score'].idxmax()].reset_index(drop=True)
  249. ls_loc_ordered = ['OT', 'NAc_c', 'NAc_lat', 'DS', 'BLA', 'TS', 'mPFC']
  250. best_value_fixed['loc'] = pd.Categorical(best_value_fixed['loc'], categories=ls_loc_ordered, ordered=True)
  251. results_fixed_all['loc'] = pd.Categorical(results_fixed_all['loc'], categories=ls_loc_ordered, ordered=True)
  252. best_value_fixed['senso_bias'] = (
  253. (best_value_fixed['b_senso'].abs() - best_value_fixed['b_motiv'].abs())
  254. / (best_value_fixed['b_motiv'].abs() + best_value_fixed['b_senso'].abs())
  255. )
  256. # %% Fig S5G: sensory preference index across all 7 regions
  257. fig, ax = plt.subplots(1, 3, figsize=(6, 3))
  258. var = 'b_senso'
  259. a = ax[0]
  260. sns.lineplot(best_value_fixed, x='loc', y=var, estimator=None, units='sess',
  261. ax=a, color='crimson', alpha=0.3, marker='.', size=3, markeredgewidth=0.25)
  262. sns.lineplot(best_value_fixed, x='loc', y=var,
  263. errorbar='se', err_style='bars', ax=a, color='crimson', marker='o', markeredgewidth=0.25)
  264. a.legend().remove()
  265. a.set_xlabel('')
  266. plt.setp(a.get_xticklabels(), rotation=90, ha='right')
  267. a.set_ylim(0, 4)
  268. var = 'b_motiv'
  269. a = ax[1]
  270. sns.lineplot(best_value_fixed, x='loc', y=var, estimator=None, units='sess',
  271. ax=a, color='k', alpha=0.3, marker='.', size=3, markeredgewidth=0.25)
  272. sns.lineplot(best_value_fixed, x='loc', y=var,
  273. errorbar='se', err_style='bars', ax=a, color='k', marker='o', markeredgewidth=0.25)
  274. a.legend().remove()
  275. a.set_xlabel('')
  276. plt.setp(a.get_xticklabels(), rotation=90, ha='right')
  277. a.set_ylim(0, 4)
  278. var = 'senso_bias'
  279. a = ax[2]
  280. sns.stripplot(best_value_fixed, x='loc', y=var, ax=a, color='k', alpha=0.3, marker='.', size=5)
  281. sns.lineplot(best_value_fixed, x='loc', y=var, lw=0,
  282. errorbar='se', err_style='bars', ax=a, color='k', marker='o', markeredgewidth=0.25)
  283. a.axhline(0, ls='--', color='k')
  284. a.set_ylim(-1.05, 1.05)
  285. a.set_xlabel('')
  286. plt.setp(a.get_xticklabels(), rotation=90, ha='right')
  287. a.legend().remove()
  288. fig.tight_layout()
  289. res = oneway_anova_with_posthocs(best_value_fixed, 'senso_bias', 'loc')
  290. print()
  291. print('Senso_bias:')
  292. print(res['anova_table'])
  293. print(res['tukey_condition'])
  294. # %% Fig S5E, S5F: R2 score, plain (all 7 regions) and vs. shuffled-regressor
  295. # controls (OT, NAc_c, TS only)
  296. rng = np.random.default_rng(25)
  297. n_shuffle = 100
  298. results_scrambled = []
  299. for sess in ls_sess:
  300. for loc in ls_loc_all:
  301. idx_trial_select = (trmtx_sub['sessid'] == sess) & (trmtx_sub['loc'] == loc)
  302. if idx_trial_select.sum() == 0:
  303. continue
  304. alpha, delta, r2_full = best_value_fixed[['alpha_learning', 'delta_punish', 'r2_score']][
  305. (best_value_fixed['sess'] == sess) & (best_value_fixed['loc'] == loc)
  306. ].to_numpy()[0]
  307. idx_trial_select = idx_trial_select.to_numpy()
  308. trmtx_sub_loc = trmtx_sub.iloc[idx_trial_select]
  309. sensory = encode_sensory(trmtx_sub_loc, delta)
  310. motivational = encode_motivational(trmtx_sub_loc, alpha, negative_scale=negative_scale)
  311. y = mean_post_reinf[idx_trial_select]
  312. X = np.array([motivational, sensory]).T
  313. r2_Msh = []
  314. for _ in range(n_shuffle):
  315. idx = np.arange(X.shape[0])
  316. rng.shuffle(idx)
  317. X_sh = X.copy()
  318. X_sh[:, 0] = X_sh[idx, 0]
  319. clf = Ridge(alpha=0)
  320. clf.fit(X_sh, y)
  321. r2_Msh.append(clf.score(X, y))
  322. r2_Ssh = []
  323. for _ in range(n_shuffle):
  324. idx = np.arange(X.shape[0])
  325. rng.shuffle(idx)
  326. X_sh = X.copy()
  327. X_sh[:, 1] = X_sh[idx, 1]
  328. clf = Ridge(alpha=0)
  329. clf.fit(X_sh, y)
  330. r2_Ssh.append(clf.score(X, y))
  331. results_scrambled.append({
  332. 'an': trmtx_sub.loc[idx_trial_select]['anid'].unique()[0],
  333. 'sess': sess,
  334. 'loc': loc,
  335. 'alpha_learning': alpha,
  336. 'delta_punish': delta,
  337. 'r2_full': r2_full,
  338. 'r2_M_shuffled': np.mean(r2_Msh),
  339. 'r2_S_shuffled': np.mean(r2_Ssh),
  340. })
  341. results_scrambled = pd.DataFrame(results_scrambled)
  342. results_scrambled['loc'] = pd.Categorical(results_scrambled['loc'], categories=ls_loc_ordered, ordered=True)
  343. fig, ax = plt.subplots(1, 2, figsize=(5, 3))
  344. # Fig S5E: R2 score, all 7 regions
  345. a = ax[0]
  346. sns.stripplot(results_scrambled, x='loc', y='r2_full', ax=a, color='k', alpha=0.3, marker='.', size=6)
  347. sns.lineplot(results_scrambled, x='loc', y='r2_full', lw=0,
  348. errorbar='se', err_style='bars', ax=a, color='k', marker='o', markeredgewidth=0.25)
  349. a.legend().remove()
  350. a.set_xlabel('')
  351. plt.setp(a.get_xticklabels(), rotation=90, ha='right')
  352. a.set_ylim(-0.05, 1.05)
  353. res = oneway_anova_with_posthocs(results_scrambled, 'r2_full', 'loc')
  354. print('R2 Full:')
  355. print(res['anova_table'])
  356. print(res['tukey_condition'])
  357. # Fig S5F: full model vs. shuffled-regressor controls, OT/NAc_c/TS only
  358. mtx = results_scrambled[['r2_full', 'r2_M_shuffled', 'r2_S_shuffled']].to_numpy()
  359. ls_marker_color = ['k', 'crimson', 'grey']
  360. ls_loc_targets3 = ['OT', 'NAc_c', 'TS']
  361. for i, loc in enumerate(ls_loc_targets3):
  362. mtx_sub = mtx[(results_scrambled['loc'] == loc).to_numpy()]
  363. a = ax[1]
  364. a.plot(np.array([0, 1, 2]) + 3.5 * i, mtx_sub.T, color='k', lw=0.25, alpha=0.5)
  365. a.set_xticks([1, 4.5, 8])
  366. a.set_xticklabels(ls_loc_targets3)
  367. m = np.mean(mtx_sub, axis=0)
  368. sem = stats.sem(mtx_sub, axis=0)
  369. a.plot(np.array([0, 1, 2]) + 3.5 * i, m, color='k', lw=0.75)
  370. for j in [0, 1, 2]:
  371. a.errorbar(j + 3.5 * i, m[j], sem[j], marker='o', lw=0.75,
  372. color=ls_marker_color[j], markeredgecolor='w', markeredgewidth=0.25)
  373. a.set_ylim(-0.05, 1.05)
  374. p1 = stats.ttest_rel(mtx_sub[:, 0], mtx_sub[:, 1])[1] * 2
  375. p2 = stats.ttest_rel(mtx_sub[:, 0], mtx_sub[:, 2])[1] * 2
  376. print(f'\n{loc}:\np(M){p1:0.1e}\np(S){p2:0.1e}')
  377. ax[0].set_ylabel('R2 score')
  378. ax[1].set_ylabel('R2 score')
  379. fig.tight_layout()

Figure_S5EFG.py at commit df97100, under MIT · at the source

Overview

Authors: Sarah-Julie Bouchard1, Joël Boutin1, Martin Lévesque1,2, Vincent Breton-Provencher1,2
  1. CERVO Brain Research Centre, Québec City, QC G1J 2G3, Canada
  2. Department of Psychiatry and Neuroscience, Université Laval, Québec City, QC G1V 0A6, Canada
Institutions: Université Laval (Canada)
Journal: iScience, volume 29, issue 9, article 117130
Dates: received 28 January 2026; accepted 29 June 2026; published online 14 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1016/j.isci.2026.117130 · PMID 42643232 · PMCID PMC13503106 · OpenAlex W7203450669
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: cognitive (subfield)
Methods: Spectral & time-frequency, Statistics, Machine learning, Preprocessing, Evoked potentials, Connectivity, Smoothing, state filtering, decompositions
Keywords: dopamine, reward prediction error, classical conditioning, striatum, nucleus accumbens, prefrontal cortex, amygdala, dopamine sensors, optogenetics
Topic: Neural and Behavioral Psychology Studies (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Natural Sciences and Engineering Research Council of Canada (RGPIN-2021-03284, RGPIN-2024-05363); Canadian Institutes of Health Research (#517536, #451548, #551059); Evans Leaders Fund (44014); AFOSR Cognitive & Computational Neuroscience Program (FA9550-23-1-0533); Fonds de recherche du Québec
Citations: not cited yet (Europe PMC); 71 references in the paper
Research resources: RRID:AB_143157, Rabbit anti-GFP RRID:AB_887725

Abstract

Growing evidence shows that dopamine signaling is diverse, with dopaminergic neurons responding to rewarding and aversive stimuli. Here, we hypothesized that this heterogeneity arises from a distributed balance between two components of dopamine signaling: sensory intensity of a stimulus, and reward prediction error. To test this, we simultaneously recorded dopamine release across striatal and cortico-amygdalar circuits using multi-site fiber photometry and a fluorescent dopamine sensor during a classical conditioning paradigm. Using a regression model, we found that striatal areas such as the dorsal striatum and nucleus accumbens emphasized reward prediction error, whereas the medial prefrontal cortex and basolateral amygdala favored sensory intensity. Noise correlation analyses further supported these findings by revealing two modules of coordinated dopamine activity: one linking striatal regions and another linking cortical-amygdalar circuits. Together, our results suggest that dopamine balances sensory and reward information, a mechanism that may support attentional processes alongside its role in associative learning.

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

Repositories

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

OSF dv724

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Size: 4 files
Software Heritage: not checked
Found in: “Data and code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)

Zenodo 21498194

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Data and code availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Matplotlib (15 files), NumPy (15 files), pandas (15 files), SciPy (15 files), seaborn (14 files), scikit-learn (8 files), statsmodels (8 files)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
17 files

laboratory-of-vincent-breton-provencher/bouchardetal_2026

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: df971002da47859d93ed7d7b1262b47f628252b7, 22 July 2026
Languages: Python (15)
Size: 20 files, 15 scripts
Software Heritage: not archived
Found in: the Zenodo archive record
Holds: README, license file, environment (requirements.txt)
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: Matplotlib (15 files), NumPy (15 files), pandas (15 files), SciPy (15 files), seaborn (14 files), scikit-learn (8 files), statsmodels (8 files)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
17 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:

  • 3 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 30 scripts, each with its path and the digest of its content;
  • 8 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

• Trial-aligned fiber photometry data have been deposited at The Open Science Framework (OSF) and are publicly available as of the date of publication at https://doi.org/10.17605/OSF.IO/DV724. • All original code has been deposited at https://doi.org/10.5281/zenodo.21498194 and is publicly available as of the date of publication. • Any additional information required to reanalyze the data reported in this paper is available from the lead contact upon 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 2, 28 September 2026

  • Authors: added Vincent Breton-Provencher (0000-0002-1701-325X); removed Vincent Breton-Provencher

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 9 keywords, 5 funders, 71 references, 2 RRIDs.

Cite

This paper

Bouchard, S.-J., Boutin, J., Lévesque, M., & Breton-Provencher, V. (2026). Region-specific weighting of sensory intensity and reward prediction error by dopamine signals. iScience, 29(9), 117130. https://doi.org/10.1016/j.isci.2026.117130

BibTeX

@article{bouchard2026region,
author = {Bouchard, Sarah-Julie and Boutin, Joël and Lévesque, Martin and Breton-Provencher, Vincent},
title = {{Region-specific weighting of sensory intensity and reward prediction error by dopamine signals}},
journal = {iScience},
year = {2026},
month = aug,
volume = {29},
number = {9},
pages = {117130},
publisher = {Elsevier},
issn = {2589-0042},
doi = {10.1016/j.isci.2026.117130},
url = {https://doi.org/10.1016/j.isci.2026.117130},
pmid = {42643232},
pmcid = {PMC13503106}
}

RIS

TY - JOUR
AU - Bouchard, Sarah-Julie
AU - Boutin, Joël
AU - Lévesque, Martin
AU - Breton-Provencher, Vincent
TI - Region-specific weighting of sensory intensity and reward prediction error by dopamine signals
T2 - iScience
J2 - iScience
PY - 2026
DA - 2026/08/14
VL - 29
IS - 9
SP - 117130
SN - 2589-0042
PB - Elsevier
DO - 10.1016/j.isci.2026.117130
UR - https://doi.org/10.1016/j.isci.2026.117130
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.isci.2026.117130",
"type": "article-journal",
"title": "Region-specific weighting of sensory intensity and reward prediction error by dopamine signals",
"container-title": "iScience",
"author": [
{
"family": "Bouchard",
"given": "Sarah-Julie"
},
{
"family": "Boutin",
"given": "Joël"
},
{
"family": "Lévesque",
"given": "Martin"
},
{
"family": "Breton-Provencher",
"given": "Vincent"
}
],
"container-title-short": "iScience",
"volume": "29",
"issue": "9",
"page": "117130",
"DOI": "10.1016/j.isci.2026.117130",
"PMID": "42643232",
"PMCID": "PMC13503106",
"ISSN": "2589-0042",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.isci.2026.117130",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
14
]
]
}
}

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.1038/s41467-026-73994-1 [code]
Prediction error correlates in the striosome-dopamine circuit emerge from information gain.
Journal: Nature communications
In common: statsmodels, seaborn, pandas, 3 other tools, cognitive, 15 references
[2] doi:10.1038/s42003-026-10485-5 [code]
Dopamine dynamics as a regulatory mechanism for shifting between defensive and reward-seeking behaviors.
Journal: Communications biology
In common: 9 references
[3] doi:10.1073/pnas.2613593123 [code]
Calbindin stratifies midbrain dopaminergic neurons governing distinct aspects of locomotion.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: 8 references
[4] doi:10.1038/s41467-026-71357-4 [code]
Social reward outcompetes drug seeking dopaminergic ensembles to prevent relapse.
Journal: Nature communications
In common: SciPy, Matplotlib, NumPy, 7 references
[5] doi:10.1038/s41467-026-75371-4 [code]
Cerebellar neural populations orchestrate dopamine reward signaling with single-trial precision.
Journal: Nature communications
In common: statsmodels, seaborn, scikit-learn, 4 other tools, 4 references
[6] doi:10.1523/jneurosci.1762-25.2026 [code]
Mesocorticostriatal Reinforcement Learning of State Representation and Value with Implications for the Mechanisms of Schizophrenia.
Journal: The Journal of neuroscience : the official journal of the Society for Neuroscience
In common: 7 references
[7] doi:10.7554/elife.93664 [code]
Drug-induced changes in connectivity to midbrain dopamine cells revealed by rabies monosynaptic tracing.
Journal: eLife
In common: statsmodels, seaborn, scikit-learn, 4 other tools, 3 references
[8] doi:10.1016/j.celrep.2026.117298 [code]
Midbrain endocannabinoids actuate dopamine-based action selection.
Journal: Cell reports
In common: pandas, Matplotlib, 6 references
[9] doi:10.1038/s41467-026-77168-x [code]
Cholinergic-dependent dopamine signals in mouse dorsomedial striatum are regulated by frontal but not sensory cortices.
Journal: Nature communications
In common: statsmodels, seaborn, pandas, 3 other tools, 3 references
[10] doi:10.1038/s41467-026-71386-z [code]
Planar, spiral, and concentric traveling waves distinguish behavioral states in human memory.
Journal: Nature communications
In common: statsmodels, seaborn, scikit-learn, 4 other tools, cognitive, 1 reference

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.

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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

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