In [21]:
import os
import sys
import random
import time
from random import seed, randint
import argparse
import platform
from datetime import datetime
import imp
import numpy as np
import fileinput
from itertools import product
import pandas as pd
from scipy.interpolate import griddata
from scipy.interpolate import interp2d
import seaborn as sns
from os import listdir

import matplotlib.pyplot as plt
import seaborn as sns
from scipy.interpolate import griddata
import matplotlib as mpl
sys.path.insert(0,'..')
from notebookFunctions import *
import scipy
# from .. import notebookFunctions

%matplotlib inline
plt.rcParams['figure.figsize'] = (10,6.180)    #golden ratio
# %matplotlib notebook
%load_ext autoreload
%autoreload 2


The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload

Expected Energy

56_z_dis

Go and Lipid afffect the barrier from native to transition state


In [50]:
pre = "/Users/weilu/Research/server/aug_2018/02_week"
temp = 370
location = pre + "/freeEnergy/combined_more_force/_280-350/56_z_dis/force_0.1/"
location2 = location + f"perturbation-1-pmf-{temp}.dat"  # perturbation 1 is 20% here
zmax=25
res=40
path_origin, f_origin = shortest_path_2(location2, start=(35,21), end=(5, 35),save=True, title="56_z_dis", xlabel="Z56", ylabel="Dis56", zmax=zmax,res=res)
# print(getBound(location2, res=res, zmax=zmax))
xmin,xmax,ymin,ymax = getBound(location2, res=res, zmax=zmax)
# plt.savefig("/Users/weilu/Dropbox/GlpG_paper_2018/figures/56_z_dis_1d.png", dpi=300)


Go


In [51]:
location3 = location + f"perturbation-1-evpb-{temp}.dat"
path = path_origin
outname = "/Users/weilu/Desktop/56_2d_expected_energy_go.png"
f = plot2d(location3, path, zmin=-800, zmax=120, 
                    res=res, xlabel="z_h56", ylabel="Dis_h56",
                   xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax, outname=outname)
x = np.arange(len(f))
x_smooth = np.linspace(x.min(), x.max(), 200)
spl1 = scipy.interpolate.interp1d(x, f_origin, kind="cubic")
# plt.plot(x_smooth1, spl1(x_smooth1))

spl = scipy.interpolate.interp1d(x, f, kind="cubic")
# plt.plot(x_smooth, spl(x_smooth))
# Create axes
fig, ax = plt.subplots()
ax1, ax2 = two_scales(ax, x_smooth, spl1(x_smooth), spl(x_smooth), 'r', 'b')
ax.set_ylim(0,20)
color_y_axis(ax1, 'r')
color_y_axis(ax2, 'b')
# plt.show()
plt.savefig("/Users/weilu/Desktop/56_1d_expected_energy_go.png")


<matplotlib.colors.LinearSegmentedColormap object at 0x1a14362588>

Lipid


In [52]:
location3 = location + f"perturbation-1-evpb-{temp}.dat"
path = path_origin
name = "lipid"
outname = f"/Users/weilu/Desktop/56_2d_expected_energy_{name}.png"
f = plot2d(location3, path, zmin=-800, zmax=120, z=4,
                    res=res, xlabel="z_h56", ylabel="Dis_h56",
                   xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax, outname=outname)
x = np.arange(len(f))
x_smooth = np.linspace(x.min(), x.max(), 200)
spl1 = scipy.interpolate.interp1d(x, f_origin, kind="cubic")
# plt.plot(x_smooth1, spl1(x_smooth1))

spl = scipy.interpolate.interp1d(x, f, kind="cubic")
# plt.plot(x_smooth, spl(x_smooth))
# Create axes
fig, ax = plt.subplots()
ax1, ax2 = two_scales(ax, x_smooth, spl1(x_smooth), spl(x_smooth), 'r', 'b')
ax.set_ylim(0,20)
color_y_axis(ax1, 'r')
color_y_axis(ax2, 'b')
# plt.show()
plt.savefig(f"/Users/weilu/Desktop/56_1d_expected_energy_{name}.png")


<matplotlib.colors.LinearSegmentedColormap object at 0x1a14362588>

Membrane


