In [1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import glob
import jedi
%matplotlib inline

In [34]:
location = "/Users/weilu/Research/server/oct_2017/23oct/memb_3_rg_0.1_lipid_1_topology/simulation/test/0/0/"
fileName = "angles.csv"
data = pd.read_csv(location + fileName)
data.columns = data.columns.str.strip()
data2 = data.pivot_table(values='Angle', index='Frame', columns='Helix')
data2.columns = ["Helix" + str(i) for i in list(data2.columns)]

In [35]:
data2.query('abs(Helix1) > 0.2 & abs(Helix6) < 0.2')


Out[35]:
Helix1 Helix2 Helix3 Helix4 Helix5 Helix6
Frame
2 0.958807 -0.843155 0.784203 -0.922474 0.316717 0.112457
3 0.983988 -0.884886 0.973504 -0.875190 -0.301486 0.138367
4 0.988920 -0.991375 0.819003 -0.893863 -0.121061 0.184560
7 0.965696 -0.937274 0.929194 -0.961609 -0.277609 0.197083
8 0.870417 -0.975476 0.883158 -0.783042 -0.173975 0.154555
9 0.984983 -0.939534 0.913308 -0.881203 -0.496792 0.165638
10 0.953259 -0.988167 0.940443 -0.898698 -0.253104 0.068214
11 0.988898 -0.869757 0.902109 -0.756724 0.753479 -0.038889
2983 0.849606 -0.876580 0.926273 -0.838251 0.875517 0.088100
2984 0.956263 -0.822980 0.982380 -0.963726 0.976369 0.123281
2985 0.879235 -0.733759 0.886220 -0.970354 0.636246 0.167980
2986 0.948674 -0.861237 0.997800 -0.949333 0.947599 -0.117024
2988 0.934450 -0.776396 0.910108 -0.843526 0.277435 0.063588
2989 0.928283 -0.903119 0.987344 -0.768861 0.485970 -0.132733
2993 0.975392 -0.896838 0.987115 -0.993382 0.557705 -0.002005
2994 0.996225 -0.922031 0.950887 -0.913136 0.755891 -0.144787
2996 0.990582 -0.711645 0.945308 -0.976782 0.773397 0.099843
2997 0.999059 -0.915638 0.929169 -0.990210 0.635490 0.016146
2998 0.990973 -0.705024 0.987189 -0.827492 0.680304 -0.122239

In [1]:
location = "/Users/weilu/Research/server/oct_2017/23oct/memb_3_rg_0.1_lipid_1_extended/1d_dis/t_all/force_0.0/evpb-500.dat"
name_list = ["Lipid", "Go", "Mem", "Rg"]
names = ["bin", "x"] + name_list
data = pd.read_table(location, skiprows=1, sep='\s+', names=names)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-28befba385d1> in <module>()
      2 name_list = ["Lipid", "Go", "Mem", "Rg"]
      3 names = ["bin", "x"] + name_list
----> 4 data = pd.read_table(location, skiprows=1, sep='\s+', names=names)

NameError: name 'pd' is not defined

In [69]:
fig, ax = plt.subplots()

processed_data = data - data.mean()
for name in name_list:
    processed_data.query('x < 120').plot('x', name, ax=ax, ylim=(-50,50))



In [64]:
data.mean()


Out[64]:
bin     24.50000
x       71.54094
e1     -38.71914
e2    -487.81078
e3    -122.26358
e4       5.73332
dtype: float64

In [74]:
location = "/Users/weilu/Research/server/oct_2017/23oct/memb_3_rg_0.1_lipid_1_topology/sub_sample_1d_dis_t_all/"
file = "pmf-420.dat"
name_list = ["e1", "e2", "e3", "e4"]
names = ["bin", "x"] + name_list
data1 = pd.read_table(location+file, skiprows=2, sep='\s+', names=names)

location = "/Users/weilu/Research/server/oct_2017/23oct/memb_3_rg_0.1_lipid_1_topology/sub_sample_1d_dis_t_all/compare/"
file = "pmf-420.dat"
name_list = ["e1", "e2", "e3", "e4"]
names = ["bin", "x"] + name_list
data2 = pd.read_table(location+file, skiprows=2, sep='\s+', names=names)

In [79]:
fig, ax = plt.subplots()
data1.plot('x', 'e1', ax=ax)
data2.plot('x', 'e1', ax=ax, c="red")


Out[79]:
<matplotlib.axes._subplots.AxesSubplot at 0x120ec8e48>

In [ ]: