In [2]:
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 [4]:
data = pd.read_feather("/Users/weilu/Research/server/apr_2018/tenth/force_0.04_rg_0.15_lipid_1.0_mem_1_go_0.8/rerun_5_07_Apr_160809.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])
rerun5 = data
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[4]:
<seaborn.axisgrid.FacetGrid at 0x10e91fbe0>

In [16]:
rerun5.query("Temp == 300 and DisReal > 60").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)


Out[16]:
<matplotlib.axes._subplots.AxesSubplot at 0x11757de48>

In [17]:
rerun3.query("Temp == 300 and DisReal > 60").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)


Out[17]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a2c3b2208>

In [11]:
rerun5.query("Temp == 300 and DisReal > 60 and Qw > 0.3").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)


Out[11]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a2ca0bba8>

In [20]:
rerun5.query("Temp == 300 and DisReal > 60 and Qw > 0.3 and z_h6 < -10").shape


Out[20]:
(3464, 43)

In [14]:
rerun5.query("Temp == 300 and DisReal > 60 and Qw > 0.3").plot.hexbin("z_h6", "z_h4", cmap="seismic", sharex=False)


Out[14]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a2c944320>

In [13]:
rerun3.query("Temp == 300 and DisReal > 60 and Qw > 0.3").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)
rerun3.query("Temp == 300 and DisReal > 60 and Qw > 0.3").shape


Out[13]:
(3636, 43)

In [15]:
rerun3.query("Temp == 300 and DisReal > 60 and Qw > 0.3").plot.hexbin("z_h6", "z_h4", cmap="seismic", sharex=False)


Out[15]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a2c691860>

In [23]:
data = pd.read_feather("/Users/weilu/Research/server/apr_2018/tenth/force_0.02_rg_0.15_lipid_1.0_mem_1_go_0.8/rerun_1_20_Apr_000344.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])
rerun1 = data
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[23]:
<seaborn.axisgrid.FacetGrid at 0x1a2cdff080>

In [24]:
rerun1.query("Temp == 300").plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)


Out[24]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a2ce352e8>

In [37]:
t = rerun1.query("Temp == 300 and DisReal > 45 and Qw < 0.4 and DisReal < 75")
t.plot.hexbin("DisReal", "Qw", cmap="seismic", sharex=False)


Out[37]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a3c79e2b0>

In [42]:
tt = t.query("abs_z_average < 11.5")
tt.plot.hexbin("Qw", "abs_z_average", cmap="seismic", sharex=False)


Out[42]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a3a113860>

In [65]:
tt.groupby(["BiasTo", "Run"])["Lipid10"].describe().query("count > 300")