In [53]:
location3 = location + f"perturbation-1-evpb-{temp}.dat"
path = path_origin
name = "membrane"
outname = f"/Users/weilu/Desktop/56_2d_expected_energy_{name}.png"
f = plot2d(location3, path, zmin=-800, zmax=120, z=5,
                    res=res, xlabel="z_h56", ylabel="Dis_h56",
                   xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax, outname=outname)
x = np.arange(len(f))
x_smooth = np.linspace(x.min(), x.max(), 200)
spl1 = scipy.interpolate.interp1d(x, f_origin, kind="cubic")
# plt.plot(x_smooth1, spl1(x_smooth1))

spl = scipy.interpolate.interp1d(x, f, kind="cubic")
# plt.plot(x_smooth, spl(x_smooth))
# Create axes
fig, ax = plt.subplots()
ax1, ax2 = two_scales(ax, x_smooth, spl1(x_smooth), spl(x_smooth), 'r', 'b')
ax.set_ylim(0,20)
color_y_axis(ax1, 'r')
color_y_axis(ax2, 'b')
# plt.show()
plt.savefig(f"/Users/weilu/Desktop/56_1d_expected_energy_{name}.png")


<matplotlib.colors.LinearSegmentedColormap object at 0x1a14362588>

Rg


In [54]:
location3 = location + f"perturbation-1-evpb-{temp}.dat"
path = path_origin
name = "rg"
outname = f"/Users/weilu/Desktop/56_2d_expected_energy_{name}.png"
f = plot2d(location3, path, zmin=-800, zmax=120, z=6,
                    res=res, xlabel="z_h56", ylabel="Dis_h56",
                   xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax, outname=outname)
x = np.arange(len(f))
x_smooth = np.linspace(x.min(), x.max(), 200)
spl1 = scipy.interpolate.interp1d(x, f_origin, kind="cubic")
# plt.plot(x_smooth1, spl1(x_smooth1))

spl = scipy.interpolate.interp1d(x, f, kind="cubic")
# plt.plot(x_smooth, spl(x_smooth))
# Create axes
fig, ax = plt.subplots()
ax1, ax2 = two_scales(ax, x_smooth, spl1(x_smooth), spl(x_smooth), 'r', 'b')
ax.set_ylim(0,20)
color_y_axis(ax1, 'r')
color_y_axis(ax2, 'b')
# plt.show()
plt.savefig(f"/Users/weilu/Desktop/56_1d_expected_energy_{name}.png")


<matplotlib.colors.LinearSegmentedColormap object at 0x1a14362588>

2d_zAverage_dis

Go and Lipid afffect the barrier from native to transition state


In [44]:
pre = "/Users/weilu/Research/server/aug_2018/02_week"
temp = 370
location = pre + "/freeEnergy/combined_more_force/_280-350/2d_zAverage_dis/force_0.1/"
location2 = location + f"perturbation-1-pmf-{temp}.dat"  # perturbation 1 is 20% here
zmax=25
res=40
path_origin, f_origin = shortest_path_2(location2, start=(18, 30), end=(29,1),save=False, xlabel="Distance", ylabel="AverageZ", zmax=zmax,res=res)
# print(getBound(location2, res=res, zmax=zmax))
xmin,xmax,ymin,ymax = getBound(location2, res=res, zmax=zmax)


Go


In [45]:
location3 = location + f"perturbation-1-evpb-{temp}.dat"
path = path_origin
outname = "/Users/weilu/Desktop/2d_expected_energy_go.png"
f = plot2d(location3, path, zmin=-800, zmax=120, 
                    res=res, xlabel="Distance", ylabel="AverageZ",
                   xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax, outname=outname)
x = np.arange(len(f))
x_smooth = np.linspace(x.min(), x.max(), 200)
spl1 = scipy.interpolate.interp1d(x, f_origin, kind="cubic")
# plt.plot(x_smooth1, spl1(x_smooth1))

spl = scipy.interpolate.interp1d(x, f, kind="cubic")
# plt.plot(x_smooth, spl(x_smooth))
# Create axes
fig, ax = plt.subplots()
ax1, ax2 = two_scales(ax, x_smooth, spl1(x_smooth), spl(x_smooth), 'r', 'b')
ax.set_ylim(0,20)
color_y_axis(ax1, 'r')
color_y_axis(ax2, 'b')
# plt.show()
plt.savefig("/Users/weilu/Desktop/1d_expected_energy_go.png")


