Skip to content

Commit

Permalink
update max speed acc trade off figure
Browse files Browse the repository at this point in the history
  • Loading branch information
npmurphy committed Jul 14, 2018
1 parent 4d06fbb commit 87a9bbf
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Maximum 4 species 3 reactions, Example speed/accuracy trade off figure.
### Data
* `paper/maximum_out_S4_R3/Bimol_1.speedtime` - Speed-accuracy trade off data
* `paper/maximum_out_S4_R3/Bimol_1.lbs` - CRN file used
* paper/maximum_out_S4_R3/Bimol_1_tf10000.tsv - heatmap file
### Code
* `python paper/fig_max_speed_ac/fig_max_histo.py`

Expand Down Expand Up @@ -176,4 +177,4 @@ All CRNs shown in the paper are stored in a compressed format in the `Storage` d

`python python/lbs_storage.py --crn_storage_file Storage\AMno11_S3_R3_CRNs.tsv -d AMno11_S3_R3 -r all`

Alternatively, you can choose to decompress a single CRN by using its integer identifier as the argument for `r`.
Alternatively, you can choose to decompress a single CRN by using its integer identifier as the argument for `r`.
34 changes: 25 additions & 9 deletions paper/fig_max_speed_ac/fig_max_speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
from mpl_toolkits.axes_grid1.inset_locator import mark_inset
# from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
# from mpl_toolkits.axes_grid1.inset_locator import mark_inset
import os
import numpy as np

Expand All @@ -20,7 +20,7 @@
N = 50
one_N = speedac[speedac["N"] == N].copy()

fig, ax = plt.subplots(1, 2)
fig, ax = plt.subplots(1, 3)

plot_settings = {
"linestyle" : "-",
Expand All @@ -41,21 +41,37 @@
label="A = {0}".format(int(i)),
**plot_settings)

ax[0].set_xlabel("Ratio of slow/fast reactions")
ax[0].set_xlabel("Ratio of slow/fast reaction rates")
ax[0].set_ylabel("Accuracy")
#ax[0].legend(loc="lower center")
ax[0].text(-0.3, 1.1, "a", transform=ax[0].transAxes, fontsize=10)

ax[1].set_xlabel("Ratio of slow/fast reactions")
ax[1].set_xlabel("Ratio of slow/fast reaction rates")
ax[1].set_ylabel("Expected halt time")
leg = ax[1].legend()
leg, ax[1] = shift_legend(ax[1], leg, yshift=0.1)
ax[1].text(-0.35, 1.05, "b", transform=ax[1].transAxes, fontsize=10)

fig.set_size_inches(cm2inch(7.9, 3.5))
#####################
### Accuracy decrease with moleucles
#############
acc_down = pd.read_csv("paper/maximum_out_S4_R3/Bimol_1_tf10000.tsv", sep="\t", names=["N", "opt_score", "one_score"])
ax[2].plot(acc_down["N"], acc_down["opt_score"],**plot_settings)
ax[2].set_xscale('log')
ax[2].set_ylim(0, 1.1)
#cycler = matplotlib.rcParams['axes.color_cycle']
ax[2].axvline(100, color="gray", linewidth=0.5)
ax[2].set_xlabel("Total molecules ($n$)")
ax[2].set_ylabel("Accuracy")

ly = 0.92
ax[0].text(0.01, ly, "a", transform=fig.transFigure, fontsize=10)
ax[1].text(0.35, ly, "b", transform=fig.transFigure, fontsize=10)
ax[1].text(0.69, ly, "c", transform=fig.transFigure, fontsize=10)


fig.set_size_inches(cm2inch(12, 3.5))

#fig.tight_layout()
fig.subplots_adjust(left= 0.15, # the left side of the subplots of the figure
fig.subplots_adjust(left= 0.10, # the left side of the subplots of the figure
right = 0.99, # the right side of the subplots of the figure
bottom = 0.3, # the bottom of the subplots of the figure
top = 0.85, # the top of the subplots of the figure
Expand Down
21 changes: 21 additions & 0 deletions paper/maximum_out_S4_R3/Bimol_1_tf10000.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
1.000000 1.000000 0.363000
2.000000 0.998000 0.074000
3.000000 0.998000 0.015000
5.000000 0.997000 0.004000
7.000000 0.996000 0.000000
10.000000 0.995000 0.000000
20.000000 0.980000 0.000000
30.000000 0.965000 0.000000
50.000000 0.961000 0.000000
70.000000 0.931000 0.000000
100.000000 0.906000 0.000000
200.000000 0.832000 0.000000
300.000000 0.768000 0.000000
500.000000 0.604000 0.000000
700.000000 0.542000 0.000000
1000.000000 0.398000 0.000000
2000.000000 0.150000 0.000000
3000.000000 0.055000 0.000000
5000.000000 0.010000 0.000000
7000.000000 0.001000 0.000000
10000.000000 0.000000 0.000000

0 comments on commit 87a9bbf

Please sign in to comment.