From 01485754dcf4c1a4de662556716785f4eda5b876 Mon Sep 17 00:00:00 2001
From: Lars Hubatsch <hubatsch@pks.mpg.de>
Date: Mon, 9 Aug 2021 08:47:08 +0200
Subject: [PATCH] Update plots for revisions at eLife.

New plot for PLYS ATP spatial recovery.
New plot for boundary condition PGL
New plot for valley in cost function
New plot for relative partition coefficient
---
 Plots_Droplet_FRAP.ipynb | 102 +++++++++++++++++++++++++++++++++++++--
 1 file changed, 97 insertions(+), 5 deletions(-)

diff --git a/Plots_Droplet_FRAP.ipynb b/Plots_Droplet_FRAP.ipynb
index 15f06f2..e1b65c3 100644
--- a/Plots_Droplet_FRAP.ipynb
+++ b/Plots_Droplet_FRAP.ipynb
@@ -36,7 +36,8 @@
     "dark_grey = (0.2, 0.2, 0.2)\n",
     "green = pa[0]\n",
     "blue = pa[2]\n",
-    "red = pa[1]"
+    "red = pa[1]\n",
+    "pink = (233/255, 72/255, 119/255)"
    ]
   },
   {
@@ -500,7 +501,30 @@
     "plt.plot(range(0, 10), np.ones(10)*np.min(CMD_fit[:, 1]), linestyle='--', color=grey, lw=1.5)\n",
     "plt.legend([l_sim[0], l_fit[0]], ['data', 'fit'], ncol=2, loc=(0, 0.85), frameon=False)\n",
     "nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity [a.u.]', [0,np.max(CMD_fit[:, 0])], [0,0.65], [2.3,2])\n",
-    "save_nice_fig(fol+'Fig1/CMD_spat_recov.pdf')"
+    "# save_nice_fig(fol+'Fig1/CMD_spat_recov.pdf')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "**Panel: time course PLYS**"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "PLYS = np.loadtxt(fol+'/Fig1/PLYS_timecourse_D.csv', delimiter=',')\n",
+    "PLYS_fit = np.loadtxt(fol+'/Fig1/PLYS_fit_timecourse_D.csv', delimiter=',')\n",
+    "l_sim = plt.plot(PLYS[:, 0], PLYS[:, 1::40], '.', c=blue)\n",
+    "l_fit = plt.plot(PLYS_fit[:, 0], PLYS_fit[:, 1::40], '-', lw=1, c='k')\n",
+    "plt.plot(range(0, 10), np.ones(10)*np.min(PLYS_fit[:, 1]), linestyle='--', color=grey, lw=1.5)\n",
+    "plt.legend([l_sim[0], l_fit[0]], ['data', 'fit'], ncol=2, loc=(0, 0.85), frameon=False)\n",
+    "nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity [a.u.]', [0,np.max(PLYS_fit[:, 0])], [0,0.79], [2.3,2])\n",
+    "save_nice_fig(fol+'Fig1/PLYS_spat_recov.pdf')"
    ]
   },
   {
@@ -677,10 +701,24 @@
     "           fontsize=7, handletextpad=0.4, handlelength=0.5, labelspacing=0.1,\n",
     "           loc=(0.3, 0), ncol=2) \n",
     "# plt.xticks([0, 500])\n",
-    "save_nice_fig(fol+'Fig1/tot_recov_PGL.pdf')\n",
+    "# save_nice_fig(fol+'Fig1/tot_recov_PGL.pdf')\n",
     "sns.set_palette(temp)"
    ]
   },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "PGL_bc_ill = np.loadtxt(fol+'/Fig1/PGL_bc_illustr.csv', delimiter=',')\n",
+    "plt.plot(PGL_bc_ill[:, 0], PGL_bc_ill[:, 1], c=pink)\n",
+    "nice_fig('', 'intensity', [0,150], [0,0.55], [2.3,0.75], fs=9)\n",
+    "plt.xticks([0, 150])\n",
+    "plt.tick_params(axis='x', which='major', pad=1)\n",
+    "save_nice_fig(fol+'Fig1/PGL_bc_ill.pdf')"
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -695,6 +733,28 @@
     "save_nice_fig(fol+'Fig1/tot_recov_coac.pdf')"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "**Valley in cost function**"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "PGL_cost = np.loadtxt(fol+'/Fig1/PGL_cost.csv', delimiter=',')\n",
+    "plt.plot(PGL_cost[:, 0], 100000*PGL_cost[:, 1], c=red)\n",
+    "nice_fig('$D_\\mathrm{in} \\;[\\mathrm{\\mu m^2\\cdot s^{-1}}]$', '$cost$ [a.u.]', [0.8,1.5], [0,5.5], [2.3,2], fs=12)\n",
+    "plt.xticks([1, 1.2, 1.4])\n",
+    "plt.tick_params(axis='x', which='major', pad=1)\n",
+    "plt.legend(['Sample PGL-3 droplet'], loc=(0, 0.85), frameon=False)\n",
+    "# save_nice_fig(fol+'Fig1/PGL_cost.pdf')"
+   ]
+  },
   {
    "cell_type": "markdown",
    "metadata": {},
@@ -1014,7 +1074,7 @@
     "plt.legend([ls[7], ls[6],ls[5]], ['180 mM', '150 mM', '120 mM'], labelspacing=0.3,\n",
     "           loc=(0, 0.66), handletextpad=0.4, handlelength=0.5, frameon=0)\n",
     "plt.gca().add_artist(leg1)\n",
-    "save_nice_fig(fol+'Fig4/PGL-3.pdf')\n",
+    "# save_nice_fig(fol+'Fig4/PGL-3.pdf')\n",
     "sns.set_palette(temp)"
    ]
   },
@@ -1066,7 +1126,39 @@
     "#          color=red, size=8)\n",
     "# plt.text(54, 700, '$D_\\mathrm{out}=15\\;\\mathrm{\\mu m^2/s}$',\n",
     "#          color=red, size=8)\n",
-    "save_nice_fig(fol+'Fig4/PGL-3_part.pdf')"
+    "# save_nice_fig(fol+'Fig4/PGL-3_part.pdf')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "P = PGL_50['P']\n",
+    "def i_P(df, Pa):\n",
+    "    return interp1d(np.array(df.groupby('P').mean()).flatten(),\n",
+    "                    P.unique())(Pa)\n",
+    "\n",
+    "# def i_P_std(df, Pa):\n",
+    "#     return interp1d(np.array(df.groupby('P').std()).flatten(),\n",
+    "#                     P.unique())(Pa)\n",
+    "Ps_10 = [i_P(PGL, 10) for PGL in [PGL_50, PGL_60, PGL_75, PGL_90,\n",
+    "                           PGL_100, PGL_120, PGL_150, PGL_180]]\n",
+    "# Ps_10_std = [i_P_std(PGL, 10) for PGL in [PGL_50, PGL_60, PGL_75, PGL_90,\n",
+    "#                            PGL_100, PGL_120, PGL_150, PGL_180]]\n",
+    "salts = [50, 60, 75, 90, 100, 120, 150, 180]\n",
+    "salts = [50, 60, 75, 90, 100, 120, 150, 180]\n",
+    "nice_fig('$c_\\mathrm{salt} \\; [\\mathrm{mM}]$', '$P$ / $P(c_\\mathrm{salt}=50mM)$',\n",
+    "         [50, 180], [0,1], [2.3,2])\n",
+    "# plt.plot(salts, Ps_2/Ps_2[0], color=red, label='$D_{\\mathrm{out}}=2$')\n",
+    "plt.plot(salts, Ps_10/Ps_10[0], color=green, label='$D_{\\mathrm{out}}=10$')\n",
+    "# plt.plot(salts, Ps_50/Ps_50[0], color=blue, label='$D_{\\mathrm{out}}=50$')\n",
+    "plt.yticks(rotation=45)\n",
+    "# plt.yscale('log')\n",
+    "# plt.legend(frameon=False, ncol=2, columnspacing=0.2, handletextpad=0.1,\n",
+    "#           labelspacing=0.2, loc=(0.005, -0.02), handlelength=0.5)\n",
+    "save_nice_fig(fol+'Fig4/PGL-3_relative_part.pdf')"
    ]
   },
   {
-- 
GitLab