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

In [9]:
def read_temper(n=4, location="."):
    all_lipid_list = []
    for i in range(n):
        file = "lipid.{}.dat".format(i)
        lipid = pd.read_csv(location+file).assign(Run = i)
        lipid.columns = lipid.columns.str.strip()
        lipid = lipid[["Steps","Lipid","Run"]]
        all_lipid_list.append(lipid)
    lipid = pd.concat(all_lipid_list)
    
    all_energy_list = []
    for i in range(n):
        file = "energy.{}.dat".format(i)
        energy = pd.read_csv(location+file).assign(Run = i)
        energy.columns = energy.columns.str.strip()
        energy = energy[["Steps", "AMH-Go", "Membrane", "Rg", "Run"]]
        all_energy_list.append(energy)
    energy = pd.concat(all_energy_list)
    
    all_dis_list = []
    for i in range(n):
        file = "addforce.{}.dat".format(i)
        dis = pd.read_csv(location+file).assign(Run = i)
        dis.columns = dis.columns.str.strip()
        remove_columns = ['AddedForce', 'Dis12', 'Dis34', 'Dis56']
        dis.drop(remove_columns, axis=1,inplace=True)
        all_dis_list.append(dis)
    dis = pd.concat(all_dis_list)

    all_wham_list = []
    for i in range(n):
        file = "wham.{}.dat".format(i)
        wham = pd.read_csv(location+file).assign(Run = i)
        wham.columns = wham.columns.str.strip()
        remove_columns = ['Rg', 'Tc']
        wham = wham.drop(remove_columns, axis=1)
        all_wham_list.append(wham)
    wham = pd.concat(all_wham_list)

    file = "../log.lammps"
#     file = "../log0/log.lammps"
    temper = pd.read_table(location+file, skiprows=2, sep=' ')
    temper = temper.melt(id_vars=['Step'], value_vars=['T' + str(i) for i in range(n)], value_name="Temp", var_name="Run")
    temper["Run"] = temper["Run"].str[1:].astype(int)
    temper["Temp"] = "T" + temper["Temp"].astype(str) 
    t2 = temper.merge(wham, how='inner', left_on=["Step", "Run"], right_on=["Steps", "Run"]
                     ).sort_values('Step').drop('Steps', axis=1)
    t3 = t2.merge(dis, how='inner', left_on=["Step", "Run"], right_on=["Steps", "Run"]
                     ).sort_values('Step').drop('Steps', axis=1)
    t4 = t3.merge(lipid, how='inner', left_on=["Step", "Run"], right_on=["Steps", "Run"]
                             ).sort_values('Step').drop('Steps', axis=1)
    t5 = t4.merge(energy, how='inner', left_on=["Step", "Run"], right_on=["Steps", "Run"]
                             ).sort_values('Step').drop('Steps', axis=1)
    t6 = t5.assign(TotalE = t5.Energy + t5.Lipid)
#     t6 = t6.assign(TotalE_perturb_mem_p = t6.TotalE + 0.1*t6.Membrane)
#     t6 = t6.assign(TotalE_perturb_mem_m = t6.TotalE - 0.1*t6.Membrane)
#     t6 = t6.assign(TotalE_perturb_lipid_p = t6.TotalE + 0.1*t6.Lipid)
#     t6 = t6.assign(TotalE_perturb_lipid_m = t6.TotalE - 0.1*t6.Lipid)
#     t6 = t6.assign(TotalE_perturb_go_p = t6.TotalE + 0.1*t6["AMH-Go"])
#     t6 = t6.assign(TotalE_perturb_go_m = t6.TotalE - 0.1*t6["AMH-Go"])
#     t6 = t6.assign(TotalE_perturb_rg_p = t6.TotalE + 0.1*t6.Rg)
#     t6 = t6.assign(TotalE_perturb_rg_m = t6.TotalE - 0.1*t6.Rg)
    return t6

In [ ]:
pre = "/Users/weilu/Research/server/nov_2017/06nov/23oct/"
data_folder = "/Users/weilu/Research/server/nov_2017/06nov/all_data_folder/"
folder_list = [
    "rgWidth_memb_3_rg_0.1_lipid_1_extended",
    "rgWidth_memb_3_rg_0.1_lipid_1_topology"
]
# folder_list = [
#    'rgWidth_memb_3_rg_0.1_lipid_1_awsemer_topology',
#     'rgWidth_memb_3_rg_0.1_lipid_1_awsemer_extended'
# ]
def process_temper_data(pre, data_folder, folder_list):
        for folder in folder_list:
        simulation_list = glob.glob(pre+folder+"/simulation/dis_*")
        os.system("mkdir -p " + pre+folder+"/data")
        for one_simulation in simulation_list:
            dis = one_simulation.split("_")[-1]
            print(dis)
            location = one_simulation + "/0/"
            try:
                data = read_temper(location=location, n=12)
            except:
                print("notrun?", dis)
    #         temps = list(dic.keys())
            data.reset_index().to_feather(pre+folder+"/data/"+f"dis{dis}.feather")
        os.system("mv "+pre+folder+"/data "+data_folder+folder)

In [26]:
dic.values()


Out[26]:
dict_values([350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 900, 1000])

In [43]:
remove_columns = ['index', 'Step', "Run", "Temp"]
tmp.drop(remove_columns, axis=1)
# tmp


