-
Notifications
You must be signed in to change notification settings - Fork 5
/
experiment_analysis.py
executable file
·92 lines (78 loc) · 2.57 KB
/
experiment_analysis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env python3
import os
import argparse
import sys
from time import sleep
import subprocess
from experiment_functions import *
mypath = os.environ["PATH"]
os.environ["PATH"] = "/home/wl45/python/bin:/home/wl45/opt:" + mypath
my_env = os.environ.copy()
parser = argparse.ArgumentParser(
description="This is a python3 script to\
automatically analysis the simulation")
parser.add_argument("--ptl", help="pdb to lammps ", action="store_true", default=False)
args = parser.parse_args()
def pdbToLammps():
os.system("BuildAllAtomsFromLammps_seq.py dump.lammpstrj frame16 2xov.seq 16")
os.system("python2 ~/opt/LammpsPDBToCoordinates.py frame16 frame16.coord)
os.system("python2 ~/opt/script/CoordinatesToWorkLammpsDataFile.py frame16.coord data.frame16 -b")
if(args.ptl):
pdbToLammps()
# exec(open("config.py").read())
# n = number_of_run
# steps = simulation_steps
# # protein_name = protein_name
# os.system("mkdir results")
# clean()
# os.chdir("analysis")
#
# for i in range(n):
# os.chdir(str(i))
# gagb()
# os.chdir("..")
#
# os.chdir("../results")
# os.system("paste ga_highest.dat gb_highest.dat > gagb.dat")
#
# os.system("cp ~/opt/gagb/q_ga-gb.gp .")
# os.system("gnuplot q_ga-gb.gp")
# os.system("open q_ga-gb.pdf")
#
# os.system("cp ~/opt/gagb/q_ga.gp .")
# os.system("gnuplot q_ga.gp")
# os.system("open q_ga.pdf")
#
# os.system("cp ~/opt/gagb/q_gb.gp .")
# os.system("gnuplot q_gb.gp")
# os.system("open q_gb.pdf")
# os.chdir("..")
# os.system("mkdir -p results")
# for i in range(n):
# # analysis
# os.system("mkdir -p analysis/"+str(i))
# os.chdir("analysis/"+str(i))
#
# sys.stdout = open("final.txt", "w")
# print('ITEM: TIMESTEP')
# time_step = simulation_steps
# with open('dump.lammpstrj') as input_data:
# # Skips text before the beginning of the interesting block:
# for line in input_data:
# if line.strip() == str(time_step):
# print(line.strip()) # Or whatever test is needed
# break
# # Reads text until the end of the block:
# for line in input_data: # This keeps reading the file
# if line.strip() == 'ITEM: TIMESTEP':
# break
# print(line.strip())
# sys.stdout.close()
#
# os.chdir("../..")
# os.system("> results/cross_q")
# for i in range(n):
# for j in range(0, i):
# os.system("echo '"+str(i)+" "+str(j)+" \c' >> results/cross_q")
# os.system("python2 ~/opt/CalcQValue.py analysis/"+str(i)+"/final \
# analysis/"+str(j)+"/final.txt >> results/cross_q ")