proteneer / timemachine

Differentiate all the things!
Other
138 stars 17 forks source link

Fixes incorrect selection of water molecule in Targeted Insertion #1281

Closed badisa closed 5 months ago

badisa commented 5 months ago

Analysis

Previous analysis (where the code was incorrect) we had determined that the results were correct at about 50-50 occupancy of 1 or 2 waters in the buckyball. Two runs from 0 and 6 starting waters produces a different result in this case compared to the previous values we saw in https://github.com/proteneer/timemachine/pull/1228. Though in our HREX reference we have seen up to 70%-30% split, so its unclear if this is a convergence issue, a correctness issue or something else.

Used the following commands to generate the data

python -u examples/water_sampling_mc.py --water_pdb timemachine/datasets/water_exchange/bb_0_waters.pdb --ligand_sdf timemachine/datasets/water_exchange/bb_centered_espaloma.sdf --out_cif traj_0_waters.cif --md_steps_per_batch 10000 --mc_steps_per_batch 10000 --insertion_type targeted --use_hmr 1 --iterations 20000
python -u examples/water_sampling_mc.py --water_pdb timemachine/datasets/water_exchange/bb_6_waters.pdb --ligand_sdf timemachine/datasets/water_exchange/bb_centered_espaloma.sdf --out_cif traj_6_waters.cif --md_steps_per_batch 10000 --mc_steps_per_batch 10000 --insertion_type targeted --use_hmr 1 --iterations 20000

image

Starting from 0 Total MC Moves 200000000 Num Waters in Buckyball: 1, 57.50% Num Waters in Buckyball: 2, 42.49%

Starting from 6 Total MC Moves 200000000 Num Waters in Buckyball: 5, 0.01% Num Waters in Buckyball: 3, 0.03% Num Waters in Buckyball: 2, 34.73% Num Waters in Buckyball: 1, 65.24%

image

badisa commented 5 months ago

Offline @proteneer had asked for a plot with the rolling average

image

In this view it looks like they may both be converging to 1.5 (or 50% for each) over time

From the same data as the plots in the descriptions.

Another request was looking at the neutral buckyball case:

python -u examples/water_sampling_mc.py --water_pdb timemachine/datasets/water_exchange/bb_0_waters.pdb --ligand_sdf timemachine/datasets/water_exchange/bb_centered_neutral.sdf --out_cif traj_0_waters.cif --md_steps_per_batch 10000 --mc_steps_per_batch 10000 --insertion_type targeted --use_hmr 1

Still preliminary since it hasn't been running long:

Waters are accepted for a short time then rejected almost immediately image

image

Significantly more accepted proposals compared to the charged case image

Charged case for reference: image