Skip to content

Commit 46cc331

Browse files
committed
example started for getting a walker lineage DCD
1 parent 80f8c51 commit 46cc331

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import sys
2+
import os.path as osp
3+
4+
from wepy.hdf5 import WepyHDF5
5+
from wepy.analysis.tree import ancestors
6+
from wepy.resampling.wexplore1 import WExplore1Resampler
7+
8+
if sys.argv[1] == '-h' or sys.argv[1] == '--help':
9+
print("walker_lineage.py run_index walker_index output_DCD_path")
10+
else:
11+
run_idx = sys.argv[1]
12+
walker_idx = sys.argv[2]
13+
dcd_path = sys.argv[3]
14+
15+
outputs_dir = osp.realpath('../outputs')
16+
17+
hdf5_filename = 'results.wepy.h5'
18+
19+
hdf5_path = osp.join(outputs_dir, hdf5_filename)
20+
21+
wepy_h5 = WepyHDF5(hdf5_path, mode='r')
22+
23+
wepy_h5.open()
24+
25+
cycle_idx = wepy_h5.traj(run_idx, walker_idx)['positions'].shape[0]
26+
27+
resampling_panel = wepy_h5.run_resampling_panel(run_idx)
28+
29+
parent_panel = WExplore1.DECISION.parent_panel(resampling_panel)
30+
parent_table = WExplore1.DECISION.net_parent_panel(parent_panel)
31+
32+
lineage = ancestors(parent_table, cycle_idx, walker_idx)
33+
34+
mdj_traj = wepy_h5.trace_to_mdtraj(lineage)
35+
36+
mdj_traj.save_dcd(dcd_path)

0 commit comments

Comments
 (0)