Out[43]:
Qw Energy Distance Lipid AMH-Go Membrane Rg TotalE TotalE_perturb_mem_p TotalE_perturb_mem_m TotalE_perturb_lipid_p TotalE_perturb_lipid_m TotalE_perturb_go_p TotalE_perturb_go_m TotalE_perturb_rg_p TotalE_perturb_rg_m
30011 0.668076 -995.850351 37.678876 -48.990580 -606.201997 -125.223610 7.024807 -1044.840931 -1069.885653 -1019.796209 -1049.739989 -1039.941873 -1105.461130 -984.220731 -1043.435969 -1046.245892
30015 0.602893 -1032.280748 46.317098 -45.435258 -596.711321 -130.595059 7.680508 -1077.716006 -1103.835017 -1051.596994 -1082.259531 -1073.172480 -1137.387138 -1018.044873 -1076.179904 -1079.252107
30029 0.656602 -1032.938684 44.973440 -44.766666 -605.901686 -130.639528 7.720444 -1077.705350 -1103.833255 -1051.577444 -1082.182016 -1073.228683 -1138.295518 -1017.115181 -1076.161261 -1079.249438
30037 0.696395 -1007.115298 35.775288 -47.387022 -609.970561 -126.513818 7.087159 -1054.502320 -1079.805084 -1029.199557 -1059.241023 -1049.763618 -1115.499377 -993.505264 -1053.084889 -1055.919752
30049 0.603081 -988.688490 45.300637 -44.312081 -586.521820 -128.372500 6.628446 -1033.000571 -1058.675071 -1007.326071 -1037.431780 -1028.569363 -1091.652753 -974.348389 -1031.674882 -1034.326261
30060 0.649465 -988.308515 45.354786 -46.710954 -582.327199 -125.374225 6.449168 -1035.019470 -1060.094315 -1009.944625 -1039.690565 -1030.348374 -1093.252190 -976.786750 -1033.729636 -1036.309303
30077 0.593453 -1009.117278 41.798578 -44.517386 -578.757454 -132.744258 6.586903 -1053.634664 -1080.183515 -1027.085812 -1058.086402 -1049.182925 -1111.510409 -995.758918 -1052.317283 -1054.952044
30091 0.661524 -1006.013167 44.575624 -45.549429 -605.745057 -127.291909 6.593242 -1051.562595 -1077.020977 -1026.104214 -1056.117538 -1047.007653 -1112.137101 -990.988090 -1050.243947 -1052.881244
30102 0.625821 -1012.671511 47.711065 -48.070447 -598.942281 -124.736674 7.241880 -1060.741958 -1085.689293 -1035.794623 -1065.549002 -1055.934913 -1120.636186 -1000.847730 -1059.293582 -1062.190334
30115 0.667495 -1037.768059 41.205821 -48.861184 -605.752107 -127.014070 7.044518 -1086.629243 -1112.032057 -1061.226429 -1091.515361 -1081.743125 -1147.204454 -1026.054032 -1085.220339 -1088.038147
30131 0.618890 -998.102701 44.335402 -48.695299 -588.959203 -125.143659 7.608749 -1046.798000 -1071.826732 -1021.769268 -1051.667530 -1041.928470 -1105.693921 -987.902080 -1045.276250 -1048.319750
30133 0.686195 -1008.831254 43.401762 -46.209430 -609.899188 -121.303856 6.749028 -1055.040684 -1079.301455 -1030.779913 -1059.661627 -1050.419741 -1116.030603 -994.050765 -1053.690878 -1056.390490
30144 0.674802 -1008.321676 40.067589 -48.509877 -603.359995 -124.798796 6.085355 -1056.831553 -1081.791312 -1031.871793 -1061.682540 -1051.980565 -1117.167552 -996.495553 -1055.614482 -1058.048624
30161 0.658211 -1021.369965 46.213753 -45.765130 -603.821064 -124.806593 7.674585 -1067.135095 -1092.096413 -1042.173776 -1071.711608 -1062.558582 -1127.517201 -1006.752988 -1065.600178 -1068.670012
30170 0.629408 -1028.552657 43.372433 -45.138846 -593.624975 -127.320366 8.243043 -1073.691503 -1099.155576 -1048.227430 -1078.205388 -1069.177618 -1133.054001 -1014.329006 -1072.042895 -1075.340112
30187 0.653079 -1025.003819 42.621240 -45.748644 -599.952780 -125.008885 7.290046 -1070.752463 -1095.754240 -1045.750686 -1075.327328 -1066.177599 -1130.747741 -1010.757185 -1069.294454 -1072.210473
30198 0.677825 -1030.925878 39.596540 -44.805318 -617.563723 -125.717127 6.772769 -1075.731196 -1100.874621 -1050.587771 -1080.211728 -1071.250664 -1137.487568 -1013.974824 -1074.376642 -1077.085750
30214 0.604095 -1021.022149 42.839203 -46.214965 -593.327453 -127.616269 6.828870 -1067.237114 -1092.760368 -1041.713860 -1071.858610 -1062.615617 -1126.569859 -1007.904368 -1065.871340 -1068.602888
30227 0.649769 -1008.903050 41.450846 -46.633796 -599.235800 -127.097213 6.326972 -1055.536846 -1080.956289 -1030.117404 -1060.200226 -1050.873467 -1115.460426 -995.613266 -1054.271452 -1056.802241
30230 0.618809 -986.541641 44.695380 -46.762340 -583.640704 -123.550140 6.628505 -1033.303982 -1058.014010 -1008.593954 -1037.980216 -1028.627748 -1091.668052 -974.939911 -1031.978281 -1034.629683
30240 0.617091 -990.136324 39.690151 -45.387084 -599.540142 -123.379649 7.041804 -1035.523409 -1060.199338 -1010.847479 -1040.062117 -1030.984700 -1095.477423 -975.569394 -1034.115048 -1036.931769
30263 0.593585 -1016.873348 42.331091 -45.944675 -584.412143 -122.732411 8.110590 -1062.818023 -1087.364505 -1038.271540 -1067.412490 -1058.223555 -1121.259237 -1004.376808 -1061.195905 -1064.440140
30265 0.624494 -1014.860241 47.748179 -43.645473 -593.643995 -125.732035 6.011069 -1058.505714 -1083.652121 -1033.359307 -1062.870261 -1054.141167 -1117.870113 -999.141314 -1057.303500 -1059.707928
30285 0.675711 -986.288361 38.952858 -46.561354 -599.414833 -117.569239 7.431235 -1032.849715 -1056.363563 -1009.335867 -1037.505850 -1028.193580 -1092.791198 -972.908232 -1031.363468 -1034.335962
30298 0.631151 -985.548893 47.721130 -41.392827 -581.974022 -123.856662 8.238145 -1026.941720 -1051.713052 -1002.170387 -1031.081002 -1022.802437 -1085.139122 -968.744318 -1025.294091 -1028.589349
30306 0.673821 -999.023589 42.456331 -45.096190 -600.077400 -130.169457 7.845890 -1044.119779 -1070.153670 -1018.085887 -1048.629398 -1039.610160 -1104.127519 -984.112039 -1042.550601 -1045.688957
30312 0.659091 -1001.300450 38.965379 -48.345861 -601.913627 -125.039976 7.220992 -1049.646311 -1074.654306 -1024.638316 -1054.480897 -1044.811725 -1109.837674 -989.454948 -1048.202113 -1051.090510
30335 0.663584 -1024.300861 46.395100 -46.121059 -591.517731 -124.286635 6.557176 -1070.421920 -1095.279247 -1045.564593 -1075.034026 -1065.809814 -1129.573693 -1011.270147 -1069.110485 -1071.733355
30337 0.636562 -1009.997524 43.646685 -48.846562 -600.709939 -126.457878 6.464018 -1058.844086 -1084.135661 -1033.552510 -1063.728742 -1053.959429 -1118.915079 -998.773092 -1057.551282 -1060.136889
30348 0.653247 -1027.458630 35.615087 -46.096112 -607.291491 -127.200583 6.955242 -1073.554741 -1098.994858 -1048.114625 -1078.164353 -1068.945130 -1134.283891 -1012.825592 -1072.163693 -1074.945790
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
59645 0.646961 -994.195112 40.950494 -49.086837 -596.549706 -126.820669 6.660629 -1043.281949 -1068.646083 -1017.917816 -1048.190633 -1038.373266 -1102.936920 -983.626979 -1041.949824 -1044.614075
59653 0.598040 -994.766122 46.306613 -48.959393 -595.433952 -129.828060 7.592777 -1043.725515 -1069.691127 -1017.759903 -1048.621454 -1038.829575 -1103.268910 -984.182120 -1042.206959 -1045.244070
59673 0.678937 -998.243037 43.697387 -47.984043 -607.283443 -120.664912 7.027361 -1046.227080 -1070.360063 -1022.094098 -1051.025485 -1041.428676 -1106.955425 -985.498736 -1044.821608 -1047.632553
59683 0.605064 -1046.083313 41.075992 -45.708815 -595.727561 -130.744197 6.807697 -1091.792128 -1117.940967 -1065.643288 -1096.363009 -1087.221246 -1151.364884 -1032.219372 -1090.430588 -1093.153667
59697 0.625593 -996.986239 38.933147 -48.514527 -614.100949 -127.446204 7.249994 -1045.500766 -1070.990006 -1020.011525 -1050.352218 -1040.649313 -1106.910861 -984.090671 -1044.050767 -1046.950764
59711 0.629053 -1010.227333 41.461303 -47.934885 -600.611741 -128.575746 8.241231 -1058.162218 -1083.877367 -1032.447069 -1062.955707 -1053.368730 -1118.223392 -998.101044 -1056.513972 -1059.810464
59718 0.655023 -1027.666813 40.530068 -43.995692 -593.859735 -125.200205 6.726900 -1071.662505 -1096.702546 -1046.622464 -1076.062075 -1067.262936 -1131.048479 -1012.276532 -1070.317125 -1073.007885
59728 0.633296 -1013.528472 43.859698 -44.682929 -607.816180 -127.864675 6.861495 -1058.211401 -1083.784336 -1032.638466 -1062.679694 -1053.743108 -1118.993019 -997.429783 -1056.839102 -1059.583700
59736 0.641457 -1038.401319 43.141293 -46.997041 -612.558623 -122.920138 6.770385 -1085.398360 -1109.982387 -1060.814332 -1090.098064 -1080.698656 -1146.654222 -1024.142498 -1084.044283 -1086.752437
59755 0.706523 -1025.377917 40.392551 -47.330742 -618.659487 -112.016790 7.606563 -1072.708658 -1095.112016 -1050.305300 -1077.441733 -1067.975584 -1134.574607 -1010.842710 -1071.187346 -1074.229971
59764 0.689620 -1039.112227 36.038229 -46.477849 -611.385205 -126.755111 7.215889 -1085.590076 -1110.941098 -1060.239054 -1090.237861 -1080.942291 -1146.728597 -1024.451556 -1084.146898 -1087.033254
59778 0.683885 -1058.834611 44.447281 -46.440295 -602.392739 -128.497039 7.412520 -1105.274906 -1130.974313 -1079.575498 -1109.918935 -1100.630876 -1165.514179 -1045.035632 -1103.792402 -1106.757410
59793 0.625372 -1081.867239 32.879997 -49.310397 -606.238842 -128.883630 8.040486 -1131.177636 -1156.954362 -1105.400911 -1136.108676 -1126.246597 -1191.801521 -1070.553752 -1129.569539 -1132.785734
59797 0.668012 -1035.440702 44.612668 -44.245771 -615.435539 -126.609571 6.929226 -1079.686473 -1105.008387 -1054.364559 -1084.111050 -1075.261896 -1141.230027 -1018.142919 -1078.300628 -1081.072318
59808 0.691243 -1032.835727 42.073585 -45.830527 -620.261579 -129.688125 6.361980 -1078.666253 -1104.603878 -1052.728628 -1083.249306 -1074.083201 -1140.692411 -1016.640096 -1077.393858 -1079.938649
59827 0.638019 -1034.544813 37.859581 -44.464777 -606.807272 -129.316990 7.877407 -1079.009590 -1104.872988 -1053.146192 -1083.456068 -1074.563113 -1139.690318 -1018.328863 -1077.434109 -1080.585072
59843 0.685302 -1015.082861 40.705904 -47.449345 -600.567783 -124.888395 8.103425 -1062.532206 -1087.509885 -1037.554527 -1067.277140 -1057.787271 -1122.588984 -1002.475427 -1060.911521 -1064.152891
59849 0.601905 -1006.026301 45.310188 -44.576380 -584.794972 -129.889051 6.469935 -1050.602681 -1076.580491 -1024.624871 -1055.060319 -1046.145043 -1109.082178 -992.123184 -1049.308694 -1051.896668
59864 0.672040 -1054.822171 37.394380 -49.246079 -609.595480 -126.133702 6.256141 -1104.068250 -1129.294990 -1078.841509 -1108.992857 -1099.143642 -1165.027798 -1043.108702 -1102.817021 -1105.319478
59876 0.554232 -1002.214954 38.216558 -47.247509 -585.275090 -129.058153 7.902275 -1049.462463 -1075.274094 -1023.650832 -1054.187214 -1044.737712 -1107.989972 -990.934954 -1047.882008 -1051.042918
59889 0.674737 -1017.943106 39.722471 -43.509977 -599.240692 -123.919650 7.249831 -1061.453083 -1086.237013 -1036.669153 -1065.804081 -1057.102085 -1121.377152 -1001.529014 -1060.003117 -1062.903049
59895 0.643521 -1041.165400 38.383382 -46.554163 -606.229057 -128.889273 7.094898 -1087.719562 -1113.497417 -1061.941707 -1092.374978 -1083.064146 -1148.342468 -1027.096656 -1086.300583 -1089.138542
59913 0.612338 -1038.401599 41.849316 -45.204285 -602.034038 -131.365117 6.258919 -1083.605884 -1109.878907 -1057.332860 -1088.126312 -1079.085455 -1143.809287 -1023.402480 -1082.354100 -1084.857667
59924 0.650540 -1042.443460 41.637476 -47.829327 -603.048598 -121.368471 7.457477 -1090.272787 -1114.546482 -1065.999093 -1095.055720 -1085.489855 -1150.577647 -1029.967928 -1088.781292 -1091.764283
59932 0.714707 -1053.812791 37.695311 -46.656001 -617.827077 -125.266782 8.066173 -1100.468791 -1125.522148 -1075.415435 -1105.134391 -1095.803191 -1162.251499 -1038.686084 -1098.855557 -1102.082026
59949 0.673982 -1064.229972 40.160404 -47.363201 -600.570138 -127.801465 6.782144 -1111.593173 -1137.153466 -1086.032880 -1116.329493 -1106.856853 -1171.650186 -1051.536159 -1110.236744 -1112.949601
59958 0.643274 -1001.330157 40.209168 -44.962889 -589.725212 -125.883552 6.381728 -1046.293047 -1071.469757 -1021.116336 -1050.789336 -1041.796758 -1105.265568 -987.320526 -1045.016701 -1047.569392
59964 0.682523 -995.131654 38.699048 -44.190233 -607.598244 -122.571218 7.448952 -1039.321887 -1063.836131 -1014.807643 -1043.740910 -1034.902864 -1100.081711 -978.562063 -1037.832096 -1040.811677
59978 0.670468 -1021.622644 40.910559 -48.786264 -615.386285 -123.483825 6.777043 -1070.408908 -1095.105673 -1045.712143 -1075.287534 -1065.530281 -1131.947536 -1008.870279 -1069.053499 -1071.764316
59989 0.710904 -1017.354747 38.488315 -47.279142 -612.653545 -118.045682 6.537342 -1064.633889 -1088.243026 -1041.024753 -1069.361803 -1059.905975 -1125.899244 -1003.368535 -1063.326421 -1065.941358