Out[65]:
count mean std min 25% 50% 75% max
BiasTo Run
46.0 2 307.0 1.100483 0.521423 0.000115 0.791854 1.209133 1.559808 1.731777
52.0 4 342.0 -1.125146 1.994879 -4.033899 -2.956712 -1.926498 1.105971 1.728648
6 397.0 -0.215200 1.958638 -4.186545 -2.336390 0.786614 1.435522 1.732365
9 322.0 1.076904 0.648616 -3.303782 0.808364 1.203760 1.531054 1.732920
54.0 4 358.0 1.156076 0.458808 -1.533562 0.881017 1.251798 1.527541 1.733815
6 335.0 1.208023 0.422083 -0.429662 0.965483 1.280356 1.551169 1.733177
56.0 1 529.0 0.211981 1.712207 -4.085001 0.087656 0.929978 1.414544 1.732974
7 327.0 0.394707 1.789886 -4.319222 0.214255 1.263051 1.584087 1.732456
11 306.0 1.033365 0.539249 0.000060 0.623528 1.180946 1.484359 1.732330
58.0 1 361.0 0.795287 1.174824 -3.867199 0.701712 1.125905 1.441814 1.732448
2 427.0 1.168239 0.441780 0.005996 0.859950 1.264291 1.564245 1.731460
8 583.0 1.147143 0.450542 0.004146 0.821638 1.221955 1.540328 1.732105
60.0 0 400.0 1.072722 0.473012 0.004161 0.724988 1.100843 1.502705 1.733280
1 345.0 1.215116 0.452447 -0.665481 0.938613 1.335236 1.588421 1.732973
7 389.0 1.082562 0.579061 -3.604588 0.817613 1.168691 1.499088 1.729414
62.0 0 448.0 1.153499 0.467108 0.004069 0.837378 1.244259 1.565382 1.732149
2 344.0 1.124096 0.475613 -0.470738 0.768438 1.192928 1.555730 1.733361
4 383.0 1.103671 0.427215 0.014664 0.789999 1.146137 1.468943 1.731858
10 331.0 0.977196 0.728786 -3.767471 0.626453 1.175013 1.456626 1.733766
64.0 0 345.0 1.041544 0.481060 0.000022 0.680090 1.107818 1.442522 1.730474
3 376.0 1.104232 0.466404 0.005438 0.708311 1.181531 1.512243 1.733544
4 345.0 1.141316 0.467962 -0.050981 0.785967 1.254485 1.533505 1.726407
9 331.0 1.091651 0.422201 0.059568 0.746433 1.190647 1.429166 1.733869
10 303.0 1.101510 0.443183 0.004102 0.759690 1.154904 1.491549 1.731947
66.0 1 425.0 1.010915 0.453327 0.005617 0.672741 1.026784 1.405569 1.723750
2 419.0 1.048867 0.458478 0.004176 0.712369 1.098962 1.434218 1.725665
4 417.0 1.050033 0.474583 -0.829220 0.709973 1.117042 1.431415 1.733695
7 419.0 0.992691 0.449418 0.004150 0.642506 1.016692 1.334435 1.731902
11 440.0 0.962256 0.474617 0.004787 0.569975 0.919888 1.385618 1.732632
68.0 1 424.0 0.996680 0.453562 0.004132 0.649900 1.033319 1.366065 1.726168
2 343.0 0.997502 0.489404 0.003997 0.603924 1.046652 1.421875 1.732561
3 341.0 0.933304 0.480380 0.004047 0.554473 0.948992 1.345829 1.732806
5 420.0 0.992904 0.450506 0.004083 0.641861 0.971343 1.369883 1.733273
70.0 2 385.0 1.007708 0.438575 0.004107 0.659050 1.059179 1.349639 1.732252
9 529.0 1.061283 0.434087 0.004124 0.778561 1.109771 1.394244 1.730972
11 383.0 0.908388 0.619221 -3.073831 0.587010 0.973653 1.334247 1.733416
72.0 0 398.0 0.851358 0.455753 0.004120 0.488230 0.833776 1.222140 1.731829
6 326.0 0.940570 0.469459 0.000041 0.550005 0.960236 1.304825 1.730060
74.0 1 469.0 0.943418 0.464831 0.003972 0.575428 0.949148 1.326310 1.728175
7 450.0 0.920953 0.447867 0.004160 0.548335 0.991817 1.267846 1.724745
76.0 6 422.0 0.821147 0.444181 0.004010 0.476790 0.794802 1.140432 1.728308
78.0 1 350.0 0.800389 0.438231 0.004134 0.441279 0.808085 1.104766 1.728978
6 389.0 0.805171 0.454558 0.004130 0.450802 0.757200 1.204572 1.714245
11 320.0 0.892058 0.460178 0.000183 0.532760 0.927276 1.255698 1.711466
80.0 11 306.0 0.674257 0.410835 0.003873 0.359104 0.624965 0.942253 1.671367
86.0 7 310.0 0.640812 0.421699 0.003945 0.288434 0.586108 0.975633 1.713307

In [31]:
rerun1.columns


Out[31]:
Index(['Step', 'Run', 'Temp', 'Qw', 'Energy', 'DisReal', 'z_average',
       'abs_z_average', 'z_h1', 'z_h2', 'z_h3', 'z_h4', 'z_h5', 'z_h6',
       'Distance', 'AMH-Go', 'Membrane', 'Rg', 'rg1', 'rg2', 'rg3', 'rg4',
       'rg5', 'rg6', 'rg_all', 'Lipid', 'Lipid1', 'Lipid2', 'Lipid3', 'Lipid4',
       'Lipid5', 'Lipid6', 'Lipid7', 'Lipid8', 'Lipid9', 'Lipid10', 'Lipid11',
       'Lipid12', 'Lipid13', 'Lipid14', 'Lipid15', 'TotalE', 'BiasTo'],
      dtype='object')

In [33]:
rerun1.query("Temp == 300").plot.hexbin("Qw", "abs_z_average", cmap="seismic", sharex=False)


Out[33]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a5539a748>

In [27]:
rerun1.query("Temp == 300").plot.hexbin("DisReal", "z_h3", cmap="seismic", sharex=False)


Out[27]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a3b0e22e8>

In [29]:
rerun1.query("Temp == 300").plot.hexbin("DisReal", "z_h6", cmap="seismic", sharex=False)


Out[29]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a2d4de4e0>

In [30]:
rerun1.query("Temp == 300").plot.hexbin("DisReal", "z_h1", cmap="seismic", sharex=False)


Out[30]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a535cc0f0>

In [ ]: