-
Notifications
You must be signed in to change notification settings - Fork 1
/
jarzynski.py
47 lines (35 loc) · 1.32 KB
/
jarzynski.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
import sys
import pandas as pd
import numpy as np
import time
import optparse
#! check input of module.
tool = sys.argv[1]
if tool == "pmf":
from src.compute_jarzynski import IO, Jarzynski
opts = IO().main()
if opts.usage:
IO().usage()
else:
IO().message("Reading Non-equilibrium dynamics data.")
time.sleep(1)
IO().message("Reconstruct PMF from Non-equilibrium dynamics.")
time.sleep(1)
pmf1, pmf2,d = Jarzynski(file=opts.ifile, T=opts.temperature, engine=opts.engine).reconstruct_PMF()
IO().message("Writng Ofile to {}".format(opts.ofile))
IO().write_ofile(ofile_name=opts.ofile, pmf_no_beta=pmf1, pmf_with_beta=pmf2, d=d)
IO().message("Done.")
elif tool == "kd":
from src.computeKd import IO, Kd
opts = IO().main()
if opts.usage:
IO().usage()
else:
IO().message("Start to compute Dissociation constant [Kd].")
time.sleep(2)
kd1, kd2, unit = Kd(file=opts.ifile, boxVol=opts.box_volume, T=opts.temperature, engine=opts.engine).compute_kd(unit=opts.units)
IO().message("Wrote output file.")
IO().write_ofile(ofile_name=opts.ofile, kd1=kd1, kd2=kd2, unit=unit)
else:
IO().message("You haven't select any tool.")
IO().message("%usage: jarzysnki pmf -h or jarzysnki kd -h.")