2500 rows × 16 columns


In [51]:
data = tmp

In [57]:
list(dic.values())


Out[57]:
dict_values([350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 900, 1000])

In [60]:
for i in list(dic.values()):
    fig, axs = plt.subplots(ncols=2, nrows=1, figsize=(10, 4))
    tmp = data.query('Temp=={}'.format(i))
#     dic = {"T0":350, "T1":400, "T2":450, "T3":500, "T4":550, "T5":600, "T6":650, "T7":700, "T8":750, "T9":800, "T10":900, "T11":1000}
#     tmp = tmp.assign(myT = tmp['Temp'].map(dic))
    tmp.plot('Step', 'Run', subplots=True, ax=axs[1])
    tmp.plot('Step', 'Qw', subplots=True, ax=axs[0])


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-60-4ad795323073> in <module>()
      4 #     dic = {"T0":350, "T1":400, "T2":450, "T3":500, "T4":550, "T5":600, "T6":650, "T7":700, "T8":750, "T9":800, "T10":900, "T11":1000}
      5 #     tmp = tmp.assign(myT = tmp['Temp'].map(dic))
----> 6     tmp.plot('Step', 'Run', subplots=True, ax=axs[1])
      7     tmp.plot('Step', 'Qw', subplots=True, ax=axs[0])

