wepy icon indicating copy to clipboard operation
wepy copied to clipboard

UnbindingBCDashboardSection not reporting warps correctly

Open alexrd opened this issue 4 years ago • 3 comments

No warps show up in the dashboard reporter even though there are warping events in the HDF5.

alexrd avatar Aug 16 '21 21:08 alexrd

Hi, Using the example lisozyme system in implicit solvent I noticed this issue too, no warps are reported and the rate (tau) is reported as 0.0. I ran with 48 walkers, 1000 cycles and for 10000 steps per cycle (dt = 0.002 ps). At the end of the run there were 52 exit points. I tried to calculate the unbinding rate using the following.

from wepy.resampling.resamplers.wexplore import WExploreResampler
from wepy.boundary_conditions.receptor import UnbindingBC
from wepy.hdf5 import WepyHDF5
from wepy.analysis.contig_tree import ContigTree
from wepy.analysis.profiles import ContigTreeProfiler

h5_path = './result.wepy.h5'
wepy_h5 = WepyHDF5(h5_path, mode='r+')
with wepy_h5:
    contigtree = ContigTree(wepy_h5, decision_class=WExploreResampler.DECISION,
                                                            boundary_condition_class=UnbindingBC)
from wepy.analysis.rates import contig_warp_rates
with wepy_h5:
    sample = contigtree.make_contig(contigtree.spanning_contig_traces()[0])
    results = contig_warp_rates(sample,20) #  20 ps per cycle 

total_weight = results[-1][0][0]
flux = results[-1][0][1]
sampling_time = results[-1][0][2]

rate = flux

is that the right approach to get an unbinding rate? Thanks

wpena1 avatar Sep 23 '21 22:09 wpena1

I tried this on one of my files and the answer was off. I'm not 100% sure why since I haven't used those functions. Instead I would use this much simpler approach (it's faster too):

import numpy as np
wepy_h5.open()

time_per_cycle = 20 # ps

# get the total elapsed time of the simulation
tot_time = wepy_h5.num_traj_frames(0,0) * time_per_cycle

# get the sum of all the warped walkers
tot_weight = np.array(wepy_h5.h5['runs/0/warping/weight']).sum()

rate = tot_weight/tot_time  # in ps^-1
rate_s = rate*1e12          # rate in s^-1

This assumes that you only have one run in your h5 file. If you have more than one you can add up the weights and elapsed times in each run.

alexrd avatar Oct 15 '21 20:10 alexrd

Will give this a try. Thanks a lot.

wpena1 avatar Oct 15 '21 21:10 wpena1