|
| 1 | +# "Biophysical modeling of the whole-cell dynamics of C. elegans motor and interneurons families" |
| 2 | +# M. Nicoletti et al. PloS ONE, 19(3): e0298105. |
| 3 | +# https://doi.org/10.1371/journal.pone.0298105 |
| 4 | + |
| 5 | +# AIY neuron H-H MODEL |
| 6 | +# current and voltage clamp simulations shown in Figure 3 |
| 7 | + |
| 8 | +import os |
| 9 | +from neuron import h,gui |
| 10 | +import numpy |
| 11 | +from matplotlib import pyplot |
| 12 | +from AIY_simulation_iclamp import AIY_simulation_iclamp |
| 13 | +from AIY_simulation_vclamp import AIY_simulation_vc |
| 14 | +from g_to_Scm2 import gScm2 |
| 15 | + |
| 16 | + |
| 17 | +os.mkdir('AIY_SIMULATION') |
| 18 | +path='AIY_SIMULATION' |
| 19 | + |
| 20 | +v=numpy.linspace(start=-120, stop=50, num=18) |
| 21 | +ic=numpy.linspace(start=-15, stop=35, num=11) |
| 22 | +surf=65.89e-8# surface in cm^2 form neuromorpho AIYL |
| 23 | + |
| 24 | +#conductances: leak, slo1iso,kqt1,egl19,slo1egl19,nca,irk,eleak,cm |
| 25 | +g0=[0.14,1,0.2,0.1,0.92,0.06,0.5,-89.57,1.6] |
| 26 | + |
| 27 | + |
| 28 | +gbest=gScm2(g0,surf,6) |
| 29 | + |
| 30 | + |
| 31 | +best_results=AIY_simulation_vc(gbest,-120,50,18) |
| 32 | +best_current=numpy.array(list(best_results[0])) |
| 33 | +best_iv=numpy.array(list(best_results[3])) |
| 34 | +best_time=numpy.array(list(best_results[1])) |
| 35 | +best_iv_WT=numpy.array(list(best_results[2])) |
| 36 | + |
| 37 | +fname4="AIY_simulated_current_WT.txt" |
| 38 | +fname5="AIY_simulated_time_WT.txt" |
| 39 | +fname6="AIY_simulated_IV_SS_WT.txt" |
| 40 | +fname7="AIY_IV_simulated_PEAK_WT.txt" |
| 41 | + |
| 42 | + |
| 43 | +path4=os.path.join(path, fname4) |
| 44 | +path5=os.path.join(path, fname5) |
| 45 | +path6=os.path.join(path, fname6) |
| 46 | +path7=os.path.join(path, fname7) |
| 47 | + |
| 48 | +numpy.savetxt(path4, best_current, delimiter="," , fmt="%s") |
| 49 | +numpy.savetxt(path5, best_time, delimiter="," , fmt="%s") |
| 50 | +numpy.savetxt(path6, best_iv, delimiter=", " , fmt="%s") |
| 51 | +numpy.savetxt(path7, best_iv_WT, delimiter=", " , fmt="%s") |
| 52 | + |
| 53 | + |
| 54 | +best_cc=AIY_simulation_iclamp(gbest,-0.015,0.035,11) |
| 55 | +best_voltage=best_cc[0] |
| 56 | +best_time2=best_cc[1] |
| 57 | +best_VIss=best_cc[3] |
| 58 | +best_VIpeaks=best_cc[2] |
| 59 | + |
| 60 | +fname8='AIY_CC_simulated_voltage_WT.txt' |
| 61 | +fname9='AIY_CC_simulated_time_WT.txt' |
| 62 | +path8=os.path.join(path, fname8) |
| 63 | +path9=os.path.join(path, fname9) |
| 64 | + |
| 65 | +numpy.savetxt(path8, best_voltage, delimiter="," , fmt="%s") |
| 66 | +numpy.savetxt(path9, best_time2, delimiter=", " , fmt="%s") |
| 67 | + |
| 68 | +# plot |
| 69 | + |
| 70 | +fig=pyplot.figure(figsize=(8,4)) |
| 71 | +iv_plot=pyplot.plot(v,best_iv,color='red',marker='+',markersize=15,label='optimized-ss') |
| 72 | +iv_plot=pyplot.plot(v,best_iv_WT,color='red',marker='o',markersize=15,label='optimized-peaks') |
| 73 | +pyplot.xlabel('V [mV]') |
| 74 | +pyplot.ylabel('I [pA]') |
| 75 | +pyplot.xlim(-130,60) |
| 76 | +fig.legend(loc=5) |
| 77 | +pyplot.title('IV-CURVES') |
| 78 | +pyplot.show() |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | +fig3=pyplot.figure(figsize=(8,4)) |
| 83 | +for i in range(0,18): |
| 84 | + curr_plot=pyplot.plot(best_time[i],best_current[i],color='red',linestyle='solid') |
| 85 | +pyplot.xlabel('Time [ms]') |
| 86 | +pyplot.ylabel('I [pA]') |
| 87 | +pyplot.title('Voltage clamp') |
| 88 | +pyplot.show() |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +fig4=pyplot.figure(figsize=(8,4)) |
| 94 | +for i in range(0,10): |
| 95 | + volt_plot=pyplot.plot(best_time2[i],best_voltage[i],color='red',linestyle='solid') |
| 96 | +pyplot.xlabel('Time [ms]') |
| 97 | +pyplot.ylabel('V [mV]') |
| 98 | +#pyplot.xlim(0,0.7) |
| 99 | +pyplot.title('Current_Clamp') |
| 100 | +pyplot.show() |
| 101 | + |
| 102 | + |
0 commit comments