~/anaconda3/lib/python3.6/site-packages/pandas/plotting/_core.py in __call__(self, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds)
   2625                           fontsize=fontsize, colormap=colormap, table=table,
   2626                           yerr=yerr, xerr=xerr, secondary_y=secondary_y,
-> 2627                           sort_columns=sort_columns, **kwds)
   2628     __call__.__doc__ = plot_frame.__doc__
   2629 

~/anaconda3/lib/python3.6/site-packages/pandas/plotting/_core.py in plot_frame(data, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds)
   1867                  yerr=yerr, xerr=xerr,
   1868                  secondary_y=secondary_y, sort_columns=sort_columns,
-> 1869                  **kwds)
   1870 
   1871 

~/anaconda3/lib/python3.6/site-packages/pandas/plotting/_core.py in _plot(data, x, y, subplots, ax, kind, **kwds)
   1692         plot_obj = klass(data, subplots=subplots, ax=ax, kind=kind, **kwds)
   1693 
-> 1694     plot_obj.generate()
   1695     plot_obj.draw()
   1696     return plot_obj.result

~/anaconda3/lib/python3.6/site-packages/pandas/plotting/_core.py in generate(self)
    241     def generate(self):
    242         self._args_adjust()
--> 243         self._compute_plot_data()
    244         self._setup_subplots()
    245         self._make_plot()

~/anaconda3/lib/python3.6/site-packages/pandas/plotting/_core.py in _compute_plot_data(self)
    350         if is_empty:
    351             raise TypeError('Empty {0!r}: no numeric data to '
--> 352                             'plot'.format(numeric_data.__class__.__name__))
    353 
    354         self.data = numeric_data

TypeError: Empty 'DataFrame': no numeric data to plot

In [46]:
test = pd.read_feather("/Users/weilu/Research/server/nov_2017/06nov/23oct/rgWidth_memb_3_rg_0.1_lipid_1_extended/data/dis116.0.feather")

In [ ]:


In [48]:
test.filter(["Qw", "Distance"])


Out[48]:
Qw Distance
0 0.047962 261.655736
1 0.047438 267.011803
2 0.040804 259.699212
3 0.046076 267.877017
4 0.048733 265.304885
5 0.047834 266.625359
6 0.042481 262.512521
7 0.046371 267.853999
8 0.048226 265.799768
9 0.047111 264.645578
10 0.041705 260.631869
11 0.048977 268.607697
12 0.057039 199.791957
13 0.039206 184.337180
14 0.048990 194.059916
15 0.061419 196.758067
16 0.051236 180.860264
17 0.054226 185.687393
18 0.048840 192.514727
19 0.061981 193.850426
20 0.048380 186.573185
21 0.054425 192.378334
22 0.049648 193.436092
23 0.041826 183.945640
24 0.072114 147.262177
25 0.077669 149.027218
26 0.087097 151.664315
27 0.066497 155.185823
28 0.084788 146.596338
29 0.072050 157.400740
... ... ...
59970 0.348893 99.483136
59971 0.106180 119.206516
59972 0.345590 101.246130
59973 0.103985 119.111572
59974 0.087536 106.778174
59975 0.141433 110.552868
59976 0.314943 102.650471
59977 0.369047 103.638166
59978 0.265395 102.435420
59979 0.268826 113.950117
59980 0.166606 106.364992
59981 0.119942 114.271471
59982 0.083541 106.796015
59983 0.343431 109.706048
59984 0.129983 102.876086
59985 0.373806 105.185212
59986 0.054151 116.256965
59987 0.102261 114.106061
59988 0.148243 109.248123
59989 0.285859 109.172344
59990 0.366216 105.089305
59991 0.250911 105.731755
59992 0.070163 127.917169
59993 0.359535 97.084772
59994 0.083011 100.578410
59995 0.118964 102.686743
59996 0.310724 105.921727
59997 0.124445 103.700505
59998 0.113842 117.863852
59999 0.289406 107.166711

60000 rows × 2 columns


In [41]:
data_folder = "/Users/weilu/Research/server/nov_2017/06nov/all_data_folder/"
freeEnergy_folder = "/Users/weilu/Research/server/nov_2017/06nov/all_freeEnergy_calculation/"
folder = "rgWidth_memb_3_rg_0.1_lipid_1_extended"

def move_data(data_folder, freeEnergy_folder, folder):
    os.system("mkdir -p "+freeEnergy_folder+folder)
    dis_list = glob.glob(data_folder+folder+"/dis*.feather")
    for dis_file in dis_list:
        dis = dis_file.split("/")[-1].replace('dis', '').replace('.feather', '')
        print(dis)
        t6 = pd.read_feather(dis_file)
        t6 = t6.assign(TotalE_perturb_mem_p = t6.TotalE + 0.2*t6.Membrane)
        t6 = t6.assign(TotalE_perturb_mem_m = t6.TotalE - 0.2*t6.Membrane)
        t6 = t6.assign(TotalE_perturb_lipid_p = t6.TotalE + 0.1*t6.Lipid)
        t6 = t6.assign(TotalE_perturb_lipid_m = t6.TotalE - 0.1*t6.Lipid)
        t6 = t6.assign(TotalE_perturb_go_p = t6.TotalE + 0.1*t6["AMH-Go"])
        t6 = t6.assign(TotalE_perturb_go_m = t6.TotalE - 0.1*t6["AMH-Go"])
        t6 = t6.assign(TotalE_perturb_rg_p = t6.TotalE + 0.2*t6.Rg)
        t6 = t6.assign(TotalE_perturb_rg_m = t6.TotalE - 0.2*t6.Rg)
        dic = {"T0":350, "T1":400, "T2":450, "T3":500, "T4":550, "T5":600, "T6":650, "T7":700, "T8":750, "T9":800, "T10":900, "T11":1000}
        temps = list(dic.values())
        def convert(x):
            return dic[x]
        t6["Temp"] = t6["Temp"].apply(convert)

        for temp in temps:
            if temp > 600:
                continue
            tmp = t6.query('Temp=="{}"& Step > 1e7'.format(temp))
            remove_columns = ['index', 'Step', "Run", "Temp"]
            tmp = tmp.drop(remove_columns, axis=1)
            tmp.to_csv(freeEnergy_folder+folder+"/t_{}_dis_{}.dat".format(temp, dis), sep=' ', index=False, header=False)


146.0
142.0
214.0
38.0
60.0
124.0
76.0
224.0
210.0
62.0
192.0
206.0
184.0
136.0
190.0
170.0
212.0
230.0
110.0
150.0
86.0
204.0
96.0
198.0
64.0
94.0
202.0
182.0
220.0
102.0
180.0
166.0
158.0
172.0
72.0
216.0
78.0
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-41-cc4d2a62b80c> in <module>()
     28             continue
     29         tmp = t6.query('Temp=="{}"& Step > 1e7'.format(temp))
