Microstructural spine alterations increase neuronal excitability in focal cortical dysplasia Type I.
The 3 matches
- [1] § Methods › Statistics ↔ figures.py, lines 476–547 · score 0.68 · exponential fits, somatic EPSP amplitude, apical dendritic, distance, Curves, basal
- [2] § Methods › Statistics ↔ controller.py, lines 160–224 · score 0.66 · somatic EPSP amplitude, single spine, spine density, fits, distance, Violin
- [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
- from matplotlib import pyplot as plt
- import numpy as np
- from scipy.signal import savgol_filter
- # line plot for firing probability when activate multiple spines
- def line_firingprobability(data, save=False, xpeak=[40, 175]) :
- x_ctl_nspines = data['ctl_actspines']
- y_ctl_prob = data['ctl_prob']
- y_ctl_stdev = data['ctl_stdev']
- x_fcd_nspines = data['fcd_actspines']
- y_fcd_prob = data['fcd_prob']
- y_fcd_stdev = data['fcd_stdev']
- fig, (ax_fcd, ax_ctl) = plt.subplots(1, 2, sharey=True)
- fig.subplots_adjust(wspace=0.05) # adjust space between Axes
- filter_win = 5
- y_ctl_prob = savgol_filter(y_ctl_prob, window_length=filter_win, polyorder=2)
- y_fcd_prob = savgol_filter(y_fcd_prob, window_length=filter_win, polyorder=2)
- y_ctl_stdev = savgol_filter(y_ctl_stdev, window_length=filter_win, polyorder=2)
- y_fcd_stdev = savgol_filter(y_fcd_stdev, window_length=filter_win, polyorder=2)
- 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)
- ax_ctl.plot(x_ctl_nspines, y_ctl_prob, linewidth=2, color='darkcyan', label="Baseline")
- ax_fcd.plot(x_ctl_nspines, y_ctl_prob, linewidth=2, color='darkcyan', label="Baseline")
- 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)
- ax_fcd.plot(x_fcd_nspines, y_fcd_prob, linewidth=2, color='darkmagenta', label="Altered")
- ax_ctl.plot(x_fcd_nspines, y_fcd_prob, linewidth=2, color='darkmagenta', label="Altered") #just for the legend
- # xpeak = [40,175]
- ax_fcd.set_xlim(xpeak[0]-10, xpeak[0]+10)
- ax_ctl.set_xlim(xpeak[1]-10, xpeak[1]+10)
- ax_fcd.set_ylim(0, 1)
- ax_ctl.set_ylim(0, 1)
- ax_fcd.spines.right.set_visible(False)
- ax_ctl.spines.left.set_visible(False)
- ax_fcd.yaxis.tick_left()
- ax_ctl.yaxis.tick_right()
- ax_fcd.set_xticks([xpeak[0]-5, xpeak[0]+5], labels=[str(xpeak[0]-5), str(xpeak[0]+5)], fontsize=12)
- ax_ctl.set_xticks([xpeak[1]-5, xpeak[1]+5], labels=[str(xpeak[1]-5), str(xpeak[1]+5)], fontsize=12)
- ax_fcd.set_yticks([0, 1.0], labels=["0.0", "1.0"], fontsize=12)
- d = .2 # proportion of vertical to horizontal extent of the slanted line
- kwargs = dict(marker=[(-d, -1), (d, 1)], markersize=10,
- linestyle="none", color='k', mec='k', mew=1, clip_on=False)
- ax_fcd.plot([1, 1], [0, 1], transform=ax_fcd.transAxes, **kwargs)
- ax_ctl.plot([0, 0], [0, 1], transform=ax_ctl.transAxes, **kwargs)
- ax_fcd.set_ylabel("Firing Probability", fontsize=14)
- ax_fcd.set_xlabel('Number of Activated Spines', fontsize=14)
- ax_fcd.xaxis.set_label_coords(0.5, 0.05, transform=fig.transFigure)
- if save :
- plt.savefig(f"syn_activation.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
- plt.show()
- # line plot for io rate curve
- def line_io_curve(stats_df, save=False) :
- plt.figure()
- # Control
- plt.plot(stats_df['input_rate'], stats_df['avg_ctl'], label='Baseline', color='darkcyan')
- plt.fill_between(stats_df['input_rate'], stats_df['min_ctl'], stats_df['max_ctl'], color='cyan', alpha=.55, linewidth=1)
- # FCD
- plt.plot(stats_df['input_rate'], stats_df['avg_fcd'], label='Altered', color='darkmagenta')
- plt.fill_between(stats_df['input_rate'], stats_df['min_fcd'], stats_df['max_fcd'], color='magenta', alpha=.55, linewidth=1)
- plt.ylabel("Firing Rate (Hz)", fontsize=14)
- plt.ylim((0, 110))
- plt.xlim((0.2,5))
- plt.yticks(ticks=[0, 50, 100], labels=["0", "50", "100"], fontsize=12)
- plt.xlabel("Input Frequency (Hz)", fontsize=14)
- 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)
- plt.tick_params(
- axis='x', # changes apply to the x-axis
- which='both', # both major and minor ticks are affected
- bottom=True, # ticks along the bottom edge are off
- top=False)#, # ticks along the top edge are off
- if save :
- plt.savefig(f"io_curve.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
- plt.show()
- # line plot about deltaV(head-base) when neck diameter changed
- def line_neckdiam_vs_deltaV(data, ra, save=False, show=True, legend=False) :
- import matplotlib.cm as cm
- from matplotlib.colors import Normalize
- from mpl_toolkits.axes_grid1.inset_locator import inset_axes
- # neck_range_min = data['range'][0]
- # neck_range_max = data['range'][1]
- neck_diameter = data['neck_diameter']
- deltaV_min = data['deltaV_min']
- deltaV_max = data['deltaV_max']
- fig, ax = plt.subplots()
- # plt.fill_between(neck_diameter, deltaV_min, deltaV_max, color="lightgrey", alpha=0.9)
- cmap = cm.Reds
- # norm = Normalize(vmin=min(ra), vmax=max(ra))
- norm = Normalize(vmin=0, vmax=max(ra))
- for i in range(len(neck_diameter) - 1):
- res_val = (ra[i] + ra[i+1]) / 2
- color = cmap(norm(res_val))
- ax.fill_between(neck_diameter[i:i+2], deltaV_min[i:i+2], deltaV_max[i:i+2], color=color, edgecolor=None)
- plt.xlabel("Spine Neck Diameter (µm)", fontsize=14)
- plt.ylabel('ΔV (Head - Base, mV)', fontsize=14)
- plt.ylim((0, max(deltaV_max)))
- plt.xlim((0.1, 0.5))
- plt.yticks(ticks=[0, 5], labels=["0", "5"], fontsize=12)
- 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)
- plt.axvline(x = 0.15, ymin = 0, ymax = deltaV_max[neck_diameter.index(0.15)]/max(deltaV_max), color = 'cyan', label = 'Baseline', linestyle='-')
- plt.axvline(x = 0.3, ymin = 0, ymax = deltaV_max[neck_diameter.index(0.3)]/max(deltaV_max), color = 'magenta', label = 'Altered', linestyle='-')
- plt.scatter(0.3, deltaV_max[neck_diameter.index(0.3)], s=20, c='magenta', marker='X')
- plt.scatter(0.15, deltaV_max[neck_diameter.index(0.15)], s=20, c='cyan', marker='X')
- if legend :
- plt.text(0.3, deltaV_max[neck_diameter.index(0.3)], 'Altered', fontdict={'size': 9, 'color': 'magenta'})
- plt.text(0.15, deltaV_max[neck_diameter.index(0.15)], 'Baseline', fontdict={'size': 9, 'color': 'cyan'})
- # Force all spines on
- for spine in ax.spines.values():
- spine.set_visible(True)
- spine.set_color('black')
- ax_ins = inset_axes(ax, width="5%", height="40%", loc='upper right', borderpad=2)
- sm = cm.ScalarMappable(cmap=cmap, norm=norm)
- sm.set_array([])
- cbar = fig.colorbar(sm, cax=ax_ins)
- cbar.set_label('Neck Resistance (MΩ)')
- # cbar.ax.yaxis.set_label_position('left')
- cbar.ax.yaxis.set_ticks_position('left')
- cbar.ax.tick_params(labelsize=8)
- cbar.set_ticks([0, 330])
- if save :
- plt.savefig(f"neckdiam_deltaV.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
- if show :
- plt.show()
- # line plot about multipoints EPSP amplitude (head, base, soma) when head diameter(fixed neck length) changed
- def line_headdiam_vs_amplitude_multipoints(data, save=False) :
- # head_diam_range_min = data['range'][0]
- # head_diam_range_max = data['range'][1]
- #x axis
- head_diameters = data['head_diameter']
- #averaged values
- head_ = data['head']
- base_ = data['base']
- soma_ = data['soma']
- #min and max for shading
- head_min = data['head_min']
- base_min = data['base_min']
- soma_min = data['soma_min']
- head_max = data['head_max']
- base_max = data['base_max']
- soma_max = data['soma_max']
- #plot 그리기
- fig, (ax_spine, ax_soma) = plt.subplots(2, 1, sharex=True, gridspec_kw={'height_ratios': [0.7, 0.3]})
- fig.subplots_adjust(hspace=0.05) # adjust space between Axes
- ax_spine.plot(head_diameters, head_, color="red",label="Head")
- ax_spine.plot(head_diameters, base_, color="blue", label="Base")
- ax_spine.plot(head_diameters, soma_, color="black", label="Soma")
- ax_soma.plot(head_diameters, head_, color="red",label="Head")
- ax_soma.plot(head_diameters, base_, color="blue", label="Base")
- ax_soma.plot(head_diameters, soma_, color="black", label="Soma")
- ax_spine.fill_between(head_diameters, head_min, head_max, color="red", alpha=0.3)
- ax_spine.fill_between(head_diameters, base_min, base_max, color="blue", alpha=0.3)
- ax_spine.fill_between(head_diameters, soma_min, soma_max, color="black", alpha=0.3)
- ax_soma.fill_between(head_diameters, head_min, head_max, color="red", alpha=0.3)
- ax_soma.fill_between(head_diameters, base_min, base_max, color="blue", alpha=0.3)
- ax_soma.fill_between(head_diameters, soma_min, soma_max, color="black", alpha=0.3)
- ax_spine.spines.bottom.set_visible(False)
- ax_soma.xaxis.tick_bottom()
- ax_soma.spines.top.set_visible(False)
- ax_spine.set_xticks(ticks=[])
- ax_spine.set_yticks(ticks=[3,5,7], labels=["3", "5", "7"])
- ax_spine.set_ylim([0.5,9])
- ax_soma.set_xticks(ticks=[0.2, 0.5, 1.0, 1.5], labels=["0.2", "0.5", "1.0", "1.5"], fontsize=12)
- ax_soma.set_yticks(ticks=[0, 0.4], labels=["0", "0.4"], fontsize=12)
- ax_soma.set_ylim([0, 0.5])
- ax_spine.axvline(x = 0.55, ymin = 0, ymax = 1, color = 'cyan', linestyle='-')
- ax_spine.axvline(x = 0.70, ymin = 0, ymax = 1, color = 'magenta',linestyle='-')
- ax_soma.axvline(x = 0.55, ymin = 0, ymax = 1, color = 'cyan', linestyle='-')
- ax_soma.axvline(x = 0.70, ymin = 0, ymax = 1, color = 'magenta', linestyle='-')
- d = .5 # proportion of vertical to horizontal extent of the slanted line
- kwargs = dict(marker=[(-d, -1), (d, 1)], markersize=10,
- linestyle="none", color='k', mec='k', mew=1, clip_on=False)
- ax_spine.plot([0, 1], [0, 0], transform=ax_spine.transAxes, **kwargs)
- ax_soma.plot([0, 1], [1, 1], transform=ax_soma.transAxes, **kwargs)
- ax_soma.set_xlabel("Spine Head Diameter (µm)", fontsize=14)
- ax_spine.legend(loc="upper center", ncol=3, fontsize=12)
- fig.text(0.04, 0.5, 'EPSP Amplitude (mV)', va='center', rotation='vertical', fontsize=14)
- if save :
- plt.savefig(f"head_diam_amplitude.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
- plt.show()
- # violin plot for head, base, soma EPSP amplitude between groups
- def violin_singlespine_EPSPamp_multipoints_between_groups(control_data, altered_data, alter_what, N=100, save=False, show=True, legend=False) :
- amp_head_ctl = control_data['head']
- amp_base_ctl = control_data['base']
- amp_soma_ctl = control_data['soma']
- amp_head_fcd = altered_data['head']
- amp_base_fcd = altered_data['base']
- amp_soma_fcd = altered_data['soma']
- #plot 그리기
- fig, ax = plt.subplots(figsize=(4,4))
- # #Head, Base, Soma position base
- box_colors = ["cyan", "magenta", "cyan", "magenta", "cyan", "magenta"]
- bplot1 = ax.violinplot([amp_head_ctl, amp_head_fcd],
- positions=[1,2], widths=0.7, showmedians=True)
- bplot3 = ax.violinplot([amp_base_ctl, amp_base_fcd],
- positions=[3,4], widths=0.7, showmedians=True)
- bplot1['cmaxes'].set_color("black")
- bplot1['cmins'].set_color("black")
- bplot1['cmedians'].set_color('black')
- bplot3['cmaxes'].set_color("black")
- bplot3['cmins'].set_color("black")
- bplot3['cmedians'].set_color('black')
- ax.vlines(1, min(amp_head_ctl), max(amp_head_ctl), color="black", linestyle='-', lw=1.5)
- ax.vlines(2, min(amp_head_fcd), max(amp_head_fcd), color="black", linestyle='-', lw=1.5)
- ax.vlines(3, min(amp_base_ctl), max(amp_base_ctl), color="black", linestyle='-', lw=1.5)
- ax.vlines(4, min(amp_base_fcd), max(amp_base_fcd), color="black", linestyle='-', lw=1.5)
- for pc, color in zip(bplot1['bodies'], box_colors[0:2]):
- pc.set_facecolor(color)
- pc.set_edgecolor(color)
- pc.set_alpha(0.5)
- for pc, color in zip(bplot3['bodies'], box_colors[2:4]):
- pc.set_facecolor(color)
- pc.set_edgecolor(color)
- pc.set_alpha(0.5)
- if legend :
- plt.legend(["Baseline","Altered"], loc="lower left")
- ax.set_xticks([1.5, 3.5])
- ax.set_xticklabels(["Head", "Base"], fontsize=12)
- ax.tick_params(
- axis='x', # changes apply to the x-axis
- which='both', # both major and minor ticks are affected
- bottom=False, # ticks along the bottom edge are off
- top=False)
- ax.set_ylabel('EPSP Amplitude (mV)', fontsize=14)
- ax.set_yticks(ticks=[0, 2, 4, 6, 8, 10], labels=["0", "2", "4", "6", "8", "10"], fontsize=12)
- ax.set_ylim([0, 10.5])
- #for bigger receptor weights
- # 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)
- # ax.set_ylim([0, 20])
- # if alter == "density" :
- # ax.set_ylim([0, 10.5])
- ax.set_title('Spine', fontsize=14)
- # Force all spines on
- for spine in ax.spines.values():
- spine.set_visible(True)
- spine.set_color('black')
- if save :
- plt.savefig(f"violin_{alter_what}_ampl_spine.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
- if show :
- plt.show()
- fig, ax2 = plt.subplots(figsize=(2,4))
- bplot2 = ax2.violinplot([amp_soma_ctl, amp_soma_fcd], positions=[5,6], widths=0.7, showmedians=True)
- bplot2['cmaxes'].set_color("black")
- bplot2['cmins'].set_color("black")
- bplot2['cmedians'].set_color('black')
- ax2.vlines(5, min(amp_soma_ctl), max(amp_soma_ctl), color="black", linestyle='-', lw=1.5)
- ax2.vlines(6, min(amp_soma_fcd), max(amp_soma_fcd), color="black", linestyle='-', lw=1.5)
- for pc, color in zip(bplot2['bodies'], box_colors[4:6]):
- pc.set_facecolor(color)
- pc.set_edgecolor(color)
- pc.set_alpha(0.5)
- ax2.set_yticks(ticks=[0, 0.2, 0.4], labels=["0", "0.2", "0.4"], fontsize=12)
- ax2.set_xticks([])
- ax2.set_ylim([0, 0.45])
- #for bigger receptor weights
- # 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)
- # ax2.set_ylim([0, 1])
- ax2.tick_params(top=True, labeltop=True, bottom=False, labelbottom=False)
- ax2.set_title('Soma', fontsize=14)
- # Set the y-axis label position to the right
- ax2.yaxis.set_label_position("right")
- ax2.yaxis.tick_right()
- # Force all spines on
- for spine in ax2.spines.values():
- spine.set_visible(True)
- spine.set_color('black')
- if save :
- plt.savefig(f"violin_{alter_what}_ampl_soma.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
- if show :
- plt.show()
- #line plot with scatter overlay for input resistance when differing spine factor
- # spine density vs input resistance
- def line_density_vs_RI(data, save=False, show=True, legend=False) :
- x = data['x_sf']
- y = data['y_ri']
- fig, ax = plt.subplots()
- plt.plot(x, y, color="black", linewidth=2.5)
- plt.ylim((70, 190))
- # Set the y-axis label position to the right
- ax.yaxis.set_label_position("right")
- # Move the y-axis ticks and tick labels to the right
- ax.yaxis.tick_right()
- ax.tick_params(
- axis='y', # changes apply to the y-axis
- which='both', # both major and minor ticks are affected
- left=False, # ticks along the bottom edge are off
- right=True)
- plt.yticks(ticks=[90, 130, 170], labels=["90", "130", "170"], fontsize=12)
- plt.xticks(ticks=[x[0], x[-1]], labels=["Sparse", "Dense"], fontsize=12)
- plt.tick_params(
- axis='x', # changes apply to the x-axis
- which='both', # both major and minor ticks are affected
- bottom=True, # ticks along the bottom edge are off
- top=False)#), # ticks along the top edge are off
- # Force all spines on
- for spine in ax.spines.values():
- spine.set_visible(True)
- spine.set_color('black')
- #flip X axis
- plt.gca().invert_xaxis()
- plt.scatter(1.2, y[x.index(1.20)], s=120, c='magenta', marker='X')
- plt.scatter(2.0, y[x.index(2.00)], s=120, c='cyan', marker='X')
- if legend :
- plt.text(2.0, y[x.index(2.00)], 'Baseline', fontdict={'size': 9, 'color': 'cyan'})
- plt.text(1.2, y[x.index(1.20)], 'Altered', fontdict={'size': 9, 'color': 'magenta'})
- plt.xlabel("Spine Density", fontsize=14)
- plt.ylabel("Input Resistance (MΩ)", fontsize=14)
- if save:
- plt.savefig("density_RI.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
- if show :
- plt.show()
- #boxplot for input resistance when differing nbasal
- def box_nbasal_vs_ri(data, save=False):
- y_ctl = data["ri_ctl"]
- y_fcd = data["ri_fcd"]
- fig, ax = plt.subplots(figsize=(2,2))
- # draw boxplot
- bplot = ax.boxplot([y_ctl, y_fcd], widths=0.4,
- patch_artist=True,
- showfliers=False,
- boxprops=dict(facecolor='none', edgecolor='none'),
- whiskerprops=dict(color='none'),
- capprops=dict(color='none'),
- medianprops=dict(color='black', linewidth=2.5))
- # medianprops=dict(color="black", linewidth=2),
- # patch_artist=True, showfliers=False)
- # jitter for every data point to avoid overlap
- for i, data in enumerate([y_ctl]):
- x = np.random.normal(i + 1, 0.04, size=len(data))
- ax.plot(x, data, 'o', color='darkcyan', markersize=3, alpha=0.9)
- for i, data in enumerate([y_fcd]):
- x = np.random.normal(i + 2, 0.04, size=len(data))
- ax.plot(x, data, 'o', color='darkmagenta', markersize=3, alpha=0.9)
- ax.set_xticks([1, 2])
- # bplot = ax.boxplot([y_ctl, y_fcd], widths=0.5, medianprops=dict(color="black"), patch_artist=True) # will be used to label x-ticks
- # fill with colors
- for patch, color in zip(bplot['boxes'], ["cyan", "magenta"]):
- patch.set_facecolor(color)
- patch.set_alpha(0.7)
- plt.ylim((80, 170))
- ax.set_yticks(ticks=[100, 130, 160], labels=["100", "140", "160"], fontsize=12)
- plt.xticks([])
- if save :
- plt.savefig(f"ri_box.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
- plt.show()
- def meansem_nbasal_vs_ri(data, save=False) :
- from scipy import stats
- y_ctl = data["ri_ctl"]
- y_fcd = data["ri_fcd"]
- data_groups = [y_ctl, y_fcd]
- group_colors = ['cyan', 'magenta']
- line_colors = ['darkcyan', 'darkmagenta']
- x_pos = [1, 2]
- fig, ax = plt.subplots(figsize=(2,2))
- for i, (data, color, lcolor) in enumerate(zip(data_groups, group_colors, line_colors)):
- mean = np.mean(data)
- sem = stats.sem(data)
- # print(f"Group {i+1} - Mean: {mean:.2f}, SEM: {sem:.2f}")
- x_jitter = np.random.normal(x_pos[i], 0.04, size=len(data))
- ax.scatter(x_jitter, data, color=color, s=5, alpha=0.9, zorder=1)
- ax.hlines(mean, x_pos[i]-0.2, x_pos[i]+0.2, colors=lcolor, lw=1.5, zorder=3)
- ax.errorbar(x_pos[i], mean, yerr=sem, fmt='none', ecolor=lcolor,
- elinewidth=2, capsize=10, zorder=2)
- ax.set_xticks(x_pos)
- ax.spines['top'].set_visible(False)
- ax.spines['right'].set_visible(False)
- plt.ylim((70, 160))
- ax.set_yticks(ticks=[90, 120, 150], labels=["90", "120", "150"], fontsize=12)
- plt.xticks([])
- if save :
- plt.savefig(f"ri_box.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
- plt.show()
- # distance from soma vs somatic amplitude
- # scatter plot and fitting line
- # does not include dendrite information
- # should adjust nseg of the SF dendrite by dend_nseglevel
- # upper line from basal dendrite, lower line from apical dendrite
- def scatter_distance_from_soma_vs_somatic_amplitude(data, fit_params, save=False):
- import numpy as np
- from scipy.optimize import curve_fit
- #unpakcing
- dist_spine_ctl = data['dst_ctl']
- dist_spine_fcd = data['dst_fcd']
- amplitude_ctl = data['amp_ctl']
- amplitude_fcd = data['amp_fcd']
- a = fit_params['a']
- b = fit_params['b']
- c = fit_params['c']
- a_ = fit_params['a_']
- b_ = fit_params['b_']
- c_ = fit_params['c_']
- fig, ax = plt.subplots()
- plt.scatter(dist_spine_ctl, amplitude_ctl, marker="o", s=20, color="cyan", alpha=0.7, label="Baseline")
- plt.scatter(dist_spine_fcd, amplitude_fcd, marker="o", s=20, color="magenta", alpha=0.7, label="Altered")
- ## exponential fitting
- # Define the exponential function
- def exp_func(x, a, b, c):
- return a * np.exp(b * x) +c
- # Fit the curve
- params, covar_ = curve_fit(exp_func, dist_spine_ctl, amplitude_ctl, p0=[a, b, c])
- fit_a, fit_b, fit_c = params
- x_fit = np.linspace(min(dist_spine_ctl), max(dist_spine_ctl), 1000) # for a smooth curve
- y_fit = exp_func(x_fit, fit_a, fit_b, fit_c)
- plt.plot(x_fit, y_fit, color='darkcyan')
- print(f'Baseline: y={fit_a:.4f}e^({fit_b:.5f}x)+{fit_c:.4f}')
- # Fit the curve
- params_, covar_ = curve_fit(exp_func, dist_spine_fcd, amplitude_fcd, p0=[a_, b_, c_])
- fit_a_fcd, fit_b_fcd, fit_c_fcd = params_
- y_fit_ = exp_func(x_fit, fit_a_fcd, fit_b_fcd, fit_c_fcd)
- plt.plot(x_fit, y_fit_, color='darkmagenta')
- print(f'Altered: y={fit_a_fcd:.4f}e^({fit_b_fcd:.5f}x)+{fit_c_fcd:.4f}')
- plt.xlabel("Spine Location Relative to Soma (µm)", fontsize=14)
- plt.ylabel("Somatic EPSP Amplitude (mV)", fontsize=14)
- plt.xlim((30, 390))
- plt.ylim((0.08, 0.44))
- ax.set_xticks(ticks=[100, 200, 300], labels=["100", "200", "300"], fontsize=12)
- ax.set_yticks(ticks=[0.1, 0.2, 0.3, 0.4], labels=["0.1", "0.2", "0.3", "0.4"], fontsize=12)
- plt.tick_params(
- axis='y', # changes apply to the y-axis
- which='both', # both major and minor ticks are affected
- right=False)
- # if legend :
- # plt.legend(loc="upper right")
- # Force all spines on
- for spine in ax.spines.values():
- spine.set_visible(True)
- spine.set_color('black')
- if save :
- plt.savefig(f"distance_vs_soma_amp.png", dpi=600, bbox_inches='tight', pad_inches=0.01, transparent=False)
- plt.show()
- if __name__ == "__main__" :
- pass
figures.py at commit 0d2cd0b, under CC-BY-NC-4.0 · at the source
Overview
- Neural Circuits Research Group, Korea Brain Research Institute (KBRI), Daegu, Republic of Korea
- Sensory and Motor System Research Group, Korea Brain Research Institute (KBRI), Daegu, Republic of Korea
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
0d2cd0b63f0cc3e4432c56be518c7ddf7bee76ec, 16 April 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
19 files
- ampa.mod, NEURON, 109 lines
- batch_iorate_curve.py, Python, 170 lines
- cell_singlespine.py, Python, 507 lines
- cell_singlespine_randoml
oc.py , Python, 504 lines - controller.py, Python, 282 lines, 1 match
- figures.py, Python, 552 lines, 1 match
- kv.mod, NEURON, 148 lines
- morphology.py, Python, 427 lines
- morphology_simplified.py
, Python, 465 lines - morphologyandproperty.py
, Python, 107 lines - na.mod, NEURON, 187 lines
- nmda.mod, NEURON, 129 lines
- sseEPSP.py, Python, 420 lines, 1 match
- supple_figures.py, Python, 412 lines
- sync_activation.py, Python, 167 lines
- sync_activation_pkl.py, Python, 199 lines
- LICENSE, License, 407 lines
- README.md, Text, 13 lines
- readme, Text, 1 line
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://
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://
BibTeX
@article{gim2026microstr
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/
url = {https://
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/
VL - 20
SP - 1862383
SN - 1662-5188
PB - Frontiers Media SA
DO - 10.3389/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.3389/
"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":
"volume": "20",
"page": "1862383",
"DOI": "10.3389/
"PMID": "42718645",
"PMCID": "PMC13553748",
"ISSN": "1662-5188",
"publisher": "Frontiers Media SA",
"URL": "https://
"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 AmericaIn 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 advancesIn 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 reportsIn 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 sciencesIn 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 biologyIn common: pandas, SciPy, Matplotlib, 1 other tool, 2 references
- [6] doi: [code]
- Going deeper with morphologically detailed neural networks by simulation-based gradient propagationJournal: Frontiers in computational neuroscienceIn 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 advancesIn 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 neuroscienceIn 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 neuroscienceIn 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: iScienceIn 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 16 scripts, and 3 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:b0f7910c18c5a104…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
