Skip to content

Commit

Permalink
bioarxiv version with correct figure numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaitanya CHINTALURI committed Feb 7, 2023
1 parent 368918e commit 0d81e00
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 21 deletions.
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,29 @@ After this, please activate this specific python environment by
user@computer:~/metabolic_spiking$ source activate py36
(py36)user@computer:~/metabolic_spiking$

## Generate figures from the paper

### Figure 1 & supplementary
## Generate figures from the paper -
bioarxiv preprint (https://www.biorxiv.org/content/10.1101/2022.10.16.512428v1)
DOI: https://doi.org/10.1101/2022.10.16.512428

|Figure in MS|.odg file / |.py file|
|------------|-----------|--------|
| Figure 1 | /figure_odgs/Figure1.odg| fig1.py |
| Figure 2 | /figure_odgs/Figure2.odg| fig2.py |
| Figure 3 | /figure_odgs/Figure2.odg| fig2_v6_2.py |
| Figure 4 | /figure_odgs/Figure3.odg| fig3_dfb.py |
| Figure 5 | /figure_odgs/Figure3.odg| fig3_nw.py |
| Figure 6 | /figure_odgs/Figure4.odg| fig4.py |
| Figure 7 | /figure_odgs/Figure5_supp.odg| fig_predictions.py |
| Figure S1 |/figure_odgs/Figure1_supp.odg| fig1_supp.py |
| Figure S2 |/figure_odgs/Figure1_supp.odg| fig1_supp_b.py |
| Figure S3 |/figure_odgs/Figure2_supp.odg| fig2_supp.py |
| Figure S4 |/figure_odgs/Figure3_supp.odg| fig3_nw_supp.py |
| Figure S5 |/figure_odgs/Figure4_supp.odg| -NA- |
| Figure S6 |/figure_odgs/Figure6_supp.odg| -NA- |
| Figure S7 |/figure_odgs/Figure6_supp.odg| -NA- |


### Figures 1, S1 and S2 from the MS
Please run the steady_state.py first if you want to regenerate everthing from the beginning, you can skip this line if you want to use the pre-generated data.

(py36)user@computer:~/metabolic_spiking$ python steady_state.py
Expand All @@ -25,14 +45,15 @@ This will refresh / re-populate the contents of these folders (i) ./reaction_rat

You will have Figure1.png, Figure1_supp.png, Figure1_supp_b.png in your folder after this.


For this figure split in two parts type

(py36)user@computer:~/metabolic_spiking$ python fig1a.py
(py36)user@computer:~/metabolic_spiking$ python fig1b.py

You will have Figure1a.png and Figure1b.png in your folder after this.

### Figure 2 & supplementary
### Figure 2, 3 and S3 from the MS
Please run ret_intrinsic_summary.py and fet_intrinsic_summary.py for starting from the beginning, you can skip this if you don't want to use the pre-generated data.

(py36)user@computer:~/metabolic_spiking$ python ret_intrinsic_summary.py
Expand All @@ -45,14 +66,14 @@ This will refresh / re-populate the contents of ./spike_compensation/ folder wit

You will have Figure2.png and Figure2_supp.png in your folder after this. The second line with also add some additional files to the above folder

### Figure 3 dfb neuron
### Figure 4 dfb neuron
Please run the following

(py36)user@computer:~/metabolic_spiking$ python fig3_dfb.py

This will output Figure3_dfb.png file

### Figure 3 network model
### Figure 5 network model

You have to run the model if you want for other seeds/parameter values than the ones shown in the figure.

Expand All @@ -61,7 +82,7 @@ You have to run the model if you want for other seeds/parameter values than the

This will output Figure3_nw.png file

### Figure 3 network model supplementary plot
### Figure 4S network model supplementary plot

(py36)user@computer:~/metabolic_spiking$ python nw_va.py vogels2005
(py36)user@computer:~/metabolic_spiking$ python nw_va.py metabolic
Expand All @@ -79,7 +100,7 @@ These commands will produce as many files with the summary data as pickles (./ne

When the above is run for the first time, the summary values are calculated and dumped into a .npz file, which is used for the subsequent figure generation calls. In the end, you will have Figure3_nw_supp.png file in your folder.

### Figure 4
### Figure 6

Please run the following command

Expand Down
46 changes: 34 additions & 12 deletions fig3_nw.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ def summary_spikes(total_neurons, sim_time, times, nidx, M, dict_key,
norm_1 = colors.BoundaryNorm(bounds, cmap_.N, clip=True)
im = ax2.scatter(times_zoom, nidx_zoom, c=M_zoom, cmap=cmap_, s=1,
linewidth=0.1, edgecolor='k', norm=norm_1)
# ax2.plot([0, sim_time/2/ms], [4050, 4050],
# lw=2, c='gold', zorder=10)
ax2.plot([0, sim_time/2/ms], [4050, 4050],
lw=2, c='gold', zorder=10)
lw=2, c='#e6ab02', zorder=10)
ax2.plot([sim_time/2/ms, sim_time/ms], [4050, 4050],
lw=2, c='k', zorder=10)
cax = inset_axes(ax2, width='100%', height='100%',
Expand Down Expand Up @@ -149,8 +151,10 @@ def summary_spikes(total_neurons, sim_time, times, nidx, M, dict_key,
size_vertical=(ymax-ymin)/1000)
ax0.add_artist(asb)
ax0.set_ylabel('Pop. act. (Hz)')
# ax0.plot([0, sim_time/2/ms], [0.02, 0.02],
# lw=1.5, c='gold')
ax0.plot([0, sim_time/2/ms], [0.02, 0.02],
lw=1.5, c='gold')
lw=1.5, c='#e6ab02')
ax0.text(sim_time/4/ms, 0.03, s='Poisson input (3Hz)',
color='k', va='center', ha='center')
ax0.plot([sim_time/2/ms, sim_time/ms], [0.02, 0.02], lw=1.5, c='k')
Expand Down Expand Up @@ -248,10 +252,13 @@ def summary_spikes(total_neurons, sim_time, times, nidx, M, dict_key,
if opt_dicts:
Nfh, B = np.histogram(np.array(avg_fr_fh), bins=np.linspace(0, 40, 41))
Nsh, B = np.histogram(np.array(avg_fr_sh), bins=np.linspace(0, 40, 41))
ax4.plot(B[:-1], Nfh / np.sum(Nfh), c='gold', lw=.75)
# ax4.plot(B[:-1], Nfh / np.sum(Nfh), c='gold', lw=.75)
ax4.plot(B[:-1], Nfh / np.sum(Nfh), c='#e6ab02', lw=.75)
ax4.plot(B[:-1], Nsh / np.sum(Nsh), c='k', lw=0.75)
# ax4.plot((np.mean(avg_fr_fh)*Hz, np.mean(avg_fr_fh)*Hz),
# (0, np.max(N)/np.sum(N)), c='gold', lw=.75, ls='--')
ax4.plot((np.mean(avg_fr_fh)*Hz, np.mean(avg_fr_fh)*Hz),
(0, np.max(N)/np.sum(N)), c='gold', lw=.75, ls='--')
(0, np.max(N)/np.sum(N)), c='#e6ab02', lw=.75, ls='--')
ax4.plot((np.mean(avg_fr_sh)*Hz, np.mean(avg_fr_sh)*Hz),
(0, np.max(N)/np.sum(N)), c='k', lw=.75, ls='--')
ax4.set_xlabel('Avg firing rate(Hz)')
Expand All @@ -267,10 +274,13 @@ def summary_spikes(total_neurons, sim_time, times, nidx, M, dict_key,
if opt_dicts:
Nfh, B = np.histogram(all_isi_fh, bins=np.logspace(0, 3.1, 30))
Nsh, B = np.histogram(all_isi_sh, bins=np.logspace(0, 3.1, 30))
ax5.plot(B[:-1], Nfh / np.sum(Nfh), c='gold', lw=.75)
# ax5.plot(B[:-1], Nfh / np.sum(Nfh), c='gold', lw=.75)
ax5.plot(B[:-1], Nfh / np.sum(Nfh), c='#e6ab02', lw=.75)
ax5.plot(B[:-1], Nsh / np.sum(Nsh), c='k', lw=.75)
# ax5.plot((np.mean(all_isi_fh), np.mean(all_isi_fh)),
# (0, np.max(N)/np.sum(N)), c='gold', lw=.75, ls='--')
ax5.plot((np.mean(all_isi_fh), np.mean(all_isi_fh)),
(0, np.max(N)/np.sum(N)), c='gold', lw=.75, ls='--')
(0, np.max(N)/np.sum(N)), c='#e6ab02', lw=.75, ls='--')
ax5.plot((np.mean(all_isi_sh), np.mean(all_isi_sh)),
(0, np.max(N)/np.sum(N)), c='k', lw=.75, ls='--')
ax5.set_xscale('symlog')
Expand All @@ -283,10 +293,14 @@ def summary_spikes(total_neurons, sim_time, times, nidx, M, dict_key,
if opt_dicts:
Nfh, B = np.histogram(cvs_fh, bins=np.linspace(0, 3, 30))
Nsh, B = np.histogram(cvs_sh, bins=np.linspace(0, 3, 30))
ax6.plot(B[:-1], Nfh / np.sum(Nfh), c='gold', lw=0.75)
# ax6.plot(B[:-1], Nfh / np.sum(Nfh), c='gold', lw=0.75)
ax6.plot(B[:-1], Nfh / np.sum(Nfh), c='#e6ab02', lw=0.75)
ax6.plot(B[:-1], Nsh / np.sum(Nsh), c='k', lw=0.75)
# ax6.plot((np.mean(cvs_fh), np.mean(cvs_fh)),
# (0, np.max(N)/np.sum(N)), c='gold',
# lw=0.75, ls='--')
ax6.plot((np.mean(cvs_fh), np.mean(cvs_fh)),
(0, np.max(N)/np.sum(N)), c='gold',
(0, np.max(N)/np.sum(N)), c='#e6ab02',
lw=0.75, ls='--')
ax6.plot((np.mean(cvs_sh), np.mean(cvs_sh)),
(0, np.max(N)/np.sum(N)), c='k',
Expand All @@ -302,11 +316,15 @@ def summary_spikes(total_neurons, sim_time, times, nidx, M, dict_key,
if opt_dicts:
Mfh, B = np.histogram(opt_dicts[2], bins=np.linspace(-2, 1, 31))
Msh, B = np.histogram(opt_dicts[3], bins=np.linspace(-2, 1, 31))
ax7.plot(B[:-1], Mfh / sum(Mfh), c='gold', lw=0.75)
# ax7.plot(B[:-1], Mfh / sum(Mfh), c='gold', lw=0.75)
ax7.plot(B[:-1], Mfh / sum(Mfh), c='#e6ab02', lw=0.75)
ax7.plot(B[:-1], Msh / sum(Msh), c='k', lw=0.75)
# ax7.plot((np.mean(opt_dicts[2]),
# np.mean(opt_dicts[2])), (0, np.max(N)/np.sum(N)),
# c='gold', lw=0.75, ls='--')
ax7.plot((np.mean(opt_dicts[2]),
np.mean(opt_dicts[2])), (0, np.max(N)/np.sum(N)),
c='gold', lw=0.75, ls='--')
c='#e6ab02', lw=0.75, ls='--')
ax7.plot((np.mean(opt_dicts[3]),
np.mean(opt_dicts[3])), (0, np.max(N)/np.sum(N)),
c='k', lw=0.75, ls='--')
Expand All @@ -323,7 +341,9 @@ def summary_spikes(total_neurons, sim_time, times, nidx, M, dict_key,
linestyle='None')
fits_t_sh.power_law.plot_pdf(ax=ax8, lw=0.5, color='k')
fits_t_fh = opt_dicts[0]['fit_t']
fits_t_fh.plot_pdf(ax=ax8, color='gold', markersize=1,
# fits_t_fh.plot_pdf(ax=ax8, color='gold', markersize=1,
# marker='o')
fits_t_fh.plot_pdf(ax=ax8, color='#e6ab02', markersize=1,
marker='o')
ax8.text(0.6, 0.95, s=r'$\alpha_{D}=$'+str(opt_dicts[1]['talpha'])[:4],
horizontalalignment='center',
Expand All @@ -340,7 +360,9 @@ def summary_spikes(total_neurons, sim_time, times, nidx, M, dict_key,
linestyle='None')
fits_sh.power_law.plot_pdf(ax=ax9, lw=0.5, color='k')
fits_fh = opt_dicts[0]['fit_s']
fits_fh.plot_pdf(ax=ax9, color='gold', markersize=1,
# fits_fh.plot_pdf(ax=ax9, color='gold', markersize=1,
# marker='o')
fits_fh.plot_pdf(ax=ax9, color='#e6ab02', markersize=1,
marker='o')
ax9.text(0.6, 0.95, s=r'$\alpha_{S}=$'+str(opt_dicts[1]['palpha'])[:4],
horizontalalignment='center',
Expand Down
4 changes: 3 additions & 1 deletion fig4.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ def upper_run(axs, axs_meta, mito_baseline, spike_quanta):
c=fp.def_colors['park1'], lw=0.25)
ax3.plot(t, r_cell_typ2.out['v'],
c=fp.def_colors['park2'], lw=0.25)
# ax4.plot(t, r_cell_typ3.out['v'],
# c='gold', lw=0.35)
ax4.plot(t, r_cell_typ3.out['v'],
c='gold', lw=0.35)
c='#e6ab02', lw=0.35)

ax1_m.plot(t, r_cell_cntrl.out['atp'],
c=fp.def_colors['atp'], lw=0.5, label='ATP')
Expand Down
Binary file modified figure_odgs/Figure1.odg
Binary file not shown.
Binary file modified figure_odgs/Figure1_supp.odg
Binary file not shown.
Binary file modified figure_odgs/Figure2.odg
Binary file not shown.
Binary file modified figure_odgs/Figure3.odg
Binary file not shown.
Binary file modified figure_odgs/Figure3_supp.odg
Binary file not shown.
Binary file modified figure_odgs/Figure4.odg
Binary file not shown.
Binary file modified figure_odgs/Figure4_supp.odg
Binary file not shown.
Binary file modified figure_odgs/Figure5_supp.odg
Binary file not shown.
Binary file modified figure_odgs/Figure6_supp.odg
Binary file not shown.
Binary file not shown.
Binary file added netsim_results/20/20_0_300_200_50.npz
Binary file not shown.
Binary file added netsim_results/20/20_25_300_200_50.npz
Binary file not shown.
Binary file not shown.

0 comments on commit 0d81e00

Please sign in to comment.