---> 30         tmp.to_csv(freeEnergy_folder+folder+"/t_{}_dis_{}.dat".format(temp, dis), sep=' ', index=False, header=False)

~/anaconda3/lib/python3.6/site-packages/pandas/core/frame.py in to_csv(self, path_or_buf, sep, na_rep, float_format, columns, header, index, index_label, mode, encoding, compression, quoting, quotechar, line_terminator, chunksize, tupleize_cols, date_format, doublequote, escapechar, decimal)
   1401                                      doublequote=doublequote,
   1402                                      escapechar=escapechar, decimal=decimal)
-> 1403         formatter.save()
   1404 
   1405         if path_or_buf is None:

~/anaconda3/lib/python3.6/site-packages/pandas/io/formats/format.py in save(self)
   1590                 self.writer = csv.writer(f, **writer_kwargs)
   1591 
-> 1592             self._save()
   1593 
   1594         finally:

~/anaconda3/lib/python3.6/site-packages/pandas/io/formats/format.py in _save(self)
   1691                 break
   1692 
-> 1693             self._save_chunk(start_i, end_i)
   1694 
   1695     def _save_chunk(self, start_i, end_i):

~/anaconda3/lib/python3.6/site-packages/pandas/io/formats/format.py in _save_chunk(self, start_i, end_i)
   1715                                         decimal=self.decimal,
   1716                                         date_format=self.date_format,
-> 1717                                         quoting=self.quoting)
   1718 
   1719         lib.write_csv_rows(self.data, ix, self.nlevels, self.cols, self.writer)

~/anaconda3/lib/python3.6/site-packages/pandas/core/indexes/base.py in to_native_types(self, slicer, **kwargs)
   1946         if slicer is not None:
   1947             values = values[slicer]
-> 1948         return values._format_native_types(**kwargs)
   1949 
   1950     def _format_native_types(self, na_rep='', quoting=None, **kwargs):

~/anaconda3/lib/python3.6/site-packages/pandas/core/indexes/base.py in _format_native_types(self, na_rep, quoting, **kwargs)
   1952         mask = isnull(self)
   1953         if not self.is_object() and not quoting:
-> 1954             values = np.asarray(self).astype(str)
   1955         else:
   1956             values = np.array(self, dtype=object, copy=True)

KeyboardInterrupt: 

In [36]:
tmp


Out[36]:
index Step Run Temp Qw Energy Distance Lipid AMH-Go Membrane Rg TotalE TotalE_perturb_mem_p TotalE_perturb_mem_m TotalE_perturb_lipid_p TotalE_perturb_lipid_m TotalE_perturb_go_p TotalE_perturb_go_m TotalE_perturb_rg_p TotalE_perturb_rg_m
30002 30009 10004000 4 600 0.284011 -340.357643 93.964520 -36.854568 -423.303708 -128.888153 11.515542 -377.212211 -402.989842 -351.434580 -380.897668 -373.526754 -419.542582 -334.881840 -374.909102 -379.515319
30022 30013 10008000 4 600 0.266048 -377.258783 89.500427 -37.906464 -426.325152 -124.195191 9.641516 -415.165248 -440.004286 -390.326209 -418.955894 -411.374601 -457.797763 -372.532732 -413.236944 -417.093551
30026 30033 10012000 4 600 0.290686 -392.642896 84.497429 -36.943941 -433.279441 -136.835006 11.510610 -429.586837 -456.953838 -402.219835 -433.281231 -425.892443 -472.914781 -386.258892 -427.284715 -431.888959
30046 30036 10016000 4 600 0.264812 -368.690297 90.410658 -34.171362 -439.357525 -129.362586 9.378652 -402.861659 -428.734176 -376.989142 -406.278795 -399.444523 -446.797411 -358.925906 -400.985929 -404.737389
30053 30054 10020000 4 600 0.289198 -427.515797 87.914899 -37.618500 -455.335194 -112.299752 10.086806 -465.134298 -487.594248 -442.674347 -468.896148 -461.372448 -510.667817 -419.600778 -463.116936 -467.151659
30064 30066 10024000 4 600 0.264662 -404.144197 89.491234 -32.709444 -450.718336 -135.325489 13.279796 -436.853641 -463.918739 -409.788543 -440.124585 -433.582696 -481.925474 -391.781807 -434.197682 -439.509600
30078 30076 10028000 4 600 0.271089 -402.182073 92.135866 -38.577434 -461.925568 -126.191554 9.810193 -440.759506 -465.997817 -415.521196 -444.617250 -436.901763 -486.952063 -394.566950 -438.797468 -442.721545
30090 30089 10032000 4 600 0.251748 -375.553644 97.581290 -37.283726 -441.652113 -119.856688 8.980900 -412.837370 -436.808708 -388.866032 -416.565743 -409.108997 -457.002581 -368.672159 -411.041190 -414.633550
30102 30100 10036000 0 600 0.290883 -395.755289 103.993272 -37.787416 -429.536005 -133.935673 8.118854 -433.542705 -460.329840 -406.755571 -437.321447 -429.763964 -476.496306 -390.589105 -431.918935 -435.166476
30115 30111 10040000 0 600 0.294799 -332.899667 96.405150 -32.871002 -418.333933 -138.214142 9.259736 -365.770669 -393.413497 -338.127841 -369.057769 -362.483569 -407.604062 -323.937276 -363.918722 -367.622616
30131 30125 10044000 0 600 0.241248 -351.295060 101.450377 -36.711469 -422.099049 -136.153321 9.654999 -388.006529 -415.237193 -360.775864 -391.677675 -384.335382 -430.216433 -345.796624 -386.075529 -389.937528
30133 30141 10048000 0 600 0.271659 -384.765658 94.319122 -38.490368 -443.904566 -131.976514 10.520249 -423.256027 -449.651330 -396.860724 -427.105064 -419.406990 -467.646483 -378.865570 -421.151977 -425.360077
30144 30155 10052000 0 600 0.284982 -420.118286 89.691407 -36.853280 -449.502130 -121.025293 11.555766 -456.971566 -481.176624 -432.766507 -460.656894 -453.286238 -501.921779 -412.021353 -454.660412 -459.282719
30161 30163 10056000 0 600 0.298861 -421.834123 95.997821 -36.860373 -422.798551 -134.865298 9.603443 -458.694496 -485.667555 -431.721436 -462.380533 -455.008458 -500.974351 -416.414641 -456.773807 -460.615184
30170 30177 10060000 0 600 0.301402 -408.870740 95.532250 -36.002079 -440.818774 -120.225096 8.139351 -444.872819 -468.917838 -420.827800 -448.473027 -441.272611 -488.954696 -400.790942 -443.244949 -446.500689
30187 30183 10064000 0 600 0.251792 -416.483278 105.442226 -31.265384 -424.519529 -130.260861 8.815778 -447.748662 -473.800835 -421.696490 -450.875201 -444.622124 -490.200615 -405.296709 -445.985507 -449.511818
30198 30196 10068000 0 600 0.320838 -451.281544 87.990525 -36.858719 -463.706495 -132.369451 14.031605 -488.140262 -514.614153 -461.666372 -491.826134 -484.454390 -534.510912 -441.769613 -485.333941 -490.946583
30214 30204 10072000 0 600 0.273136 -353.542634 89.989907 -35.427316 -439.112938 -135.453592 9.427518 -388.969950 -416.060668 -361.879232 -392.512682 -385.427218 -432.881244 -345.058656 -387.084446 -390.855454
30227 30218 10076000 0 600 0.260961 -364.154328 93.055527 -33.525902 -422.694641 -133.181927 11.180088 -397.680231 -424.316616 -371.043845 -401.032821 -394.327640 -439.949695 -355.410767 -395.444213 -399.916248
30230 30237 10080000 0 600 0.308762 -342.348993 84.933337 -35.104106 -456.122517 -127.131697 10.422017 -377.453098 -402.879438 -352.026759 -380.963509 -373.942688 -423.065350 -331.840847 -375.368695 -379.537502
30240 30247 10084000 0 600 0.285206 -392.295310 91.719454 -35.471591 -456.002836 -124.194384 10.442869 -427.766901 -452.605777 -402.928024 -431.314060 -424.219742 -473.367184 -382.166617 -425.678327 -429.855474
30263 30257 10088000 0 600 0.269048 -337.780575 101.513659 -37.074719 -442.363669 -121.957991 12.964881 -374.855294 -399.246892 -350.463696 -378.562766 -371.147822 -419.091661 -330.618927 -372.262318 -377.448270
30265 30274 10092000 0 600 0.293380 -382.661810 101.131317 -37.645860 -446.526430 -121.515547 11.884246 -420.307670 -444.610780 -396.004561 -424.072256 -416.543084 -464.960313 -375.655027 -417.930821 -422.684520
30285 30281 10096000 0 600 0.330582 -373.354870 102.111568 -37.492822 -472.623139 -119.953672 14.484313 -410.847692 -434.838426 -386.856957 -414.596974 -407.098410 -458.110006 -363.585378 -407.950829 -413.744555
30298 30288 10100000 0 600 0.267895 -388.843432 111.239653 -31.867127 -465.864625 -117.777585 10.892020 -420.710559 -444.266076 -397.155042 -423.897272 -417.523846 -467.297022 -374.124097 -418.532155 -422.888963
30306 30304 10104000 0 600 0.299197 -468.909868 99.336375 -38.598723 -462.221596 -124.879408 8.806282 -507.508591 -532.484473 -482.532710 -511.368464 -503.648719 -553.730751 -461.286432 -505.747335 -509.269848
30312 30322 10108000 0 600 0.272065 -381.152855 88.391975 -33.401818 -434.807528 -130.888555 10.207248 -414.554673 -440.732384 -388.376962 -417.894855 -411.214491 -458.035426 -371.073920 -412.513223 -416.596123
30335 30329 10112000 0 600 0.294549 -382.665191 89.798963 -36.021499 -455.325452 -119.989853 10.758635 -418.686690 -442.684660 -394.688719 -422.288840 -415.084540 -464.219235 -373.154144 -416.534963 -420.838417
30337 30342 10116000 0 600 0.293846 -352.763560 90.139797 -37.234336 -455.680526 -127.264913 10.431604 -389.997896 -415.450879 -364.544914 -393.721330 -386.274463 -435.565949 -344.429844 -387.911575 -392.084217
30348 30359 10120000 0 600 0.321435 -391.167560 83.537349 -37.530095 -441.594442 -134.449065 10.454587 -428.697655 -455.587468 -401.807842 -432.450664 -424.944645 -472.857099 -384.538211 -426.606737 -430.788572
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
59643 59649 19884000 10 600 0.284727 -369.729741 80.706275 -36.604964 -431.221856 -134.130828 8.134889 -406.334705 -433.160871 -379.508539 -409.995201 -402.674209 -449.456891 -363.212519 -404.707727 -407.961683
59658 59657 19888000 10 600 0.268341 -332.482210 79.459681 -36.513396 -431.302320 -137.335684 8.134285 -368.995606 -396.462743 -341.528469 -372.646946 -365.344266 -412.125838 -325.865374 -367.368749 -370.622463
59675 59669 19892000 10 600 0.272747 -452.819880 90.345501 -38.815445 -460.533269 -132.062668 8.215630 -491.635326 -518.047859 -465.222792 -495.516870 -487.753781 -537.688652 -445.581999 -489.992199 -493.278452
59676 59686 19896000 10 600 0.267195 -344.542226 87.581092 -37.921279 -465.886701 -117.728412 7.279094 -382.463504 -406.009187 -358.917822 -386.255632 -378.671376 -429.052174 -335.874834 -381.007685 -383.919323
59693 59694 19900000 10 600 0.286902 -397.292980 80.568593 -34.106849 -461.890432 -124.076883 7.362357 -431.399829 -456.215206 -406.584453 -434.810514 -427.989144 -477.588873 -385.210786 -429.927358 -432.872301
59708 59703 19904000 10 600 0.267062 -390.270298 85.826829 -35.117450 -440.123998 -129.960680 7.690512 -425.387747 -451.379883 -399.395611 -428.899492 -421.876002 -469.400147 -381.375347 -423.849645 -426.925850
59723 59715 19908000 10 600 0.278319 -439.839370 89.948281 -35.088618 -456.226086 -124.102081 9.325758 -474.927988 -499.748404 -450.107572 -478.436850 -471.419126 -520.550597 -429.305380 -473.062837 -476.793140
59724 59732 19912000 10 600 0.262688 -358.291248 99.625594 -37.257622 -457.765535 -132.352634 7.681526 -395.548870 -422.019397 -369.078343 -399.274632 -391.823108 -441.325424 -349.772317 -394.012565 -397.085175
59745 59737 19916000 10 600 0.225847 -362.625013 85.766711 -32.923273 -443.540166 -127.735188 5.909013 -395.548286 -421.095323 -370.001248 -398.840613 -392.255958 -439.902302 -351.194269 -394.366483 -396.730088
59759 59753 19920000 10 600 0.222571 -398.365888 101.818850 -35.493091 -437.597316 -119.236446 8.286859 -433.858980 -457.706269 -410.011690 -437.408289 -430.309670 -477.618711 -390.099248 -432.201608 -435.516351
59761 59771 19924000 10 600 0.244499 -417.784797 97.207009 -32.921737 -447.975057 -121.250987 8.955606 -450.706534 -474.956731 -426.456336 -453.998707 -447.414360 -495.504039 -405.909028 -448.915413 -452.497655
59781 59774 19928000 10 600 0.248609 -425.578953 99.321157 -34.462465 -439.762499 -136.623346 9.847144 -460.041418 -487.366087 -432.716749 -463.487665 -456.595171 -504.017668 -416.065168 -458.071989 -462.010847
59787 59791 19932000 10 600 0.259603 -426.727625 96.612918 -35.974106 -437.433029 -118.511270 10.276274 -462.701730 -486.403984 -438.999476 -466.299141 -459.104320 -506.445033 -418.958427 -460.646476 -464.756985
59802 59800 19936000 10 600 0.269460 -378.115002 98.818303 -36.234160 -432.010362 -127.388282 6.238510 -414.349162 -439.826818 -388.871506 -417.972578 -410.725746 -457.550198 -371.148126 -413.101460 -415.596864
59815 59811 19940000 10 600 0.283916 -402.912159 99.635848 -33.482432 -460.889312 -123.258259 6.674501 -436.394591 -461.046243 -411.742939 -439.742834 -433.046348 -482.483522 -390.305660 -435.059691 -437.729491
59830 59821 19944000 10 600 0.234803 -384.004028 100.601757 -30.868775 -442.407106 -117.418673 8.041436 -414.872804 -438.356538 -391.389069 -417.959681 -411.785926 -459.113514 -370.632093 -413.264517 -416.481091
59841 59833 19948000 10 600 0.250340 -364.321119 89.589619 -36.745372 -426.900469 -132.903589 9.048985 -401.066491 -427.647209 -374.485773 -404.741028 -397.391954 -443.756538 -358.376444 -399.256694 -402.876288
59845 59855 19952000 10 600 0.285133 -395.830449 86.994990 -34.906959 -456.691213 -126.324809 7.729328 -430.737408 -456.002370 -405.472446 -434.228104 -427.246712 -476.406529 -385.068287 -429.191542 -432.283274
59865 59857 19956000 10 600 0.295945 -473.778295 85.805613 -35.017394 -467.164096 -136.764159 7.294851 -508.795688 -536.148520 -481.442856 -512.297427 -505.293949 -555.512098 -462.079278 -507.336718 -510.254658
59879 59873 19960000 10 600 0.255258 -416.827662 85.071014 -38.799033 -440.305769 -131.045161 7.147942 -455.626695 -481.835728 -429.417663 -459.506599 -451.746792 -499.657272 -411.596118 -454.197107 -457.056284
59887 59884 19964000 10 600 0.300970 -416.142825 89.008214 -38.259825 -468.602913 -131.903512 8.546172 -454.402650 -480.783352 -428.021947 -458.228632 -450.576667 -501.262941 -407.542358 -452.693415 -456.111884
59903 59897 19968000 10 600 0.256398 -384.450868 89.409264 -33.143517 -443.967678 -126.377346 9.466504 -417.594385 -442.869854 -392.318916 -420.908736 -414.280033 -461.991153 -373.197617 -415.701084 -419.487685
59914 59905 19972000 10 600 0.268738 -400.927909 96.782165 -34.799751 -451.592433 -125.598045 6.803754 -435.727660 -460.847269 -410.608051 -439.207635 -432.247685 -480.886903 -390.568417 -434.366909 -437.088411
59916 59923 19976000 10 600 0.258088 -442.948341 94.656933 -38.052415 -428.994710 -128.913434 8.225445 -481.000757 -506.783444 -455.218070 -484.805998 -477.195515 -523.900228 -438.101286 -479.355668 -482.645846
59935 59931 19980000 10 600 0.246904 -383.717350 89.723379 -35.148567 -450.263006 -134.807009 11.538834 -418.865917 -445.827319 -391.904515 -422.380774 -415.351060 -463.892217 -373.839616 -416.558150 -421.173684
59944 59951 19984000 10 600 0.273916 -320.489602 92.286315 -37.703235 -434.353521 -131.198146 7.929889 -358.192836 -384.432466 -331.953207 -361.963160 -354.422513 -401.628189 -314.757484 -356.606859 -359.778814
59952 59963 19988000 10 600 0.253874 -329.515288 89.164360 -36.788239 -420.039293 -129.182901 8.291669 -366.303526 -392.140106 -340.466946 -369.982350 -362.624702 -408.307456 -324.299597 -364.645193 -367.961860
59970 59968 19992000 10 600 0.281288 -290.481583 92.942475 -37.645291 -427.951406 -136.713795 9.251707 -328.126874 -355.469633 -300.784115 -331.891403 -324.362345 -370.922015 -285.331733 -326.276533 -329.977215
59977 59986 19996000 10 600 0.284525 -385.446800 95.768287 -38.213302 -461.033525 -121.707813 9.651539 -423.660102 -448.001664 -399.318539 -427.481432 -419.838772 -469.763454 -377.556749 -421.729794 -425.590410
59996 59988 20000000 10 600 0.223536 -353.092458 91.195333 -31.712424 -417.987117 -121.378210 7.249156 -384.804882 -409.080524 -360.529240 -387.976124 -381.633640 -426.603594 -343.006170 -383.355051 -386.254713

2500 rows × 20 columns


In [ ]:
dic = {"T0":350, "T1":400, "T2":450, "T3":500, "T4":550, "T5":600, "T6":650, "T7":700, "T8":750, "T9":800, "T10":900, "T11":1000}
# assembly the data I need to do freeEnergy calculation.
do = os.system
freeEnergy_folder = "all_data_folder/"
data_folder = "/Users/weilu/Research/server/nov_2017/06nov/all_data_folder/"
folder = "rgWidth_memb_3_rg_0.1_lipid_1_extended"

do(f"mkdir -p all_freeEnergy_calculation/{folder}")

In [14]:
pre = "/Users/weilu/Research/server/nov_2017/06nov/23oct/"
data_folder = "/Users/weilu/Research/server/nov_2017/06nov/all_data_folder/"
folder_list = [
    "rgWidth_memb_3_rg_0.1_lipid_1_extended",
    "rgWidth_memb_3_rg_0.1_lipid_1_topology"
]
# folder_list = [
#    'rgWidth_memb_3_rg_0.1_lipid_1_awsemer_topology',
#     'rgWidth_memb_3_rg_0.1_lipid_1_awsemer_extended'
# ]

dic = {"T0":350, "T1":400, "T2":450, "T3":500, "T4":550, "T5":600, "T6":650, "T7":700, "T8":750, "T9":800, "T10":900, "T11":1000}
for folder in folder_list:
    simulation_list = glob.glob(pre+folder+"/simulation/*")
    os.system("mkdir -p " + pre+folder+"/data")
    for one_simulation in simulation_list:
        dis = one_simulation.split("_")[-1]
        print(dis)
        location = one_simulation + "/0/"
#         try:
#             data = read_temper(location=location, n=12)
#         except:
#             print("notrun?", dis)
# #         temps = list(dic.keys())
#         data.reset_index().to_feather(pre+folder+"/data/"+f"dis{dis}.feather")
    os.system("mv "+pre+folder+"/data "+data_folder+folder)
#         for temp in temps:
#             tmp = data.query('Temp=="{}"& Step > 1e7'.format(temp))
#             tmp.reset_index().to_feather(pre+folder+"/data/"+f"dis{dis}_t{dic[temp]}.feather")
#             tmp.to_csv(pre+folder+"/data/"+f"dis{dis}_t{dic[temp]}.dat", sep=' ', index=False, header=False)


86.0
84.0
116.0
222.0
76.0
208.0
228.0
128.0
160.0
72.0
186.0
54.0
70.0
220.0
154.0
132.0
226.0
144.0
50.0
56.0
198.0
176.0
184.0
80.0
168.0
158.0
120.0
210.0
196.0
206.0
214.0
30.0
190.0
192.0
148.0
88.0
44.0
134.0
152.0
46.0
194.0
166.0
204.0
96.0
38.0
200.0
62.0
112.0
212.0
110.0
188.0
142.0
218.0
216.0
156.0
126.0
118.0
114.0
164.0
48.0
108.0
180.0
34.0
146.0
36.0
182.0
106.0
60.0
40.0
78.0
74.0
66.0
172.0
52.0
94.0
104.0
202.0
162.0
82.0
98.0
140.0
124.0
68.0
122.0
224.0
92.0
64.0
42.0
230.0
58.0
178.0
150.0
170.0
130.0
90.0
136.0
100.0
102.0
138.0
174.0
32.0
86.0
84.0
116.0
222.0
76.0
208.0
228.0
128.0
160.0
72.0
186.0
54.0
70.0
220.0
154.0
132.0
226.0
144.0
50.0
56.0
198.0
176.0
184.0
80.0
168.0
158.0
120.0
210.0
196.0
206.0
214.0
30.0
190.0
192.0
148.0
88.0
44.0
134.0
152.0
46.0
194.0
166.0
204.0
96.0
38.0
200.0
62.0
112.0
212.0
110.0
188.0
142.0
218.0
216.0
156.0
126.0
118.0
114.0
164.0
48.0
108.0
180.0
34.0
146.0
36.0
182.0
106.0
60.0
40.0
78.0
74.0
66.0
172.0
52.0
94.0
104.0
202.0
162.0
82.0
98.0
140.0
124.0
68.0
122.0
224.0
92.0
64.0
42.0
230.0
58.0
178.0
150.0
170.0
130.0
90.0
136.0
100.0
102.0
138.0
174.0
32.0