<matplotlib.colors.LinearSegmentedColormap object at 0x1a14362588>

Lipid


In [46]:
location3 = location + f"perturbation-1-evpb-{temp}.dat"
path = path_origin
name = "lipid"
outname = f"/Users/weilu/Desktop/2d_expected_energy_{name}.png"
f = plot2d(location3, path, zmin=-800, zmax=120, z=4,
                    res=res, xlabel="Distance", ylabel="AverageZ",
                   xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax, outname=outname)
x = np.arange(len(f))
x_smooth = np.linspace(x.min(), x.max(), 200)
spl1 = scipy.interpolate.interp1d(x, f_origin, kind="cubic")
# plt.plot(x_smooth1, spl1(x_smooth1))

spl = scipy.interpolate.interp1d(x, f, kind="cubic")
# plt.plot(x_smooth, spl(x_smooth))
# Create axes
fig, ax = plt.subplots()
ax1, ax2 = two_scales(ax, x_smooth, spl1(x_smooth), spl(x_smooth), 'r', 'b')
ax.set_ylim(0,20)
color_y_axis(ax1, 'r')
color_y_axis(ax2, 'b')
# plt.show()
plt.savefig(f"/Users/weilu/Desktop/1d_expected_energy_{name}.png")


<matplotlib.colors.LinearSegmentedColormap object at 0x1a14362588>

Membrane


In [47]:
location3 = location + f"perturbation-1-evpb-{temp}.dat"
path = path_origin
name = "membrane"
outname = f"/Users/weilu/Desktop/2d_expected_energy_{name}.png"
f = plot2d(location3, path, zmin=-800, zmax=120, z=5,
                    res=res, xlabel="Distance", ylabel="AverageZ",
                   xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax, outname=outname)
x = np.arange(len(f))
x_smooth = np.linspace(x.min(), x.max(), 200)
spl1 = scipy.interpolate.interp1d(x, f_origin, kind="cubic")
# plt.plot(x_smooth1, spl1(x_smooth1))

spl = scipy.interpolate.interp1d(x, f, kind="cubic")
# plt.plot(x_smooth, spl(x_smooth))
# Create axes
fig, ax = plt.subplots()
ax1, ax2 = two_scales(ax, x_smooth, spl1(x_smooth), spl(x_smooth), 'r', 'b')
ax.set_ylim(0,20)
color_y_axis(ax1, 'r')
color_y_axis(ax2, 'b')
# plt.show()
plt.savefig(f"/Users/weilu/Desktop/1d_expected_energy_{name}.png")


<matplotlib.colors.LinearSegmentedColormap object at 0x1a14362588>

Rg


In [48]:
location3 = location + f"perturbation-1-evpb-{temp}.dat"
path = path_origin
name = "rg"
outname = f"/Users/weilu/Desktop/2d_expected_energy_{name}.png"
f = plot2d(location3, path, zmin=-800, zmax=120, z=6,
                    res=res, xlabel="Distance", ylabel="AverageZ",
                   xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax, outname=outname)
x = np.arange(len(f))
x_smooth = np.linspace(x.min(), x.max(), 200)
spl1 = scipy.interpolate.interp1d(x, f_origin, kind="cubic")
# plt.plot(x_smooth1, spl1(x_smooth1))

spl = scipy.interpolate.interp1d(x, f, kind="cubic")
# plt.plot(x_smooth, spl(x_smooth))
# Create axes
fig, ax = plt.subplots()
ax1, ax2 = two_scales(ax, x_smooth, spl1(x_smooth), spl(x_smooth), 'r', 'b')
ax.set_ylim(0,20)
color_y_axis(ax1, 'r')
color_y_axis(ax2, 'b')
# plt.show()
plt.savefig(f"/Users/weilu/Desktop/1d_expected_energy_{name}.png")


<matplotlib.colors.LinearSegmentedColormap object at 0x1a14362588>

In [ ]:


In [ ]:


In [ ]: