Mercurial > repos > chemteam > biomd_rmsd_clustering
annotate NEQGamma.py @ 1:b001ebc8bf58 draft
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
author | chemteam |
---|---|
date | Fri, 11 Sep 2020 21:55:34 +0000 |
parents | |
children | b9c46dbe9605 |
rev | line source |
---|---|
1
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
1 #!/usr/bin/env python |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
2 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
3 # coding: utf-8 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
4 # This script is a modified version of a script written |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
5 # by Steffen Wolf under the GPL v3.0. |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
6 # The original version can be accessed at |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
7 # https://github.com/moldyn/dcTMD/blob/master/NEQGamma.py |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
8 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
9 import argparse |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
10 import json |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
11 import sys |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
12 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
13 import numpy as np |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
14 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
15 import pandas as pd |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
16 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
17 import scipy |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
18 import scipy.integrate |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
19 from scipy.ndimage.filters import gaussian_filter |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
20 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
21 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
22 def get_file_names(list_file): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
23 with open(list_file) as f: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
24 return [line for line in f.read().split('\n') if line] |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
25 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
26 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
27 def NEQGamma(file_names, output, output_frict, vel, T, av, sigma): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
28 N = len(file_names) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
29 RT = 0.0083144598 * T |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
30 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
31 sys.stdout.write("reading data...\n") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
32 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
33 # read in initial data to get length of necessary array |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
34 test_file = pd.read_csv(file_names[0], delim_whitespace=True, |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
35 header=None, skiprows=17, dtype=float) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
36 length_data = len(test_file[0].values) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
37 full_force_set = np.zeros((N, length_data)) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
38 x = np.zeros(length_data) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
39 t = np.zeros(length_data) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
40 t = test_file[0].values |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
41 x = test_file[0].values * vel |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
42 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
43 # read in data |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
44 for i in range(0, N): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
45 current_file_name = file_names[i] |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
46 sys.stdout.write("reading file {}\n".format(current_file_name)) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
47 input_file_data = pd.read_csv(current_file_name, delim_whitespace=True, |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
48 header=None, skiprows=17, dtype=float) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
49 full_force_set[i, :] = input_file_data[1].values |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
50 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
51 # preprocessing |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
52 # * force average: calculate $\left< f_c (t)\right>_N$. |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
53 # **Important:** this is an ensemble average over the trajectory ensemble |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
54 # $N$, not the time average over $t$ |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
55 av_force = np.zeros(length_data) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
56 av_forceintegral = np.zeros(length_data) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
57 for i in range(length_data): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
58 av_force[i] = np.mean(full_force_set[:, i]) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
59 av_forceintegral[1:] = scipy.integrate.cumtrapz(av_force, x) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
60 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
61 # calculate $\delta f_c(t) = f_c(t) - \left< f_c (t) \right>_N$ for all $t$ |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
62 sys.stdout.write("calculating fluctuations...\n") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
63 delta_force_set = np.zeros((N, length_data)) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
64 for i in range(length_data): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
65 delta_force_set[:, i] = full_force_set[:, i] - av_force[i] |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
66 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
67 # evaluation |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
68 # * optimized algorithm for numerical evaluation: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
69 # * integrate: $\int_0^t dt' \delta f_c(t')$ for all $t'$ |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
70 # * multiply by $\delta f_c(t)$ to yield |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
71 # $\int_0^t dt'\delta f_c(t) \delta f_c(t')$ for $t$ |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
72 # with all $t' \leq t$ each |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
73 # * then calculate the ensemble average |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
74 # $\left< \int_0^t dt' \delta f_c(t) \delta f_c(t') \right>$ |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
75 int_delta_force_set = np.zeros((N, length_data)) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
76 for n in range(N): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
77 int_delta_force_set[n, 1:] = scipy.integrate.cumtrapz( |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
78 delta_force_set[n, :], t) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
79 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
80 sys.stdout.write("averaging and integrating...\n") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
81 intcorr = np.zeros((N, length_data)) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
82 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
83 for n in range(N): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
84 for i in range(length_data): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
85 intcorr[n, i] = delta_force_set[n, i] * int_delta_force_set[n, i] |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
86 if i % 1000 == 0: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
87 sys.stdout.write("Trajectory {:2d} {:3.1f} % done\r".format( |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
88 n + 1, (i / length_data) * 100)) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
89 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
90 # shape of $\int_0^t dt' \delta f_c(t) \delta f_c(t')$: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
91 sys.stdout.write("final average...\n") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
92 av_intcorr = np.zeros(length_data) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
93 for i in range(length_data): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
94 av_intcorr[i] = np.mean(intcorr[:, i]) / RT |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
95 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
96 # autocorrelation function evaluation: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
97 # * calculate $\left< \delta f_c(t) \delta f_c(t') \right>$ |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
98 # for the last $t$ |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
99 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
100 corr_set = np.zeros((N, length_data)) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
101 autocorr_set = np.zeros(length_data) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
102 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
103 sys.stdout.write("calculating and processing ACF...\n") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
104 for n in range(N): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
105 for i in range(length_data): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
106 corr_set[n, i] = delta_force_set[ |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
107 n, i] * delta_force_set[n, length_data - 1] |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
108 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
109 for i in range(length_data): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
110 autocorr_set[i] = np.mean(corr_set[:, i]) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
111 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
112 # * Gauss filter: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
113 sys.stdout.write("applying Gauss filter...\n") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
114 blurr = sigma |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
115 blurred = np.zeros(length_data) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
116 blurred = gaussian_filter(av_intcorr, sigma=blurr) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
117 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
118 # * sliding window average: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
119 sys.stdout.write("applying sliding window average...\n") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
120 window = av |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
121 runn_av = np.zeros(length_data) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
122 runn_av = np.convolve(av_intcorr, np.ones((window,)) / window, mode='same') |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
123 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
124 # * $W_{diss}$ from integration: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
125 wdiss = np.zeros(length_data) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
126 wdiss[1:] = scipy.integrate.cumtrapz(av_intcorr, x) * vel |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
127 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
128 sys.stdout.write("writing output...\n") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
129 dist = open(output, "w") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
130 frict = open(output_frict, "w") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
131 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
132 dist.write( |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
133 "#x force_integral frict_coeff wdiss corrected_force_integral\n") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
134 for i in range(length_data): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
135 dist.write("{:15.8f} {:20.8f} {:20.8f} {:20.8f} {:20.8f}\n".format( |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
136 x[i], av_forceintegral[i], av_intcorr[i], wdiss[i], |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
137 av_forceintegral[i] - wdiss[i])) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
138 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
139 frict.write("""#x ACF frict_coeff """ |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
140 """gauss_filtered_frict_coeff av_window_frict_coeff\n""") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
141 for i in range(length_data): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
142 frict.write("{:15.8f} {:20.8f} {:20.8f} {:20.8f} {:20.8f}\n".format( |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
143 x[i], autocorr_set[i], av_intcorr[i], blurred[i], runn_av[i])) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
144 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
145 dist.close() |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
146 frict.close() |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
147 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
148 sys.stdout.write("Done!\n") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
149 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
150 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
151 def main(): |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
152 parser = argparse.ArgumentParser(description="""dcTMD friciton correction |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
153 (please cite: Wolf, S., Stock, G. Targeted Molecular Dynamics |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
154 Calculations of Free Energy Profiles Using a Nonequilibrium |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
155 Friction Correction. J. Chem. Theory Comput. 2018, 14(12), 6175-6182, |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
156 DOI: 10.1021/acs.jctc.8b00835). Integrates a constraint force file via |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
157 trapezoid rule, calculates the NEQ memory friction kernel and friction |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
158 factors, and performs a friction correction. First column: reaction |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
159 coordinate in nm calculated via t * vel. Second column: force integral, |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
160 i.e. the work profile. Third column: friction factors. Fourth column: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
161 trapezoid integral (final value) of friction work along reaction |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
162 coordinate. Fourth column: friction corrected work profile. ATTENTION: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
163 Use with python3 or higher!""") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
164 parser.add_argument('-i', metavar='<xvg force file>', type=str, |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
165 help="""List of xvg constraint force files prefix |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
166 as given by Gromacs mdrun -pf option before running |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
167 number.""") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
168 parser.add_argument('-o', metavar='<combined results>', type=str, |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
169 help="""file to write x, dG(x), friction coefficeint by |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
170 integration (time resolved), and the friction-corrected |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
171 dG(x).""") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
172 parser.add_argument('-ofrict', metavar='<combined friction results>', |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
173 type=str, |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
174 help="""file to write x, ACF, friction coefficeint by |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
175 integration (time resolved), gauss filtered friction |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
176 coefficient, and slide window averaged friction.""") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
177 parser.add_argument('-vel', metavar='<pull velocity>', type=float, |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
178 help="""pull velocity in nm/ps for converting simulation |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
179 time t into distance x""") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
180 parser.add_argument('-T', metavar='<temperature>', type=float, |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
181 help='temperature in K') |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
182 parser.add_argument('-av', metavar='<average window>', type=int, |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
183 help="""size of averaging window for displaying |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
184 Gamma(x) (recommended: 4 to 20 per 100 data points)""") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
185 parser.add_argument('-sigma', metavar='<gauss blurr>', type=int, |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
186 help="""sigma value for Gauss filter for displaying |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
187 Gamma(x) (recommended: 4 per 100 data points)""") |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
188 parser.add_argument('-json', metavar='<json>', type=str, |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
189 help='JSON file defining cluster membership') |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
190 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
191 args = parser.parse_args() |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
192 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
193 file_names = get_file_names(args.i) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
194 if args.json: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
195 with open(args.json) as f: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
196 j = json.load(f) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
197 file_names_dct = {n: [file_names[int(m)] for m in j[n]] for n in j} |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
198 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
199 for cluster in file_names_dct: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
200 NEQGamma(file_names_dct[cluster], |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
201 'cluster{}_{}'.format(cluster, args.o), |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
202 'cluster{}_{}'.format(cluster, args.ofrict), |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
203 args.vel, args.T, args.av, args.sigma) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
204 else: |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
205 NEQGamma(file_names, args.o, args.ofrict, args.vel, |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
206 args.T, args.av, args.sigma) |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
207 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
208 |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
209 if __name__ == "__main__": |
b001ebc8bf58
"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/ commit 79589d149a8ff2791d4f71d28b155011672db827"
chemteam
parents:
diff
changeset
|
210 main() |