In [ ]:


In [23]:
# folder_list = [
#    '/Users/weilu/Research/server/oct_2017/23oct/rgWidth_memb_3_rg_0.1_lipid_1_topology/',
#     '/Users/weilu/Research/server/oct_2017/23oct/rgWidth_memb_3_rg_0.1_lipid_1_extended/'
# ]
pre = "/Users/weilu/Research/server/oct_2017/30oct/"
# folder_list = [
#    'rgWidth_memb_3_rg_0.1_lipid_1_extended'
# ]
folder_list = [
   'rgWidth_memb_3_rg_0.1_lipid_1_topology'
]
dis_list = np.linspace(30, 180, 151)
# dis_list = np.linspace(30, 230, 101)
# dis_list = np.linspace(132, 232, 51)
# dis_list = [30.0]
dic = {"T0":350, "T1":400, "T2":450, "T3":500, "T4":550, "T5":600, "T6":650, "T7":700, "T8":750, "T9":800, "T10":900, "T11":1000}
for folder in folder_list:
    for dis in dis_list:
        print(dis)
        location = pre + folder + "/simulation/dis_{}/0/".format(dis)
        try:
            data = read_temper(location=location, n=12)
        except:
            print("notrun?", dis)
        temps = list(dic.keys())
        for temp in temps:
            tmp = data.query('Temp=="{}"& Step > 1e7'.format(temp))
            tmp.to_csv(location+"t{}_new.dat".format(dic[temp]), sep=' ', index=False, header=False)


30.0
31.0
32.0
33.0
34.0
35.0
36.0
37.0
38.0
39.0
notrun? 39.0
40.0
notrun? 40.0
41.0
notrun? 41.0
42.0
notrun? 42.0
43.0
notrun? 43.0
44.0
notrun? 44.0
45.0
notrun? 45.0
46.0
47.0
notrun? 47.0
48.0
49.0
50.0
51.0
52.0
53.0
54.0
55.0
56.0
57.0
58.0
59.0
60.0
61.0
62.0
63.0
64.0
65.0
66.0
67.0
68.0
69.0
70.0
71.0
72.0
73.0
74.0
75.0
76.0
77.0
78.0
79.0
80.0
81.0
82.0
83.0
84.0
85.0
86.0
87.0
88.0
89.0
90.0
91.0
92.0
93.0
94.0
95.0
96.0
97.0
98.0
99.0
100.0
101.0
102.0
103.0
104.0
105.0
106.0
107.0
108.0
109.0
110.0
111.0
112.0
113.0
114.0
115.0
116.0
117.0
118.0
119.0
120.0
121.0
122.0
123.0
124.0
125.0
126.0
127.0
128.0
129.0
130.0
131.0
132.0
133.0
134.0
135.0
136.0
137.0
138.0
139.0
140.0
141.0
142.0
143.0
144.0
145.0
146.0
147.0
148.0
149.0
150.0
151.0
152.0
153.0
154.0
155.0
156.0
157.0
158.0
159.0
160.0
161.0
162.0
163.0
164.0
165.0
166.0
167.0
168.0
169.0
170.0
171.0
172.0
173.0
174.0
175.0
176.0
177.0
178.0
179.0
180.0

In [9]:
import os

In [25]:
# folder_list = [
#    '/Users/weilu/Research/server/oct_2017/23oct/rgWidth_memb_3_rg_0.1_lipid_1_topology/',
#     '/Users/weilu/Research/server/oct_2017/23oct/rgWidth_memb_3_rg_0.1_lipid_1_extended/'
# ]
pre = "/Users/weilu/Research/server/oct_2017/30oct/"
# folder_list = [
#    'rgWidth_memb_3_rg_0.1_lipid_1_extended'
# ]
folder_list = [
   'rgWidth_memb_3_rg_0.1_lipid_1_topology'
]
dis_list = np.linspace(30, 180, 151)
# dis_list = np.linspace(30, 230, 101)
# dis_list = np.linspace(132, 232, 51)
# dis_list = [30.0]
dic = {"T0":350, "T1":400, "T2":450, "T3":500, "T4":550, "T5":600, "T6":650, "T7":700, "T8":750, "T9":800, "T10":900, "T11":1000}
for folder in folder_list:
    for dis in dis_list:
        print(dis)
        temps = list(dic.keys())
        location = pre + folder + "/simulation/dis_{}/0/".format(dis)
        for temp in temps:
            os.system(f"cp {location}t{dic[temp]}_new.dat {pre}{folder}/data/dis_{dis}_temp_{dic[temp]}.dat")


30.0
31.0
32.0
33.0
34.0
35.0
36.0
37.0
38.0
39.0
40.0
41.0
42.0
43.0
44.0
45.0
46.0
47.0
48.0
49.0
50.0
51.0
52.0
53.0
54.0
55.0
56.0
57.0
58.0
59.0
60.0
61.0
62.0
63.0
64.0
65.0
66.0
67.0
68.0
69.0
70.0
71.0
72.0
73.0
74.0
75.0
76.0
77.0
78.0
79.0
80.0
81.0
82.0
83.0
84.0
85.0
86.0
87.0
88.0
89.0
90.0
91.0
92.0
93.0
94.0
95.0
96.0
97.0
98.0
99.0
100.0
101.0
102.0
103.0
104.0
105.0
106.0
107.0
108.0
109.0
110.0
111.0
112.0
113.0
114.0
115.0
116.0
117.0
118.0
119.0
120.0
121.0
122.0
123.0
124.0
125.0
126.0
127.0
128.0
129.0
130.0
131.0
132.0
133.0
134.0
135.0
136.0
137.0
138.0
139.0
140.0
141.0
142.0
143.0
144.0
145.0
146.0
147.0
148.0
149.0
150.0
151.0
152.0
153.0
154.0
155.0
156.0
157.0
158.0
159.0
160.0
161.0
162.0
163.0
164.0
165.0
166.0
167.0
168.0
169.0
170.0
171.0
172.0
173.0
174.0
175.0
176.0
177.0
178.0
179.0
180.0

In [12]:
ls


Untitled.ipynb
angles.ipynb
lipid_Fluctuations.ipynb
native_structure_finder_final_aug23.ipynb
native_structure_finder_nov05.ipynb
pmf_plot.ipynb
read_data.ipynb
structure_prediction.ipynb
temper.ipynb
temper_nov05.ipynb
temper_oct15.ipynb
temper_oct21.ipynb
temper_oct24.ipynb
temper_oct31.ipynb

In [ ]: