OSCR

Association learning drives synaptic plasticity at feedforward synapses in somatosensory cortex.

Code ↔ Paper

2 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 2 matches
  1. [1] § Methods › Regression discontinuity tree model ↔ RDD_Test_V6.py, lines 92–204 · score 0.79 · regression discontinuity tree, Mann Whitney, cutoff point, qEPSC, variable, depth
  2. [2] § Methods › Quantification and statistical analysis ↔ RDD_Test_V6.py, lines 92–204 · score 0.77 · linear regressions, regression discontinuity tree, Mann Whitney, validated, SEM, bar

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 · 220 lines · 9.3 KB · no license · 2 matches

  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Thu Oct 2 15:51:54 2025
  4. @author: JoeCh
  5. """
  6. import tkinter as tk
  7. from tkinter import filedialog, simpledialog
  8. import pandas as pd
  9. import matplotlib.pyplot as plt
  10. import numpy as np
  11. from sklearn.tree import DecisionTreeRegressor, plot_tree
  12. from sklearn.model_selection import GridSearchCV, cross_val_score
  13. from scipy.stats import mannwhitneyu, linregress, ttest_ind
  14. # Global variables
  15. df = None
  16. running_var = None
  17. outcome_var = None
  18. # Function to create a scrollable frame for radio buttons
  19. def create_scrollable_radiobuttons(columns, parent_frame):
  20. for widget in parent_frame.winfo_children():
  21. widget.destroy()
  22. canvas = tk.Canvas(parent_frame, height=200, width=250)
  23. scrollbar = tk.Scrollbar(parent_frame, orient="vertical", command=canvas.yview)
  24. scroll_frame = tk.Frame(canvas)
  25. scroll_frame.bind("<Configure>", lambda e: canvas.configure(scrollregion=canvas.bbox("all")))
  26. canvas.create_window((0, 0), window=scroll_frame, anchor="nw")
  27. canvas.configure(yscrollcommand=scrollbar.set)
  28. var = tk.StringVar()
  29. for col in columns:
  30. radio_button = tk.Radiobutton(scroll_frame, text=col, variable=var, value=col)
  31. radio_button.pack(anchor=tk.W)
  32. def on_mouse_wheel(event):
  33. canvas.yview_scroll(-1 * (event.delta // 120), "units")
  34. canvas.bind("<Enter>", lambda _: canvas.bind_all("<MouseWheel>", on_mouse_wheel))
  35. canvas.bind("<Leave>", lambda _: canvas.unbind_all("<MouseWheel>"))
  36. canvas.pack(side="left", fill="both", expand=True)
  37. scrollbar.pack(side="right", fill="y")
  38. return var
  39. # File chooser
  40. def choose_file():
  41. global df, running_var, outcome_var
  42. file_path = filedialog.askopenfilename(filetypes=[("Excel files", "*.xls;*.xlsx")])
  43. if file_path:
  44. df = pd.read_excel(file_path)
  45. columns = df.columns.tolist()
  46. running_var = create_scrollable_radiobuttons(columns, frame_running)
  47. outcome_var = create_scrollable_radiobuttons(columns, frame_outcome)
  48. # Bootstrap CI
  49. def bootstrap_ci(model, X, y, n_bootstrap=1000):
  50. estimates = []
  51. for _ in range(n_bootstrap):
  52. sample_idx = np.random.choice(len(y), len(y), replace=True)
  53. X_sample, y_sample = X[sample_idx], y[sample_idx]
  54. model.fit(X_sample, y_sample)
  55. estimates.append(model.predict(X).mean())
  56. lower_bound = np.percentile(estimates, 2.5)
  57. upper_bound = np.percentile(estimates, 97.5)
  58. return lower_bound, upper_bound
  59. # Permutation test (studentized t-statistic)
  60. def permutation_test_tstat(X, y, cutoff, n_permutations=1000):
  61. mask_above = X.flatten() > cutoff
  62. mask_below = ~mask_above
  63. y_above, y_below = y[mask_above], y[mask_below]
  64. if len(y_above) < 2 or len(y_below) < 2:
  65. return 1.0, 0.0, 0.0
  66. tau = y_above.mean() - y_below.mean()
  67. se = np.sqrt(y_above.var(ddof=1)/len(y_above) + y_below.var(ddof=1)/len(y_below))
  68. orig_t = tau / se if se > 0 else 0.0
  69. perm_tstats = []
  70. for _ in range(n_permutations):
  71. y_perm = np.random.permutation(y)
  72. ya, yb = y_perm[mask_above], y_perm[mask_below]
  73. if len(ya) < 2 or len(yb) < 2:
  74. perm_tstats.append(0.0)
  75. continue
  76. tau_perm = ya.mean() - yb.mean()
  77. se_perm = np.sqrt(ya.var(ddof=1)/len(ya) + yb.var(ddof=1)/len(yb))
  78. perm_tstats.append(tau_perm/se_perm if se_perm > 0 else 0.0)
  79. p_val = (np.sum(np.abs(perm_tstats) >= np.abs(orig_t)) + 1) / (n_permutations + 1)
  80. return p_val, orig_t, tau
  81. # Main analysis
  82. def run_rdt():
  83. global df, running_var, outcome_var
  84. if running_var.get() and outcome_var.get():
  85. running_variable = running_var.get()
  86. outcome_variable = outcome_var.get()
  87. color_map = {'SAT1': 'blue','SAT2': 'magenta','SAT5': 'lime','ACC': 'black',
  88. 'ACC6': 'gray','PSEcntl': 'lightcoral','PSE1': 'red','PSE2': 'maroon',
  89. 'SDT1': 'lightblue','SDT2': 'teal','Naïve': 'Purple','Naive': 'Purple','EE': 'gray'}
  90. X = df[running_variable].values.reshape(-1, 1)
  91. y = df[outcome_variable].values
  92. # Fit tree and find cutoff
  93. param_grid = {'max_depth': range(1, 11)}
  94. dt_regressor = DecisionTreeRegressor()
  95. grid_search = GridSearchCV(dt_regressor, param_grid, cv=5, scoring='neg_mean_squared_error')
  96. grid_search.fit(X, y)
  97. best_tree = grid_search.best_estimator_
  98. optimal_cutoff = best_tree.tree_.threshold[0]
  99. slope, intercept, r_value, p_value, std_err = linregress(X.flatten(), y)
  100. # Plot scatter + regression line
  101. plt.figure(figsize=(10, 6))
  102. scatter_handles = []
  103. used_colors = set()
  104. for grp, color in color_map.items():
  105. df_grp = df[df['GrpTrain'] == grp]
  106. if not df_grp.empty:
  107. scatter_handle = plt.scatter(df_grp[running_variable], df_grp[outcome_variable], color=color, label=grp)
  108. scatter_handles.append(scatter_handle)
  109. used_colors.add(color)
  110. plt.axvline(x=optimal_cutoff, color='red', alpha=0.25, linestyle='--',
  111. label=f'Optimal Cutoff Point: {optimal_cutoff:.2f} µm')
  112. x_values = np.linspace(min(X), max(X), 100)
  113. y_values = intercept + slope * x_values
  114. plt.plot(x_values, y_values, color='black', linestyle='--', linewidth=2,
  115. label=f'Linear Regression (p-value: {p_value:.4f})')
  116. plt.legend()
  117. plt.xlabel("Depth (µm)", fontsize=26)
  118. plt.ylabel("Amplitude (pA)", fontsize=26)
  119. plt.title('Regression Discontinuity Tree with Linear Regression')
  120. plt.show()
  121. # Show decision tree
  122. plt.figure(figsize=(12, 8))
  123. plot_tree(best_tree, feature_names=[running_variable], filled=True, rounded=True)
  124. plt.show()
  125. # Cross-validation
  126. cross_val_scores = cross_val_score(best_tree, X, y, cv=5, scoring='neg_mean_squared_error')
  127. print(f'Cross-validated MSE: {cross_val_scores.mean()}')
  128. # Bootstrap CI
  129. lb, ub = bootstrap_ci(best_tree, X, y)
  130. print(f'Bootstrap CI: ({lb}, {ub})')
  131. # Choose cutoff
  132. cutoff_choice = simpledialog.askstring("Cutoff Selection", "Choose cutoff selection method: (RDT/Manual)")
  133. if cutoff_choice.lower() == 'rdt':
  134. cutoff = optimal_cutoff
  135. elif cutoff_choice.lower() == 'manual':
  136. cutoff = float(simpledialog.askstring("Manual Cutoff", "Enter manual cutoff value:"))
  137. else:
  138. raise ValueError("Invalid choice. Please choose either 'RDT' or 'Manual'.")
  139. # Groups
  140. group_below_cutoff = df[df[running_variable] <= cutoff][outcome_variable]
  141. group_above_cutoff = df[df[running_variable] > cutoff][outcome_variable]
  142. # Mann-Whitney
  143. mw_stat, mw_p = mannwhitneyu(group_below_cutoff, group_above_cutoff)
  144. # Discontinuity τ and t-test
  145. tau = group_above_cutoff.mean() - group_below_cutoff.mean()
  146. t_stat, _ = ttest_ind(group_above_cutoff, group_below_cutoff, equal_var=False)
  147. # Permutation test (t-stat based)
  148. perm_p, orig_t, orig_tau = permutation_test_tstat(X.flatten(), y, cutoff)
  149. print("Average qEPSC below cutoff:", group_below_cutoff.mean())
  150. print("Average qEPSC above cutoff:", group_above_cutoff.mean())
  151. print("Mann-Whitney test p-value:", mw_p)
  152. print(f"Discontinuity estimate (τ): {tau:.4f}")
  153. print(f"T-statistic for discontinuity: {t_stat:.4f}")
  154. print(f"Permutation test p-value: {perm_p}")
  155. # Bar plot
  156. training_group = simpledialog.askstring("Input", "Enter the training group:")
  157. average_below_cutoff = group_below_cutoff.mean()
  158. average_above_cutoff = group_above_cutoff.mean()
  159. std_err_below_cutoff = group_below_cutoff.sem()
  160. std_err_above_cutoff = group_above_cutoff.sem()
  161. bar_color = color_map.get(training_group, 'gray')
  162. plt.figure(figsize=(8, 6))
  163. bars = plt.bar([0, 1],
  164. [average_below_cutoff, average_above_cutoff],
  165. color=[bar_color, bar_color], alpha=0.25,
  166. yerr=[std_err_below_cutoff, std_err_above_cutoff], capsize=5)
  167. for i, group in enumerate([group_below_cutoff, group_above_cutoff]):
  168. x = np.ones(len(group)) * i
  169. jitter = np.linspace(-0.15, 0.15, len(group))
  170. plt.scatter(x + jitter, group, color=bar_color, alpha=0.6)
  171. plt.xticks([0, 1], ['Layer 2', 'Layer 3'], fontsize=26)
  172. plt.ylabel("Amplitude (pA)", fontsize=26)
  173. plt.title('Comparison of Amplitude Below and Above Cutoff', fontsize=18)
  174. plt.text(0.5, max(average_below_cutoff, average_above_cutoff) + 7,
  175. f'MW p={mw_p:.4f} | τ={tau:.2f} pA | T={t_stat:.2f} | Perm p={perm_p:.4f}',
  176. ha='center', fontsize=16)
  177. plt.show()
  178. root = tk.Tk()
  179. root.title("Excel Columns Radiobuttons")
  180. frame_running = tk.Frame(root)
  181. frame_running.pack(side=tk.LEFT, padx=10, pady=10)
  182. label_running = tk.Label(frame_running, text="X (Running)")
  183. label_running.pack()
  184. frame_outcome = tk.Frame(root)
  185. frame_outcome.pack(side=tk.LEFT, padx=10, pady=10)
  186. label_outcome = tk.Label(frame_outcome, text="Y (Outcome)")
  187. label_outcome.pack()
  188. button_choose = tk.Button(root, text="Choose Excel File", command=choose_file)
  189. button_choose.pack()
  190. button_plot = tk.Button(root, text="Run RDT Analysis", command=run_rdt)
  191. button_plot.pack()
  192. root.mainloop()

RDD_Test_V6.py at commit 36cdd36, no license · at the source

Overview

  1. Department of Biological Sciences and Center for Neural Basis of Cognition, Carnegie Mellon University, 4400 Fifth Avenue, Pittsburgh, PA 15213, United States
  2. Unit on Functional Neural Circuits, Systems Neurodevelopment Laboratory, National Institute of Mental Health, National Institutes of Health, Bethesda, MD 20892, United States
Journal: Cerebral cortex (New York, N.Y. : 1991), volume 36, issue 6, article bhag047
Dates: received 7 January 2026; accepted 23 March 2026; published online 5 June 2026; in print June 2026
Type: Research article · Language: English
License: CC BY-NC
Identifiers: DOI 10.1093/cercor/bhag047 · PMID 42248694 · PMCID PMC13240849 · OpenAlex W7163667937
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: mouse (organism), cellular / molecular (subfield)
Methods: Statistics, Evoked potentials, Connectivity
Keywords: electrophysiology, excitatory synapses, high-throughput training, quantal analysis, superficial layers
MeSH: Association Learning*, Neuronal Plasticity*, Somatosensory Cortex*, Synapses*, Animals, Excitatory Postsynaptic Potentials, Female, Male, Mice, Mice, Inbred C57BL, Mice, Transgenic, Optogenetics, Pyramidal Cells, Reward, Vibrissae (* major topic)
Topic: Neural dynamics and brain function (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: NIH HHS (R01 NS123711, R21 NS127354)
Citations: not cited yet (Europe PMC); 97 references in the paper
Research resources: C57BL/6J mice RRID:IMSR_JAX:000664, Scnn1a-tg3-Cre mice RRID:IMSR_JAX:009613, Ai32 mice RRID:IMSR_JAX:024109, Nelf-Cre mice RRID:MMRRC_037424-UCD

Abstract

Learning broadly alters neocortical synapses, although the input and target specificity for this plasticity has not been well-defined. Feedforward synapses into sensory cortex have early critical periods for plasticity after which they are resistant to experience-dependent changes. Whether these synapses are altered during learning has not been investigated, particularly in a setting where animals must identify causal relationships between sensory stimuli and rewards. Here, we examined whether these feedforward synapses can be altered by training mice in a freely-moving and whisker-dependent association task. Pathway-specific optogenetic stimulation and analysis of quantal excitatory postsynaptic currents in layer 2/3 (L2/3) pyramidal neurons from barrel cortex revealed a rapid and transient potentiation of layer 4 (L4) inputs at the onset of training, without any change in thalamocortical inputs onto L4 neurons. In contrast, pseudotraining—where stimuli and rewards were decoupled—drove depression of L4–L2/3 quantal excitatory postsynaptic currents. Because environmental enrichment did not influence quantal excitatory postsynaptic current amplitude, these data suggest that reward-prediction accuracy is a key driver of feedforward plasticity in primary sensory cortex.

Significance statement: Although it is well accepted that sensory learning can alter cortical synapses, the pathways that are modified and the specific cues that drive this synaptic change have not been systematically investigated. By manipulating stimulus–reward probabilities, we identified discrete and opposite changes in the strength of L4–L2/3 synapses depending on the predictive accuracy of the stimulus. These data suggest that feedforward sensory circuits are exquisitely sensitive to the predictive value of sensory input in a goal-directed task.

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

Repositories

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

barthlab/Sensory-association-training-behavior

License: GPL-3.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 0321e55f8bb3a86c0fa4c20fd8622ea038c5a554, 12 October 2020
Languages: MATLAB (1)
Size: 14 files, 1 script
Software Heritage: not archived
Found in: the resources table
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
3 files

barthlab/RegressionDiscontinuityTree

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 36cdd36346d24f65dc334a4e39cb2a9079a154f9, 8 December 2025
Languages: Python (1)
Size: 2 files, 1 script
Software Heritage: not archived
Found in: the resources table
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Matplotlib (1 file), NumPy (1 file), pandas (1 file), scikit-learn (1 file), SciPy (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
2 files

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:

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

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, 3 authors, 5 keywords, 15 MeSH terms, 1 funder, 96 references, 4 RRIDs.

Cite

This paper

Christian, J. A., Park, E., & Barth, A. L. (2026). Association learning drives synaptic plasticity at feedforward synapses in somatosensory cortex. Cerebral cortex (New York, N.Y. : 1991), 36(6), bhag047. https://doi.org/10.1093/cercor/bhag047

BibTeX

@article{christian2026association,
author = {Christian, Joseph A and Park, Eunsol and Barth, Alison L},
title = {{Association learning drives synaptic plasticity at feedforward synapses in somatosensory cortex}},
journal = {Cerebral cortex (New York, N.Y. : 1991)},
year = {2026},
month = jun,
volume = {36},
number = {6},
pages = {bhag047},
publisher = {Oxford University Press},
issn = {1047-3211},
doi = {10.1093/cercor/bhag047},
url = {https://doi.org/10.1093/cercor/bhag047},
pmid = {42248694},
pmcid = {PMC13240849}
}

RIS

TY - JOUR
AU - Christian, Joseph A
AU - Park, Eunsol
AU - Barth, Alison L
TI - Association learning drives synaptic plasticity at feedforward synapses in somatosensory cortex
T2 - Cerebral cortex (New York, N.Y. : 1991)
J2 - Cereb Cortex
PY - 2026
DA - 2026/06/01
VL - 36
IS - 6
SP - bhag047
SN - 1047-3211
PB - Oxford University Press
DO - 10.1093/cercor/bhag047
UR - https://doi.org/10.1093/cercor/bhag047
LA - en
ER -

CSL-JSON

{
"id": "10.1093/cercor/bhag047",
"type": "article-journal",
"title": "Association learning drives synaptic plasticity at feedforward synapses in somatosensory cortex",
"container-title": "Cerebral cortex (New York, N.Y. : 1991)",
"author": [
{
"family": "Christian",
"given": "Joseph A"
},
{
"family": "Park",
"given": "Eunsol"
},
{
"family": "Barth",
"given": "Alison L"
}
],
"container-title-short": "Cereb Cortex",
"volume": "36",
"issue": "6",
"page": "bhag047",
"DOI": "10.1093/cercor/bhag047",
"PMID": "42248694",
"PMCID": "PMC13240849",
"ISSN": "1047-3211",
"publisher": "Oxford University Press",
"URL": "https://doi.org/10.1093/cercor/bhag047",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
1
]
]
}
}

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.1523/jneurosci.0987-25.2026 [code]
Cell-Type-Specific Synaptic Scaling Mechanisms Differentially Contribute to Associative Learning.
Journal: The Journal of neuroscience : the official journal of the Society for Neuroscience
In common: pandas, SciPy, Matplotlib, 1 other tool, cellular / molecular, 6 references
[2] doi:10.1371/journal.pbio.3003831 [code]
Disinhibitory signaling enables flexible coding of top-down information in cortical networks.
Journal: PLoS biology
In common: scikit-learn, pandas, SciPy, 2 other tools, mouse, 3 references
[3] doi:10.1126/sciadv.aef0343 [code]
Learning induces activation-mechanism-dependent neural plasticity in an intracortical microstimulation task.
Journal: Science advances
In common: scikit-learn, pandas, SciPy, 2 other tools, 3 references
[4] doi:10.1126/sciadv.aed4808 [code]
Perirhinal input to auditory cortex supports memory-guided sensory perception.
Journal: Science advances
In common: mouse, 5 references
[5] doi:10.1093/pnasnexus/pgag055 [code]
Comparative transcriptomics reveals differences in cortical cell type organization between metatherian and eutherian mammals.
Journal: PNAS nexus
In common: scikit-learn, pandas, SciPy, 2 other tools, mouse, cellular / molecular, 2 references
[6] doi:10.1523/jneurosci.1506-25.2026 [code]
Controlling Spatio-Temporal Sequences of Neural Activity by Local Synaptic Changes.
Journal: The Journal of neuroscience : the official journal of the Society for Neuroscience
In common: scikit-learn, pandas, SciPy, 2 other tools, cellular / molecular, 2 references
[7] doi: [code]
Real-time closed-loop feedback system for mouse mesoscale cortical signal and movement control
Journal: eLife
In common: scikit-learn, pandas, SciPy, 2 other tools, mouse, 2 references
[8] doi:10.1371/journal.pcbi.1014164 [code]
'Backpropagation and the brain' realized in cortical error neuron microcircuits.
Journal: PLoS computational biology
In common: SciPy, Matplotlib, NumPy, 3 references
[9] doi:10.1038/s42003-026-10418-2 [code]
Cortical PV and VIP interneurons similarly influence SST neuron output despite distinct unitary properties.
Journal: Communications biology
In common: mouse, cellular / molecular, 4 references
[10] doi:10.1038/s41467-026-74460-8 [code]
Spike-based alignment learning solves the weight transport problem.
Journal: Nature communications
In common: scikit-learn, pandas, SciPy, 2 other tools, 2 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.

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.