OSCR

Microstructural spine alterations increase neuronal excitability in focal cortical dysplasia Type I.

Code ↔ Paper

3 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 3 matches
  1. [1] § Methods › Statistics ↔ figures.py, lines 476–547 · score 0.68 · exponential fits, somatic EPSP amplitude, apical dendritic, distance, Curves, basal
  2. [2] § Methods › Statistics ↔ controller.py, lines 160–224 · score 0.66 · somatic EPSP amplitude, single spine, spine density, fits, distance, Violin
  3. [3] § Methods › Common model backbone ↔ sseEPSP.py, lines 9–82 · score 0.50 · basal dendrites, apical dendrites, distances, somatic, active, epileptogenic

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 · 552 lines · 22 KB · CC-BY-NC-4.0 · 1 match

  1. from matplotlib import pyplot as plt
  2. import numpy as np
  3. from scipy.signal import savgol_filter
  4. # line plot for firing probability when activate multiple spines
  5. def line_firingprobability(data, save=False, xpeak=[40, 175]) :
  6. x_ctl_nspines = data['ctl_actspines']
  7. y_ctl_prob = data['ctl_prob']
  8. y_ctl_stdev = data['ctl_stdev']
  9. x_fcd_nspines = data['fcd_actspines']
  10. y_fcd_prob = data['fcd_prob']
  11. y_fcd_stdev = data['fcd_stdev']
  12. fig, (ax_fcd, ax_ctl) = plt.subplots(1, 2, sharey=True)
  13. fig.subplots_adjust(wspace=0.05) # adjust space between Axes
  14. filter_win = 5
  15. y_ctl_prob = savgol_filter(y_ctl_prob, window_length=filter_win, polyorder=2)
  16. y_fcd_prob = savgol_filter(y_fcd_prob, window_length=filter_win, polyorder=2)
  17. y_ctl_stdev = savgol_filter(y_ctl_stdev, window_length=filter_win, polyorder=2)
  18. y_fcd_stdev = savgol_filter(y_fcd_stdev, window_length=filter_win, polyorder=2)
  19. ax_ctl.fill_between(x_ctl_nspines, np.clip(y_ctl_prob-y_ctl_stdev, 0, None), np.clip(y_ctl_prob+y_ctl_stdev, None, 1), color='cyan', alpha=.55, linewidth=1)
  20. ax_ctl.plot(x_ctl_nspines, y_ctl_prob, linewidth=2, color='darkcyan', label="Baseline")
  21. ax_fcd.plot(x_ctl_nspines, y_ctl_prob, linewidth=2, color='darkcyan', label="Baseline")
  22. ax_fcd.fill_between(x_fcd_nspines, np.clip(y_fcd_prob-y_fcd_stdev, 0, None), np.clip(y_fcd_prob+y_fcd_stdev, None, 1), color='magenta', alpha=.55, linewidth=1)
  23. ax_fcd.plot(x_fcd_nspines, y_fcd_prob, linewidth=2, color='darkmagenta', label="Altered")
  24. ax_ctl.plot(x_fcd_nspines, y_fcd_prob, linewidth=2, color='darkmagenta', label="Altered") #just for the legend
  25. # xpeak = [40,175]
  26. ax_fcd.set_xlim(xpeak[0]-10, xpeak[0]+10)
  27. ax_ctl.set_xlim(xpeak[1]-10, xpeak[1]+10)
  28. ax_fcd.set_ylim(0, 1)
  29. ax_ctl.set_ylim(0, 1)
  30. ax_fcd.spines.right.set_visible(False)
  31. ax_ctl.spines.left.set_visible(False)
  32. ax_fcd.yaxis.tick_left()
  33. ax_ctl.yaxis.tick_right()
  34. ax_fcd.set_xticks([xpeak[0]-5, xpeak[0]+5], labels=[str(xpeak[0]-5), str(xpeak[0]+5)], fontsize=12)
  35. ax_ctl.set_xticks([xpeak[1]-5, xpeak[1]+5], labels=[str(xpeak[1]-5), str(xpeak[1]+5)], fontsize=12)
  36. ax_fcd.set_yticks([0, 1.0], labels=["0.0", "1.0"], fontsize=12)
  37. d = .2 # proportion of vertical to horizontal extent of the slanted line
  38. kwargs = dict(marker=[(-d, -1), (d, 1)], markersize=10,
  39. linestyle="none", color='k', mec='k', mew=1, clip_on=False)
  40. ax_fcd.plot([1, 1], [0, 1], transform=ax_fcd.transAxes, **kwargs)
  41. ax_ctl.plot([0, 0], [0, 1], transform=ax_ctl.transAxes, **kwargs)
  42. ax_fcd.set_ylabel("Firing Probability", fontsize=14)
  43. ax_fcd.set_xlabel('Number of Activated Spines', fontsize=14)
  44. ax_fcd.xaxis.set_label_coords(0.5, 0.05, transform=fig.transFigure)
  45. if save :
  46. plt.savefig(f"syn_activation.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
  47. plt.show()
  48. # line plot for io rate curve
  49. def line_io_curve(stats_df, save=False) :
  50. plt.figure()
  51. # Control
  52. plt.plot(stats_df['input_rate'], stats_df['avg_ctl'], label='Baseline', color='darkcyan')
  53. plt.fill_between(stats_df['input_rate'], stats_df['min_ctl'], stats_df['max_ctl'], color='cyan', alpha=.55, linewidth=1)
  54. # FCD
  55. plt.plot(stats_df['input_rate'], stats_df['avg_fcd'], label='Altered', color='darkmagenta')
  56. plt.fill_between(stats_df['input_rate'], stats_df['min_fcd'], stats_df['max_fcd'], color='magenta', alpha=.55, linewidth=1)
  57. plt.ylabel("Firing Rate (Hz)", fontsize=14)
  58. plt.ylim((0, 110))
  59. plt.xlim((0.2,5))
  60. plt.yticks(ticks=[0, 50, 100], labels=["0", "50", "100"], fontsize=12)
  61. plt.xlabel("Input Frequency (Hz)", fontsize=14)
  62. plt.xticks(ticks=[0.2, 1.0, 2.0, 3.0, 4.0, 5.0], labels=["0.2", "1.0", "2.0", "3.0", "4.0", "5.0"], fontsize=12)
  63. plt.tick_params(
  64. axis='x', # changes apply to the x-axis
  65. which='both', # both major and minor ticks are affected
  66. bottom=True, # ticks along the bottom edge are off
  67. top=False)#, # ticks along the top edge are off
  68. if save :
  69. plt.savefig(f"io_curve.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
  70. plt.show()
  71. # line plot about deltaV(head-base) when neck diameter changed
  72. def line_neckdiam_vs_deltaV(data, ra, save=False, show=True, legend=False) :
  73. import matplotlib.cm as cm
  74. from matplotlib.colors import Normalize
  75. from mpl_toolkits.axes_grid1.inset_locator import inset_axes
  76. # neck_range_min = data['range'][0]
  77. # neck_range_max = data['range'][1]
  78. neck_diameter = data['neck_diameter']
  79. deltaV_min = data['deltaV_min']
  80. deltaV_max = data['deltaV_max']
  81. fig, ax = plt.subplots()
  82. # plt.fill_between(neck_diameter, deltaV_min, deltaV_max, color="lightgrey", alpha=0.9)
  83. cmap = cm.Reds
  84. # norm = Normalize(vmin=min(ra), vmax=max(ra))
  85. norm = Normalize(vmin=0, vmax=max(ra))
  86. for i in range(len(neck_diameter) - 1):
  87. res_val = (ra[i] + ra[i+1]) / 2
  88. color = cmap(norm(res_val))
  89. ax.fill_between(neck_diameter[i:i+2], deltaV_min[i:i+2], deltaV_max[i:i+2], color=color, edgecolor=None)
  90. plt.xlabel("Spine Neck Diameter (µm)", fontsize=14)
  91. plt.ylabel('ΔV (Head - Base, mV)', fontsize=14)
  92. plt.ylim((0, max(deltaV_max)))
  93. plt.xlim((0.1, 0.5))
  94. plt.yticks(ticks=[0, 5], labels=["0", "5"], fontsize=12)
  95. plt.xticks(ticks=[0.1, 0.2, 0.3, 0.4, 0.5], labels=["0.1", "0.2", "0.3", "0.4", "0.5"], fontsize=12)
  96. plt.axvline(x = 0.15, ymin = 0, ymax = deltaV_max[neck_diameter.index(0.15)]/max(deltaV_max), color = 'cyan', label = 'Baseline', linestyle='-')
  97. plt.axvline(x = 0.3, ymin = 0, ymax = deltaV_max[neck_diameter.index(0.3)]/max(deltaV_max), color = 'magenta', label = 'Altered', linestyle='-')
  98. plt.scatter(0.3, deltaV_max[neck_diameter.index(0.3)], s=20, c='magenta', marker='X')
  99. plt.scatter(0.15, deltaV_max[neck_diameter.index(0.15)], s=20, c='cyan', marker='X')
  100. if legend :
  101. plt.text(0.3, deltaV_max[neck_diameter.index(0.3)], 'Altered', fontdict={'size': 9, 'color': 'magenta'})
  102. plt.text(0.15, deltaV_max[neck_diameter.index(0.15)], 'Baseline', fontdict={'size': 9, 'color': 'cyan'})
  103. # Force all spines on
  104. for spine in ax.spines.values():
  105. spine.set_visible(True)
  106. spine.set_color('black')
  107. ax_ins = inset_axes(ax, width="5%", height="40%", loc='upper right', borderpad=2)
  108. sm = cm.ScalarMappable(cmap=cmap, norm=norm)
  109. sm.set_array([])
  110. cbar = fig.colorbar(sm, cax=ax_ins)
  111. cbar.set_label('Neck Resistance (MΩ)')
  112. # cbar.ax.yaxis.set_label_position('left')
  113. cbar.ax.yaxis.set_ticks_position('left')
  114. cbar.ax.tick_params(labelsize=8)
  115. cbar.set_ticks([0, 330])
  116. if save :
  117. plt.savefig(f"neckdiam_deltaV.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
  118. if show :
  119. plt.show()
  120. # line plot about multipoints EPSP amplitude (head, base, soma) when head diameter(fixed neck length) changed
  121. def line_headdiam_vs_amplitude_multipoints(data, save=False) :
  122. # head_diam_range_min = data['range'][0]
  123. # head_diam_range_max = data['range'][1]
  124. #x axis
  125. head_diameters = data['head_diameter']
  126. #averaged values
  127. head_ = data['head']
  128. base_ = data['base']
  129. soma_ = data['soma']
  130. #min and max for shading
  131. head_min = data['head_min']
  132. base_min = data['base_min']
  133. soma_min = data['soma_min']
  134. head_max = data['head_max']
  135. base_max = data['base_max']
  136. soma_max = data['soma_max']
  137. #plot 그리기
  138. fig, (ax_spine, ax_soma) = plt.subplots(2, 1, sharex=True, gridspec_kw={'height_ratios': [0.7, 0.3]})
  139. fig.subplots_adjust(hspace=0.05) # adjust space between Axes
  140. ax_spine.plot(head_diameters, head_, color="red",label="Head")
  141. ax_spine.plot(head_diameters, base_, color="blue", label="Base")
  142. ax_spine.plot(head_diameters, soma_, color="black", label="Soma")
  143. ax_soma.plot(head_diameters, head_, color="red",label="Head")
  144. ax_soma.plot(head_diameters, base_, color="blue", label="Base")
  145. ax_soma.plot(head_diameters, soma_, color="black", label="Soma")
  146. ax_spine.fill_between(head_diameters, head_min, head_max, color="red", alpha=0.3)
  147. ax_spine.fill_between(head_diameters, base_min, base_max, color="blue", alpha=0.3)
  148. ax_spine.fill_between(head_diameters, soma_min, soma_max, color="black", alpha=0.3)
  149. ax_soma.fill_between(head_diameters, head_min, head_max, color="red", alpha=0.3)
  150. ax_soma.fill_between(head_diameters, base_min, base_max, color="blue", alpha=0.3)
  151. ax_soma.fill_between(head_diameters, soma_min, soma_max, color="black", alpha=0.3)
  152. ax_spine.spines.bottom.set_visible(False)
  153. ax_soma.xaxis.tick_bottom()
  154. ax_soma.spines.top.set_visible(False)
  155. ax_spine.set_xticks(ticks=[])
  156. ax_spine.set_yticks(ticks=[3,5,7], labels=["3", "5", "7"])
  157. ax_spine.set_ylim([0.5,9])
  158. ax_soma.set_xticks(ticks=[0.2, 0.5, 1.0, 1.5], labels=["0.2", "0.5", "1.0", "1.5"], fontsize=12)
  159. ax_soma.set_yticks(ticks=[0, 0.4], labels=["0", "0.4"], fontsize=12)
  160. ax_soma.set_ylim([0, 0.5])
  161. ax_spine.axvline(x = 0.55, ymin = 0, ymax = 1, color = 'cyan', linestyle='-')
  162. ax_spine.axvline(x = 0.70, ymin = 0, ymax = 1, color = 'magenta',linestyle='-')
  163. ax_soma.axvline(x = 0.55, ymin = 0, ymax = 1, color = 'cyan', linestyle='-')
  164. ax_soma.axvline(x = 0.70, ymin = 0, ymax = 1, color = 'magenta', linestyle='-')
  165. d = .5 # proportion of vertical to horizontal extent of the slanted line
  166. kwargs = dict(marker=[(-d, -1), (d, 1)], markersize=10,
  167. linestyle="none", color='k', mec='k', mew=1, clip_on=False)
  168. ax_spine.plot([0, 1], [0, 0], transform=ax_spine.transAxes, **kwargs)
  169. ax_soma.plot([0, 1], [1, 1], transform=ax_soma.transAxes, **kwargs)
  170. ax_soma.set_xlabel("Spine Head Diameter (µm)", fontsize=14)
  171. ax_spine.legend(loc="upper center", ncol=3, fontsize=12)
  172. fig.text(0.04, 0.5, 'EPSP Amplitude (mV)', va='center', rotation='vertical', fontsize=14)
  173. if save :
  174. plt.savefig(f"head_diam_amplitude.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
  175. plt.show()
  176. # violin plot for head, base, soma EPSP amplitude between groups
  177. def violin_singlespine_EPSPamp_multipoints_between_groups(control_data, altered_data, alter_what, N=100, save=False, show=True, legend=False) :
  178. amp_head_ctl = control_data['head']
  179. amp_base_ctl = control_data['base']
  180. amp_soma_ctl = control_data['soma']
  181. amp_head_fcd = altered_data['head']
  182. amp_base_fcd = altered_data['base']
  183. amp_soma_fcd = altered_data['soma']
  184. #plot 그리기
  185. fig, ax = plt.subplots(figsize=(4,4))
  186. # #Head, Base, Soma position base
  187. box_colors = ["cyan", "magenta", "cyan", "magenta", "cyan", "magenta"]
  188. bplot1 = ax.violinplot([amp_head_ctl, amp_head_fcd],
  189. positions=[1,2], widths=0.7, showmedians=True)
  190. bplot3 = ax.violinplot([amp_base_ctl, amp_base_fcd],
  191. positions=[3,4], widths=0.7, showmedians=True)
  192. bplot1['cmaxes'].set_color("black")
  193. bplot1['cmins'].set_color("black")
  194. bplot1['cmedians'].set_color('black')
  195. bplot3['cmaxes'].set_color("black")
  196. bplot3['cmins'].set_color("black")
  197. bplot3['cmedians'].set_color('black')
  198. ax.vlines(1, min(amp_head_ctl), max(amp_head_ctl), color="black", linestyle='-', lw=1.5)
  199. ax.vlines(2, min(amp_head_fcd), max(amp_head_fcd), color="black", linestyle='-', lw=1.5)
  200. ax.vlines(3, min(amp_base_ctl), max(amp_base_ctl), color="black", linestyle='-', lw=1.5)
  201. ax.vlines(4, min(amp_base_fcd), max(amp_base_fcd), color="black", linestyle='-', lw=1.5)
  202. for pc, color in zip(bplot1['bodies'], box_colors[0:2]):
  203. pc.set_facecolor(color)
  204. pc.set_edgecolor(color)
  205. pc.set_alpha(0.5)
  206. for pc, color in zip(bplot3['bodies'], box_colors[2:4]):
  207. pc.set_facecolor(color)
  208. pc.set_edgecolor(color)
  209. pc.set_alpha(0.5)
  210. if legend :
  211. plt.legend(["Baseline","Altered"], loc="lower left")
  212. ax.set_xticks([1.5, 3.5])
  213. ax.set_xticklabels(["Head", "Base"], fontsize=12)
  214. ax.tick_params(
  215. axis='x', # changes apply to the x-axis
  216. which='both', # both major and minor ticks are affected
  217. bottom=False, # ticks along the bottom edge are off
  218. top=False)
  219. ax.set_ylabel('EPSP Amplitude (mV)', fontsize=14)
  220. ax.set_yticks(ticks=[0, 2, 4, 6, 8, 10], labels=["0", "2", "4", "6", "8", "10"], fontsize=12)
  221. ax.set_ylim([0, 10.5])
  222. #for bigger receptor weights
  223. # ax.set_yticks(ticks=[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20], labels=["0", "2", "4", "6", "8", "10", "12", "14", "16", "18", "20"], fontsize=12)
  224. # ax.set_ylim([0, 20])
  225. # if alter == "density" :
  226. # ax.set_ylim([0, 10.5])
  227. ax.set_title('Spine', fontsize=14)
  228. # Force all spines on
  229. for spine in ax.spines.values():
  230. spine.set_visible(True)
  231. spine.set_color('black')
  232. if save :
  233. plt.savefig(f"violin_{alter_what}_ampl_spine.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
  234. if show :
  235. plt.show()
  236. fig, ax2 = plt.subplots(figsize=(2,4))
  237. bplot2 = ax2.violinplot([amp_soma_ctl, amp_soma_fcd], positions=[5,6], widths=0.7, showmedians=True)
  238. bplot2['cmaxes'].set_color("black")
  239. bplot2['cmins'].set_color("black")
  240. bplot2['cmedians'].set_color('black')
  241. ax2.vlines(5, min(amp_soma_ctl), max(amp_soma_ctl), color="black", linestyle='-', lw=1.5)
  242. ax2.vlines(6, min(amp_soma_fcd), max(amp_soma_fcd), color="black", linestyle='-', lw=1.5)
  243. for pc, color in zip(bplot2['bodies'], box_colors[4:6]):
  244. pc.set_facecolor(color)
  245. pc.set_edgecolor(color)
  246. pc.set_alpha(0.5)
  247. ax2.set_yticks(ticks=[0, 0.2, 0.4], labels=["0", "0.2", "0.4"], fontsize=12)
  248. ax2.set_xticks([])
  249. ax2.set_ylim([0, 0.45])
  250. #for bigger receptor weights
  251. # ax2.set_yticks(ticks=[0, 0.2, 0.4, 0.6, 0.8, 1.0], labels=["0", "0.2", "0.4", "0.6", "0.8", "1.0"], fontsize=12)
  252. # ax2.set_ylim([0, 1])
  253. ax2.tick_params(top=True, labeltop=True, bottom=False, labelbottom=False)
  254. ax2.set_title('Soma', fontsize=14)
  255. # Set the y-axis label position to the right
  256. ax2.yaxis.set_label_position("right")
  257. ax2.yaxis.tick_right()
  258. # Force all spines on
  259. for spine in ax2.spines.values():
  260. spine.set_visible(True)
  261. spine.set_color('black')
  262. if save :
  263. plt.savefig(f"violin_{alter_what}_ampl_soma.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
  264. if show :
  265. plt.show()
  266. #line plot with scatter overlay for input resistance when differing spine factor
  267. # spine density vs input resistance
  268. def line_density_vs_RI(data, save=False, show=True, legend=False) :
  269. x = data['x_sf']
  270. y = data['y_ri']
  271. fig, ax = plt.subplots()
  272. plt.plot(x, y, color="black", linewidth=2.5)
  273. plt.ylim((70, 190))
  274. # Set the y-axis label position to the right
  275. ax.yaxis.set_label_position("right")
  276. # Move the y-axis ticks and tick labels to the right
  277. ax.yaxis.tick_right()
  278. ax.tick_params(
  279. axis='y', # changes apply to the y-axis
  280. which='both', # both major and minor ticks are affected
  281. left=False, # ticks along the bottom edge are off
  282. right=True)
  283. plt.yticks(ticks=[90, 130, 170], labels=["90", "130", "170"], fontsize=12)
  284. plt.xticks(ticks=[x[0], x[-1]], labels=["Sparse", "Dense"], fontsize=12)
  285. plt.tick_params(
  286. axis='x', # changes apply to the x-axis
  287. which='both', # both major and minor ticks are affected
  288. bottom=True, # ticks along the bottom edge are off
  289. top=False)#), # ticks along the top edge are off
  290. # Force all spines on
  291. for spine in ax.spines.values():
  292. spine.set_visible(True)
  293. spine.set_color('black')
  294. #flip X axis
  295. plt.gca().invert_xaxis()
  296. plt.scatter(1.2, y[x.index(1.20)], s=120, c='magenta', marker='X')
  297. plt.scatter(2.0, y[x.index(2.00)], s=120, c='cyan', marker='X')
  298. if legend :
  299. plt.text(2.0, y[x.index(2.00)], 'Baseline', fontdict={'size': 9, 'color': 'cyan'})
  300. plt.text(1.2, y[x.index(1.20)], 'Altered', fontdict={'size': 9, 'color': 'magenta'})
  301. plt.xlabel("Spine Density", fontsize=14)
  302. plt.ylabel("Input Resistance (MΩ)", fontsize=14)
  303. if save:
  304. plt.savefig("density_RI.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
  305. if show :
  306. plt.show()
  307. #boxplot for input resistance when differing nbasal
  308. def box_nbasal_vs_ri(data, save=False):
  309. y_ctl = data["ri_ctl"]
  310. y_fcd = data["ri_fcd"]
  311. fig, ax = plt.subplots(figsize=(2,2))
  312. # draw boxplot
  313. bplot = ax.boxplot([y_ctl, y_fcd], widths=0.4,
  314. patch_artist=True,
  315. showfliers=False,
  316. boxprops=dict(facecolor='none', edgecolor='none'),
  317. whiskerprops=dict(color='none'),
  318. capprops=dict(color='none'),
  319. medianprops=dict(color='black', linewidth=2.5))
  320. # medianprops=dict(color="black", linewidth=2),
  321. # patch_artist=True, showfliers=False)
  322. # jitter for every data point to avoid overlap
  323. for i, data in enumerate([y_ctl]):
  324. x = np.random.normal(i + 1, 0.04, size=len(data))
  325. ax.plot(x, data, 'o', color='darkcyan', markersize=3, alpha=0.9)
  326. for i, data in enumerate([y_fcd]):
  327. x = np.random.normal(i + 2, 0.04, size=len(data))
  328. ax.plot(x, data, 'o', color='darkmagenta', markersize=3, alpha=0.9)
  329. ax.set_xticks([1, 2])
  330. # bplot = ax.boxplot([y_ctl, y_fcd], widths=0.5, medianprops=dict(color="black"), patch_artist=True) # will be used to label x-ticks
  331. # fill with colors
  332. for patch, color in zip(bplot['boxes'], ["cyan", "magenta"]):
  333. patch.set_facecolor(color)
  334. patch.set_alpha(0.7)
  335. plt.ylim((80, 170))
  336. ax.set_yticks(ticks=[100, 130, 160], labels=["100", "140", "160"], fontsize=12)
  337. plt.xticks([])
  338. if save :
  339. plt.savefig(f"ri_box.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
  340. plt.show()
  341. def meansem_nbasal_vs_ri(data, save=False) :
  342. from scipy import stats
  343. y_ctl = data["ri_ctl"]
  344. y_fcd = data["ri_fcd"]
  345. data_groups = [y_ctl, y_fcd]
  346. group_colors = ['cyan', 'magenta']
  347. line_colors = ['darkcyan', 'darkmagenta']
  348. x_pos = [1, 2]
  349. fig, ax = plt.subplots(figsize=(2,2))
  350. for i, (data, color, lcolor) in enumerate(zip(data_groups, group_colors, line_colors)):
  351. mean = np.mean(data)
  352. sem = stats.sem(data)
  353. # print(f"Group {i+1} - Mean: {mean:.2f}, SEM: {sem:.2f}")
  354. x_jitter = np.random.normal(x_pos[i], 0.04, size=len(data))
  355. ax.scatter(x_jitter, data, color=color, s=5, alpha=0.9, zorder=1)
  356. ax.hlines(mean, x_pos[i]-0.2, x_pos[i]+0.2, colors=lcolor, lw=1.5, zorder=3)
  357. ax.errorbar(x_pos[i], mean, yerr=sem, fmt='none', ecolor=lcolor,
  358. elinewidth=2, capsize=10, zorder=2)
  359. ax.set_xticks(x_pos)
  360. ax.spines['top'].set_visible(False)
  361. ax.spines['right'].set_visible(False)
  362. plt.ylim((70, 160))
  363. ax.set_yticks(ticks=[90, 120, 150], labels=["90", "120", "150"], fontsize=12)
  364. plt.xticks([])
  365. if save :
  366. plt.savefig(f"ri_box.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
  367. plt.show()
  368. # distance from soma vs somatic amplitude
  369. # scatter plot and fitting line
  370. # does not include dendrite information
  371. # should adjust nseg of the SF dendrite by dend_nseglevel
  372. # upper line from basal dendrite, lower line from apical dendrite
  373. def scatter_distance_from_soma_vs_somatic_amplitude(data, fit_params, save=False):
  374. import numpy as np
  375. from scipy.optimize import curve_fit
  376. #unpakcing
  377. dist_spine_ctl = data['dst_ctl']
  378. dist_spine_fcd = data['dst_fcd']
  379. amplitude_ctl = data['amp_ctl']
  380. amplitude_fcd = data['amp_fcd']
  381. a = fit_params['a']
  382. b = fit_params['b']
  383. c = fit_params['c']
  384. a_ = fit_params['a_']
  385. b_ = fit_params['b_']
  386. c_ = fit_params['c_']
  387. fig, ax = plt.subplots()
  388. plt.scatter(dist_spine_ctl, amplitude_ctl, marker="o", s=20, color="cyan", alpha=0.7, label="Baseline")
  389. plt.scatter(dist_spine_fcd, amplitude_fcd, marker="o", s=20, color="magenta", alpha=0.7, label="Altered")
  390. ## exponential fitting
  391. # Define the exponential function
  392. def exp_func(x, a, b, c):
  393. return a * np.exp(b * x) +c
  394. # Fit the curve
  395. params, covar_ = curve_fit(exp_func, dist_spine_ctl, amplitude_ctl, p0=[a, b, c])
  396. fit_a, fit_b, fit_c = params
  397. x_fit = np.linspace(min(dist_spine_ctl), max(dist_spine_ctl), 1000) # for a smooth curve
  398. y_fit = exp_func(x_fit, fit_a, fit_b, fit_c)
  399. plt.plot(x_fit, y_fit, color='darkcyan')
  400. print(f'Baseline: y={fit_a:.4f}e^({fit_b:.5f}x)+{fit_c:.4f}')
  401. # Fit the curve
  402. params_, covar_ = curve_fit(exp_func, dist_spine_fcd, amplitude_fcd, p0=[a_, b_, c_])
  403. fit_a_fcd, fit_b_fcd, fit_c_fcd = params_
  404. y_fit_ = exp_func(x_fit, fit_a_fcd, fit_b_fcd, fit_c_fcd)
  405. plt.plot(x_fit, y_fit_, color='darkmagenta')
  406. print(f'Altered: y={fit_a_fcd:.4f}e^({fit_b_fcd:.5f}x)+{fit_c_fcd:.4f}')
  407. plt.xlabel("Spine Location Relative to Soma (µm)", fontsize=14)
  408. plt.ylabel("Somatic EPSP Amplitude (mV)", fontsize=14)
  409. plt.xlim((30, 390))
  410. plt.ylim((0.08, 0.44))
  411. ax.set_xticks(ticks=[100, 200, 300], labels=["100", "200", "300"], fontsize=12)
  412. ax.set_yticks(ticks=[0.1, 0.2, 0.3, 0.4], labels=["0.1", "0.2", "0.3", "0.4"], fontsize=12)
  413. plt.tick_params(
  414. axis='y', # changes apply to the y-axis
  415. which='both', # both major and minor ticks are affected
  416. right=False)
  417. # if legend :
  418. # plt.legend(loc="upper right")
  419. # Force all spines on
  420. for spine in ax.spines.values():
  421. spine.set_visible(True)
  422. spine.set_color('black')
  423. if save :
  424. plt.savefig(f"distance_vs_soma_amp.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
  425. plt.show()
  426. if __name__ == "__main__" :
  427. pass

figures.py at commit 0d2cd0b, under CC-BY-NC-4.0 · at the source

Overview

Authors: Jawon Gim1, Na-Young Seo1, Gyu Hyun Kim1, Kea Joo Lee1, Joon Ho Choi2
ORCID iDs: Na-Young Seo
  1. Neural Circuits Research Group, Korea Brain Research Institute (KBRI), Daegu, Republic of Korea
  2. Sensory and Motor System Research Group, Korea Brain Research Institute (KBRI), Daegu, Republic of Korea
Institutions: Korea Brain Research Institute (South Korea)
Journal: Frontiers in computational neuroscience, volume 20, article 1862383
Dates: received 22 April 2026; accepted 30 July 2026; published online 26 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.3389/fncom.2026.1862383 · PMID 42718645 · PMCID PMC13553748 · OpenAlex W7204233965
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: histology / microscopy (modality), epilepsy (population)
Methods: Connectivity, Statistics, Preprocessing, Single-unit activity, calcium imaging
Keywords: computational modeling, dendritic spine, epilepsy, NEURON, volume electron microscopy
Topic: Neuroscience and Neuropharmacology Research (Cellular and Molecular Neuroscience, Neuroscience), according to OpenAlex
Funding: Korea Brain Research Institute (26-BR-01-01, BR-01-03, 26-BR-01-03); Ministry of Science and ICT, South Korea
Citations: not cited yet (Europe PMC); 37 references in the paper

Abstract

Introduction: Focal cortical dysplasia (FCD) is a leading cause of drug-resistant epilepsy and has predominantly been associated with impaired inhibitory signaling. However, recent ultrastructural studies have identified morphological alterations in excitatory synapses, suggesting that structural changes in excitatory connectivity may also contribute to cortical hyperexcitability.

Methods: We used biophysically grounded computational models of human cortical pyramidal neurons to investigate how disease-associated alterations in dendritic spine architecture affect neuronal excitability. Spine density and spine geometry were independently manipulated based on quantitative volume electron microscopy measurements, allowing us to distinguish the contributions of individual structural features of excitatory synapses.

Results: Reduced spine density and altered spine neck geometry increased neuronal excitability through complementary mechanisms, whereas variations in spine head size had comparatively minor effects. These structural alterations differentially influenced synaptic signal propagation and spike initiation. Their combined effects substantially increased neuronal output, particularly under conditions of sparse synaptic input.

Discussion: These findings identify excitatory synaptic microstructure as an independent and mechanistically distinct contributor to hyperexcitability in FCD Type I. By linking ultrastructural abnormalities to altered neuronal input–output function, this study supports a potential contribution of excitatory synaptic alterations to the pathophysiology of FCD.

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 3 matches between paragraphs and lines of code.

jawonGim/Simulation_SpineAlterationFocalCorticalDysplasia

License: CC-BY-NC-4.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 0d2cd0b63f0cc3e4432c56be518c7ddf7bee76ec, 16 April 2026
Languages: Python (12), NEURON (4)
Size: 20 files, 16 scripts
Software Heritage: not archived
Found in: “Data availability statement”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NEURON (15 files), NumPy (9 files), Matplotlib (6 files), pandas (1 file), SciPy (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
19 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;
  • 16 scripts, each with its path and the digest of its content;
  • 3 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 availability statement

All custom codes used for simulations, data analysis, and figure generation are available here: https://github.com/jawonGim/Simulation_SpineAlterationFocalCorticalDysplasia.git.

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

  • Funding: added Korea Brain Research Institute: 26-BR-01-01, BR-01-03, 26-BR-01-03; Ministry of Science and ICT, South Korea

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, pages, dates, 5 authors, 5 keywords, 35 references.

Cite

This paper

Gim, J., Seo, N.-Y., Kim, G. H., Lee, K. J., & Choi, J. H. (2026). Microstructural spine alterations increase neuronal excitability in focal cortical dysplasia Type I. Frontiers in computational neuroscience, 20, 1862383. https://doi.org/10.3389/fncom.2026.1862383

BibTeX

@article{gim2026microstructural,
author = {Gim, Jawon and Seo, Na-Young and Kim, Gyu Hyun and Lee, Kea Joo and Choi, Joon Ho},
title = {{Microstructural spine alterations increase neuronal excitability in focal cortical dysplasia Type I}},
journal = {Frontiers in computational neuroscience},
year = {2026},
month = aug,
volume = {20},
pages = {1862383},
publisher = {Frontiers Media SA},
issn = {1662-5188},
doi = {10.3389/fncom.2026.1862383},
url = {https://doi.org/10.3389/fncom.2026.1862383},
pmid = {42718645},
pmcid = {PMC13553748}
}

RIS

TY - JOUR
AU - Gim, Jawon
AU - Seo, Na-Young
AU - Kim, Gyu Hyun
AU - Lee, Kea Joo
AU - Choi, Joon Ho
TI - Microstructural spine alterations increase neuronal excitability in focal cortical dysplasia Type I
T2 - Frontiers in computational neuroscience
J2 - Front Comput Neurosci
PY - 2026
DA - 2026/08/26
VL - 20
SP - 1862383
SN - 1662-5188
PB - Frontiers Media SA
DO - 10.3389/fncom.2026.1862383
UR - https://doi.org/10.3389/fncom.2026.1862383
LA - en
ER -

CSL-JSON

{
"id": "10.3389/fncom.2026.1862383",
"type": "article-journal",
"title": "Microstructural spine alterations increase neuronal excitability in focal cortical dysplasia Type I",
"container-title": "Frontiers in computational neuroscience",
"author": [
{
"family": "Gim",
"given": "Jawon"
},
{
"family": "Seo",
"given": "Na-Young"
},
{
"family": "Kim",
"given": "Gyu Hyun"
},
{
"family": "Lee",
"given": "Kea Joo"
},
{
"family": "Choi",
"given": "Joon Ho"
}
],
"container-title-short": "Front Comput Neurosci",
"volume": "20",
"page": "1862383",
"DOI": "10.3389/fncom.2026.1862383",
"PMID": "42718645",
"PMCID": "PMC13553748",
"ISSN": "1662-5188",
"publisher": "Frontiers Media SA",
"URL": "https://doi.org/10.3389/fncom.2026.1862383",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
26
]
]
}
}

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.1073/pnas.2533168123 [code]
Dendritic morphology and synaptic nonlinearities enhance functional complexity in human cortical neurons.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: NEURON, pandas, SciPy, 2 other tools, 5 references
[2] doi:10.1126/sciadv.aec4911 [code]
Dendritic shaft constrictions shape synaptic integration in neurons.
Journal: Science advances
In common: NEURON, pandas, SciPy, 2 other tools, 2 references
[3] doi:10.1016/j.celrep.2026.117793 [code]
Clustered inputs engage dendritic nonlinearities and calcium signaling to support efficient place-field formation in CA1 pyramidal neurons.
Journal: Cell reports
In common: NEURON, pandas, SciPy, 2 other tools, 2 references
[4] doi:10.3390/ijms27146326
Increased Cannabinoid Receptor 1-Immunopositive Perisomatic Input of Principal Cells in Human Epileptic Patients in Focal Cortical Dysplasia Type IIB.
Journal: International journal of molecular sciences
In common: epilepsy, histology / microscopy, 3 references
[5] doi:10.1038/s42003-026-10063-9 [code]
Conserved Kir channel mechanisms governing intrinsic excitability in human and rodent parvalbumin neurons.
Journal: Communications biology
In common: pandas, SciPy, Matplotlib, 1 other tool, 2 references
[6] doi: [code]
Going deeper with morphologically detailed neural networks by simulation-based gradient propagation
Journal: Frontiers in computational neuroscience
In common: NEURON, SciPy, Matplotlib, 1 other tool, 1 reference
[7] doi:10.1126/sciadv.aec3961 [code]
Linking functional and structural dendritic spine remodeling during fear learning and extinction in vivo.
Journal: Science advances
In common: NEURON, pandas, SciPy, 2 other tools, histology / microscopy
[8] doi:10.3389/fnsyn.2026.1843277 [code]
High-frequency, high-intensity electrical stimulation selectively activates human fast-spiking interneurons.
Journal: Frontiers in synaptic neuroscience
In common: epilepsy, 3 references
[9] doi:10.3389/fnbeh.2026.1871826 [code]
Effects of repetitive scanning ultrasound on the intraneuronal dendritic signalling of CA1 pyramidal neurons.
Journal: Frontiers in behavioral neuroscience
In common: NEURON, 2 references
[10] doi:10.1016/j.isci.2026.117446 [code]
Volume-inflation registration (INFREG) for morphometric analysis of human focal cortical dysplasia type II.
Journal: iScience
In common: pandas, SciPy, Matplotlib, 1 other tool, epilepsy, 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.