Skip to content

Commit

Permalink
Add sampling method option to tautomer drives
Browse files Browse the repository at this point in the history
This adds the samplingmethod constructor argument to the tautomer
driver classes.
  • Loading branch information
Bas Rustenburg committed Apr 3, 2019
1 parent ec6bc2f commit eba0ded
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions protons/app/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -4159,13 +4159,34 @@ def strip_in_unit_system(quant, unit_system=unit.md_unit_system, compatible_with
class TautomerNCMCProtonDrive(NCMCProtonDrive):
def __init__(
self,
temperature,
topology,
system,
pressure=None,
perturbations_per_trial=0,
propagations_per_step=1,
temperature: unit.Quantity,
topology: app.Topology,
system: mm.System,
pressure: Optional[unit.Quantity] = None,
perturbations_per_trial: int = 0,
propagations_per_step: int = 1,
sampling_method: SamplingMethod = SamplingMethod.MCMC,
):
"""
Initialize a Monte Carlo titration driver for simulation of protonation states and tautomers.
Parameters
----------
temperature : simtk.unit.Quantity compatible with kelvin
Temperature at which the system is to be simulated.
topology : protons.app.Topology
OpenMM object containing the topology of system
system : simtk.openmm.System
System to be titrated, containing all possible protonation sites.
pressure : simtk.unit.Quantity compatible with atmospheres, optional
For explicit solvent simulations, the pressure.
perturbations_per_trial : int, optional, default=0
Number of perturbation steps per NCMC switching trial, or 0 if instantaneous Monte Carlo is to be used.
propagations_per_step : int, optional, default=1
Number of propagation steps in between perturbation steps.
sampling_method : The method of sampling that is used.
See the SamplingMethod enum for the set of supported options (including MCMC and importance sampling).
"""

super().__init__(
temperature,
Expand All @@ -4174,6 +4195,7 @@ def __init__(
pressure=pressure,
perturbations_per_trial=perturbations_per_trial,
propagations_per_step=propagations_per_step,
sampling_method=sampling_method,
)
# Store force object pointers.
force_classes_to_update = [
Expand Down Expand Up @@ -4688,6 +4710,7 @@ def __init__(
propagations_per_step=1,
residues_by_name=None,
residues_by_index=None,
sampling_method: SamplingMethod = SamplingMethod.MCMC,
):

"""
Expand Down Expand Up @@ -4741,6 +4764,7 @@ def __init__(
pressure,
perturbations_per_trial=perturbations_per_trial,
propagations_per_step=propagations_per_step,
sampling_method=sampling_method,
)

ffxml_residues = self._parse_ffxml_files(ffxml_files)
Expand Down

0 comments on commit eba0ded

Please sign in to comment.