In [1]:
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 *
# from .. import notebookFunctions
%matplotlib inline
plt.rcParams['figure.figsize'] = (10,6.180) #golden ratio
# %matplotlib notebook
%load_ext autoreload
%autoreload 2
In [27]:
pre = "/Users/weilu/Research/server/mar_2018/05_week/"
temp = 280
location = pre + "/eighth_with_real_distance/_280-350/2d_z_qw/force_0.0/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(4, 14), block=[-20,-10,0.6,0.7], end=(26,22), plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location2 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location2, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# # plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
Out[27]:
In [31]:
pre = "/Users/weilu/Research/server/mar_2018/05_week/"
temp = 280
location = pre + "/eighth_with_real_distance/_280-350/2d_z_qw/force_0.2/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(4, 14), block=[-20,-10,0.55,0.7], end=(26,22), plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location2 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location2, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# # plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
Out[31]:
In [36]:
data = pd.read_feather("/Users/weilu/Research/server/mar_2018/eighth/rg_0.15_lipid_1.0_mem_1_go_0.8/rerun_1_27_Mar_231139.feather")
dic = {"T0":280, "T1":290, "T2":300, "T3":310, "T4":320, "T5":335, "T6":350, "T7":365, "T8":380, "T9":410, "T10":440, "T11":470}
a = data
a["Temp"] = a["Temp"].apply(lambda x: dic[x])
t = a.query("Temp < 400").groupby(["BiasTo","Temp"])[["DisReal","Run"]].mean().reset_index()
t["Diff"] = t["DisReal"]-t["BiasTo"].apply(pd.to_numeric)
t["BiasTo"] = t["BiasTo"].apply(pd.to_numeric)
fg = sns.FacetGrid(data=t, hue='Temp', size=8, aspect=1.61)
fg.map(plt.scatter, 'BiasTo', 'Diff').add_legend()
Out[36]:
In [37]:
# rerun 1
data.query("z_h6 < -20 and Qw > 0.25 and Qw < 0.35").plot.hexbin("DisReal", "TotalE", cmap="seismic", sharex=False)
Out[37]:
In [32]:
data = pd.read_feather("/Users/weilu/Research/server/mar_2018/eighth/rg_0.15_lipid_1.0_mem_1_go_0.8/rerun_3_27_Mar_231139.feather")
dic = {"T0":280, "T1":290, "T2":300, "T3":310, "T4":320, "T5":335, "T6":350, "T7":365, "T8":380, "T9":410, "T10":440, "T11":470}
a = data
a["Temp"] = a["Temp"].apply(lambda x: dic[x])
t = a.query("Temp < 400").groupby(["BiasTo","Temp"])[["DisReal","Run"]].mean().reset_index()
t["Diff"] = t["DisReal"]-t["BiasTo"].apply(pd.to_numeric)
t["BiasTo"] = t["BiasTo"].apply(pd.to_numeric)
fg = sns.FacetGrid(data=t, hue='Temp', size=8, aspect=1.61)
fg.map(plt.scatter, 'BiasTo', 'Diff').add_legend()
Out[32]:
In [78]:
a = np.loadtxt("/Users/weilu/Research/server/apr_2018/TMHC2/test/rnative.dat")
In [79]:
a.shape
Out[79]:
In [108]:
a.min()
Out[108]:
In [81]:
plt.imshow(a)
Out[81]:
In [82]:
table = {"A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V"}
In [86]:
scTMHC2_seq = "MTRTEIIRELERSLRLQLVLAIFLMALLIVLLWLQQNGSSNNNVNYLLIVILVLVLVIVALAVIQKYLVEQLKRQADPTDDSRTEIIRELERSLRLQLVLAIFLMALLIVLLWLQQNGSSNNNVNYLLIVILVLVLVIVALAVTQKYLVEQLKRQD"
In [88]:
t = "MTRTEIIRELERSLRLQLVLAIFLMALLIVLLWLQQNGSSNNNVNYLLIVILVLVLVIVALAVIQKYLVEQLKRQADPTDDSRTEIIRELERSLRLQLVLAIFLMALLIVLLWLQQNGSSNNNVNYLLIVILVLVLVIVALAVTQKYLVEQLKRQD"
In [98]:
list(set(t))
Out[98]:
In [106]:
"G"*156
Out[106]:
In [89]:
scTMHC2_seq == t
Out[89]:
In [100]:
from collections import defaultdict
In [101]:
>>> s = t
>>> d = defaultdict(int)
>>> for k in s:
... d[k] += 1
...
>>> d.items()
Out[101]:
In [ ]:
for i in scTMHC2_seq:
dic[i] += 1
In [91]:
for i in scTMHC2_seq:
if i not in table:
print(i)
In [75]:
start = 2
end = 38
helix1 = " ".join([str(i) for i in list(range(start*3-2, end*3+1))])
start = 43
end = 75
helix2 = " ".join([str(i) for i in list(range(start*3-2, end*3+1))])
start = 80
end = 117
helix3 = " ".join([str(i) for i in list(range(start*3-2, end*3+1))])
start = 123
end = 154
helix4 = " ".join([str(i) for i in list(range(start*3-2, end*3+1))])
In [76]:
print(helix1)
print(helix2)
print(helix3)
print(helix4)
In [33]:
# rerun 3
data.query("z_h6 < -20 and Qw > 0.25 and Qw < 0.35").plot.hexbin("DisReal", "TotalE", cmap="seismic", sharex=False)
Out[33]:
In [35]:
data.query("z_h6 < -20 and Qw > 0.25 and Qw < 0.35").plot.hexbin("DisReal", "TotalE", cmap="seismic", sharex=False)
Out[35]:
In [34]:
data = pd.read_feather("/Users/weilu/Research/server/mar_2018/eighth/force_0.03_rg_0.15_lipid_1.0_mem_1_go_0.8/rerun_3_30_Mar_135549.feather")
dic = {"T0":280, "T1":290, "T2":300, "T3":310, "T4":320, "T5":335, "T6":350, "T7":365, "T8":380, "T9":410, "T10":440, "T11":470}
a = data
a["Temp"] = a["Temp"].apply(lambda x: dic[x])
t = a.query("Temp < 400").groupby(["BiasTo","Temp"])[["DisReal","Run"]].mean().reset_index()
t["Diff"] = t["DisReal"]-t["BiasTo"].apply(pd.to_numeric)
t["BiasTo"] = t["BiasTo"].apply(pd.to_numeric)
fg = sns.FacetGrid(data=t, hue='Temp', size=8, aspect=1.61)
fg.map(plt.scatter, 'BiasTo', 'Diff').add_legend()
Out[34]:
In [ ]:
In [133]:
plt.plot(range(len(f)), i235d,range(len(f)), orignal_2, range(len(f)), i255d)
Out[133]:
In [112]:
origianl = f
In [132]:
pre = "/Users/weilu/Research/server/apr_2018/01_week/"
temp = 260
location = pre + "/sixth_i235d/_280-350/2d_z_qw/force_0.2/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 14), plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
# location2 = location + f"evpb-{temp}.dat"
# (xi,yi,zi) = plot2d(location2, zmax=100)
# plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# # plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
# plt.figure()
# f_on_path = [zi[tuple(p)] for p in reversed(path)]
# plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
i235d = f
In [22]:
pre = "/Users/weilu/Research/server/apr_2018/01_week/"
temp = 260
location = pre + "/sixth_orignal/_280-350/2d_z_qw/force_0.2/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 14), plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
# location2 = location + f"evpb-{temp}.dat"
# (xi,yi,zi) = plot2d(location2, zmax=100)
# plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# # plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
# plt.figure()
# f_on_path = [zi[tuple(p)] for p in reversed(path)]
# plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
orignal_2 = f
In [31]:
pre = "/Users/weilu/Research/server/apr_2018/01_week/"
temp = 260
location = pre + "/sixth_orignal/_280-350/2d_z_qw/force_0.4/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 14), plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
# location2 = location + f"evpb-{temp}.dat"
# (xi,yi,zi) = plot2d(location2, zmax=100)
# plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# # plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
# plt.figure()
# f_on_path = [zi[tuple(p)] for p in reversed(path)]
# plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
In [4]:
pre = "/Users/weilu/Research/server/apr_2018/01_week/"
temp = 260
location = pre + "/sixth_i255d/_280-350/2d_z_qw/force_0.2/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 14), plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
# location2 = location + f"evpb-{temp}.dat"
# (xi,yi,zi) = plot2d(location2, zmax=100)
# plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# # plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
# plt.figure()
# f_on_path = [zi[tuple(p)] for p in reversed(path)]
# plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
i255d = f
In [25]:
pre = "/Users/weilu/Research/server/mar_2018/05_week/"
temp = 260
location = pre + "/sixth_i235d/_280-350/2d_z_qw/force_0.2/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 14), plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location2 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location2, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
In [262]:
t = np.loadtxt(location2)
In [263]:
tt = np.where(np.isnan(t), 32, t)
In [259]:
t = t[~np.isnan(t).any(axis=1)]
In [264]:
plt.scatter(tt[:,1], tt[:,2], tt[:,3])
Out[264]:
In [238]:
plt.scatter(t[:,1], t[:,2], t[:,3])
Out[238]:
In [269]:
pre = "/Users/weilu/Research/server/mar_2018/05_week"
temp = 260
location = pre + "/sixth_i235d/_280-350/2d_z_qw/force_0.2/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 14), plot1d=True, save=False, zmax=32)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
# location2 = location + f"evpb-{temp}.dat"
# (xi,yi,zi) = plot2d(location2, zmax=100)
# plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# # plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
# plt.figure()
# f_on_path = [zi[tuple(p)] for p in reversed(path)]
# plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
In [329]:
t = np.loadtxt(location2)
In [333]:
plt.scatter(t[:,1], t[:,2], t[:,3])
Out[333]:
In [339]:
tt
Out[339]:
In [342]:
res = 30
xi = np.linspace(min(t[:,1]), max(t[:,1]), res)
yi = np.linspace(min(t[:,2]), max(t[:,2]), res)
In [344]:
yi
Out[344]:
In [341]:
xi
Out[341]:
In [356]:
mask = np.ones((res,res))*32
zi = t[:,3]
index_list = t[:,0]
count = 0
for i in range(res):
for j in range(res):
pos = i*res + j
if count < len(index_list):
if pos == int(index_list[count]):
mask[i][j] = zi[count]
count += 1
In [359]:
plt.imshow(mask.T)
Out[359]:
In [353]:
index_li
Out[353]:
In [338]:
t = np.loadtxt(location2)
tt = np.where(np.isnan(t), 32, t)
# t = t[~np.isnan(t).any(axis=1)]
t = tt
plt.scatter(t[:,1], t[:,2], c=t[:,3], cmap="jet")
plt.colorbar()
Out[338]:
In [223]:
pre = "/Users/weilu/Research/server/apr_2018/01_week"
temp = 330
location = pre + "/ninth_freeEnergy_7_less_temp/_280-350/2d_z_qw/force_0.0/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), block=[-15,-10,0.0,0.1], plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
Out[223]:
In [209]:
pre = "/Users/weilu/Research/server/apr_2018/01_week"
temp = 350
location = pre + "/ninth_freeEnergy_7_less_temp/_280-350/2d_z_qw/force_0.0/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), block=[-15,-10,0.0,0.1], plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
Out[209]:
In [102]:
pre = "/Users/weilu/Research/server/apr_2018/01_week"
temp = 300
location = pre + "/ninth_freeEnergy_5_less_temp/_280-350/2d_z_qw/less_bias_force_0.1/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), block=[-15,-10,0.0,0.1], plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
Out[102]:
In [89]:
pre = "/Users/weilu/Research/server/apr_2018/01_week"
temp = 300
location = pre + "/ninth_freeEnergy_5_less_temp/_280-350/2d_z_qw/quick/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), block=[-15,-10,0.0,0.1], plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
Out[89]:
In [95]:
pre = "/Users/weilu/Research/server/apr_2018/01_week"
temp = 300
location = pre + "/ninth_freeEnergy_5/_280-350/2d_z_qw/force_0.1/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), block=[-15,-10,0.0,0.1], plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
Out[95]:
In [20]:
pre = "/Users/weilu/Research/server/apr_2018/01_week"
temp = 320
location = pre + "/ninth_freeEnergy_5_less_temp/_280-350/2d_z_qw/force_0.0/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), block=[-15,-10,0.0,0.2], plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
Out[20]:
In [379]:
pre = "/Users/weilu/Research/server/apr_2018/01_week"
temp = 300
location = pre + "/ninth_freeEnergy_5_less_temp/_280-350/2d_z_qw/high_temp/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), block=[-15,-10,0.0,0.1], plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location3 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location3, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
Out[379]:
In [321]:
pre = "/Users/weilu/Research/server/apr_2018/01_week"
temp = 290
location = pre + "/ninth_freeEnergy_5_less_temp/_280-350/2d_z_qw/force_0.0/"
location2 = location + f"pmf-{temp}.dat"
path, f = shortest_path(location2, start=(1, 10), block=[-20,-15,0.6,0.7], plot1d=True, save=False)
# plt.savefig("/Users/weilu/papers/figures/2d_z6_qw.png", dpi=300)
# plt.savefig("/Users/weilu/papers/figures/shortest_path.png", dpi=300)
location2 = location + f"evpb-{temp}.dat"
(xi,yi,zi) = plot2d(location2, zmax=100)
plt.plot(xi[path[:,1]], yi[path[:,0]], 'r.-')
# plt.savefig("/Users/weilu/papers/figures/2d_expected_dis.png", dpi=300)
plt.figure()
f_on_path = [zi[tuple(p)] for p in reversed(path)]
plt.plot(f_on_path)
# plt.savefig("/Users/weilu/papers/figures/shortest_path_expected_dis.png", dpi=300)
Out[321]:
In [ ]:
block = (0.6, )
In [173]:
np.searchsorted(xi, 20)
Out[173]:
In [172]:
xi
Out[172]:
In [122]:
data = pd.read_feather("/Users/weilu/Research/server/mar_2018/ninth/force_0.06_rg_0.15_lipid_1.0_mem_1_go_0.8/rerun_7_04_Apr_231330.feather")
dic = {"T0":280, "T1":290, "T2":300, "T3":310, "T4":320, "T5":335, "T6":350, "T7":365, "T8":380, "T9":410, "T10":440, "T11":470}
a = data
a["Temp"] = a["Temp"].apply(lambda x: dic[x])
In [123]:
rerun7 = data
# data["BiasTo"] = data["BiasTo"].apply(pd.to_numeric)
In [124]:
data.query("Temp == 300").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)
Out[124]:
In [154]:
data.query("Temp == 300 and DisReal > 60").shape
Out[154]:
In [125]:
data.query("Temp == 300").plot.hexbin("TotalE", "Qw", cmap="seismic", sharex=False)
Out[125]:
In [139]:
data.query("Temp == 300 and Qw > 0.6").plot.hexbin("TotalE", "DisReal", cmap="seismic", sharex=False)
Out[139]:
In [134]:
data.query("Temp == 300 and Qw > 0.6")["TotalE"].hist(bins=50)
data.query("Temp == 300 and Qw > 0.6")["TotalE"].mean()
Out[134]:
In [148]:
data.query("Temp == 300 and z_h6 < -10 and Qw > 0.3").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)
Out[148]:
In [164]:
data.query("Temp == 300 and Qw < 0.6")["z_h6"].hist(bins=50)
Out[164]:
In [203]:
data.query("Temp == 300 and Qw > 0.3 and z_h6 < -10 and DisReal > 60")["TotalE"].hist(bins=50)
print(data.query("Temp == 300 and Qw > 0.3 and z_h6 < -10 and DisReal > 60")["TotalE"].mean())
data.query("Temp == 300 and Qw > 0.3 and z_h6 < -10 and DisReal > 60").shape
Out[203]:
In [204]:
data.query("Temp == 300 and z_h6 > -10 and Qw > 0.3 and DisReal > 60")["TotalE"].hist(bins=50)
print(data.query("Temp == 300 and z_h6 > -10 and Qw > 0.3 and DisReal > 60").shape)
data.query("Temp == 300 and z_h6 > -10 and Qw > 0.3 and DisReal > 60")["TotalE"].mean()
Out[204]:
In [195]:
t = data.query("Temp == 300 and z_h6 > -10 and Qw > 0.3 and DisReal > 60")
t.groupby(["BiasTo", "Run"])["Qw"].describe().query("count > 100")
Out[195]:
In [190]:
data.query("Temp == 300 and z_h6 > -10 and Qw < 0.6 and DisReal < 60")["TotalE"].hist(bins=50)
data.query("Temp == 300 and z_h6 > -10 and Qw < 0.6 and DisReal < 60")["TotalE"].mean()
Out[190]:
In [206]:
t = data.query("Temp == 300 and z_h6 > -10 and Qw < 0.6 and DisReal < 60")
t.groupby(["BiasTo", "Run"])["TotalE"].describe().query("count > 100")
Out[206]:
In [205]:
t = data.query("Temp == 300 and z_h6 > -10 and Qw < 0.6 and DisReal < 60")
t.groupby(["BiasTo", "Run"])["Qw"].describe().query("count > 100")
Out[205]:
In [197]:
data.query("Temp == 300 and z_h6 > -10 and Qw > 0.3 and DisReal < 60")["Qw"].hist(bins=50)
data.query("Temp == 300 and z_h6 > -10 and Qw > 0.3 and DisReal < 60")["Qw"].mean()
Out[197]:
In [ ]:
t = data.query("Temp == 300 and z_h6 < -10 and Qw > 0.3")
t.groupby(["BiasTo", "Run"])["Qw"].describe().query("count > 100")
In [149]:
t = data.query("Temp == 300 and z_h6 < -10 and Qw > 0.3")
t.groupby(["BiasTo", "Run"])["Qw"].describe().query("count > 100")
Out[149]:
In [145]:
data.query("Temp == 300 and z_h6 < -10 and Qw > 0.3").plot.hexbin("z_h4", "Qw", cmap="seismic", sharex=False)
Out[145]:
In [6]:
t = data.query("Temp < 350 and DisReal > 60 and Qw > 0.18")
t.hist("Lipid1")
Out[6]:
In [9]:
data.query("Temp < 350").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)
Out[9]:
In [20]:
rerun7.query("Temp < 350")["Step"].count()
Out[20]:
In [17]:
t = rerun5.query("Temp < 350 and DisReal > 60 and Qw > 0.18 and Lipid1 > -1")
t["Step"].count()
Out[17]:
In [18]:
t = rerun7.query("Temp < 350 and DisReal > 60 and Qw > 0.18 and Lipid1 > -1")
t["Step"].count()
Out[18]:
In [10]:
t = data.query("Temp < 350 and DisReal > 60 and Qw > 0.18 and Lipid1 > -1")
t.plot.hexbin("Lipid1", "z_h1", cmap="seismic", sharex=False)
Out[10]:
In [283]:
data.query("Temp < 350 and DisReal > 60 and Qw > 0.18").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)
Out[283]:
In [277]:
data.query("Qw > 0.58").groupby("Temp")["DisReal"].describe()
Out[277]:
In [220]:
t = data.query("z_h6 < -20 and Qw > 0.25 and Qw < 0.35 and DisReal > 60")
t.groupby(["BiasTo", "Run"])["DisReal"].describe().query("count > 100")
Out[220]:
In [216]:
data.query("z_h6 < -20 and Qw > 0.25 and Qw < 0.35 and DisReal > 60").plot.hexbin("z_h4", "TotalE", cmap="seismic", sharex=False)
Out[216]:
In [196]:
data.query("z_h6 < -20 and Qw > 0.25 and Qw < 0.35").hist("DisReal", bins=50)
Out[196]:
In [193]:
data.query("z_h6 < -20 and Qw > 0.25 and Qw < 0.35").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)
Out[193]:
In [40]:
data.query("Temp == 300").plot.hexbin("z_h3", "z_h6", cmap="seismic", sharex=False)
Out[40]:
In [42]:
a = data.query("(z_h3 < -10) or (z_h6 < -10)")
a.query("Temp == 300").plot.hexbin("z_h3", "z_h6", cmap="seismic", sharex=False)
Out[42]:
In [66]:
data.columns
Out[66]:
In [88]:
data.query("Temp <= 300").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)
Out[88]:
In [87]:
data.query("Temp <= 300 and DisReal > 60").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)
Out[87]:
In [91]:
data.columns
Out[91]:
In [94]:
data.query("Temp == 300 and DisReal > 60").plot.hexbin("Lipid1", "Qw", cmap="seismic", sharex=False)
Out[94]:
In [96]:
data.query("Temp == 300").plot.hexbin("abs_z_average", "z_h6", cmap="seismic", sharex=False)
Out[96]:
In [126]:
data.query("Temp == 300 and Qw < 0.6 and DisReal > 60 and Lipid1 > -1").plot.hexbin("abs_z_average", "Qw", cmap="seismic", sharex=False)
Out[126]:
In [130]:
data.query("Temp == 300 and Qw < 0.6 and DisReal > 60").shape
Out[130]:
In [129]:
t = data.query("Temp == 300 and Qw < 0.6 and DisReal > 60 and Lipid1 > -1")
print(t.shape)
t.groupby(["BiasTo", "Run"])["DisReal"].describe().query("count > 500")
Out[129]:
In [128]:
t = data.query("Temp == 300 and Qw < 0.6 and DisReal > 60 and z_h6 < -10")
print(t.shape)
t.groupby(["BiasTo", "Run"])["DisReal"].describe().query("count > 500")
Out[128]:
In [125]:
data.query("Temp == 300 and Qw < 0.6 and DisReal > 60 and z_h6 < -10").plot.hexbin("abs_z_average", "Qw", cmap="seismic", sharex=False)
Out[125]:
In [124]:
data.query("Temp == 300 and Qw < 0.6 and DisReal > 60").plot.hexbin("abs_z_average", "Qw", cmap="seismic", sharex=False)
Out[124]:
In [120]:
t = data.query("Temp == 300 and Qw < 0.6 and Lipid1 < -1 and DisReal < 60")
t.groupby(["BiasTo", "Run"])["DisReal"].describe().query("count > 500")
Out[120]:
In [114]:
data.query("Temp == 300 and Qw < 0.6 and Lipid1 < -1 and DisReal < 60").plot.hexbin("z_h1", "Qw", cmap="seismic", sharex=False)
Out[114]:
In [85]:
data.query("Temp <= 300 and DisReal > 60").plot.hexbin("abs_z_average", "Qw", cmap="seismic", sharex=False)
Out[85]:
In [64]:
data.query("Temp == 300").plot.hexbin("z_h6", "Qw", cmap="seismic", sharex=False)
Out[64]:
In [34]:
a = data.query("(z_h6 > -10 and z_h1 < -10) or (z_h6 < -10 and z_h1 > -10)")
In [ ]:
In [35]:
a.query("Temp == 300").plot.hexbin("z_h1", "z_h6", cmap="seismic", sharex=False)
Out[35]:
In [59]:
rerun1.query("Temp <= 300 and z_h1 < -10")["DisReal"].count()
Out[59]:
In [60]:
rerun1.query("Temp <= 300 and z_h1 < -10").plot.hexbin("DisReal", "z_h6", cmap="seismic", sharex=False)
Out[60]:
In [300]:
rerun5.query("Temp <= 300 and z_h1 < -10").plot.hexbin("DisReal", "z_h6", cmap="seismic", sharex=False)
Out[300]:
In [7]:
data.query("Temp <= 300 and z_h1 < -10").plot.hexbin("DisReal", "z_h6", cmap="seismic", sharex=False)
Out[7]:
In [61]:
data.query("Temp <= 300")["DisReal"].count()
Out[61]:
In [62]:
data.query("Temp <= 300 and z_h1 < -10")["DisReal"].describe()
Out[62]:
In [63]:
data.query("Temp <= 300 and z_h1 < -10").plot.hexbin("DisReal", "z_h6", cmap="seismic", sharex=False)
Out[63]:
In [27]:
data = pd.read_feather("/Users/weilu/Research/server/mar_2018/05_week/unfold_strengthen_h1_h2/03_Apr_233639.feather")
In [76]:
data.query("Steps < 4e7 and Qw > 0.1").plot.hexbin("Steps", "Qw", by="Temp", cmap="cool", sharex=False)
Out[76]:
In [16]:
data.query("Folder == 'force_3_' and Steps < 3e7 and Qw > 0.1").plot.hexbin("Steps", "Qw", by="Temp", cmap="cool", sharex=False)
Out[16]:
In [28]:
data["Run"] = data["Run"].apply(pd.to_numeric)
In [29]:
fg = sns.FacetGrid(data=data.query("Steps < 4e7 and Qw > 0.1 and Folder=='force_6_' and Run ==0"), hue='Run', size=8, aspect=1.61)
fg.map(plt.scatter, 'Steps', 'Qw').add_legend()
Out[29]:
In [77]:
fg = sns.FacetGrid(data=data.query("Steps < 4e7 and Qw > 0.1"), hue='Folder', size=8, aspect=1.61)
fg.map(plt.scatter, 'Steps', 'Qw').add_legend()
Out[77]:
In [79]:
a = data.query("(z_h6 > -10 and z_h1 < -10) or (z_h6 < -10 and z_h1 > -10)")
In [80]:
a.query("Folder == 'force_6_'").plot.hexbin("z_h1", "z_h6", cmap="cool", sharex=False)
Out[80]:
In [15]:
data["Folder"].unique()
Out[15]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: