Esempio n. 1
0
 def test_cutoff_sets_correct_method(self):
     openmm_runner._create_openmm_system(
         self.mock_parm,
         solvation_type="implicit",
         cutoff=1.5,
         use_big_timestep=False,
         use_bigger_timestep=False,
         implicit_solvent="obc",
         pme_params=self.pme_params,
         pcouple_params=self.pcouple_params,
         remove_com=False,
         temperature=self.TEMP,
         extra_bonds=[],
         extra_restricted_angles=[],
         extra_torsions=[],
         implicitSolventSaltConc=None,
         soluteDielectric=None,
         solventDielectric=None,
     )
     self.mock_parm.createSystem.assert_called_with(
         removeCMMotion=False,
         nonbondedMethod=ff.CutoffNonPeriodic,
         nonbondedCutoff=1.5,
         constraints=ff.HBonds,
         implicitSolvent=OBC2,
         hydrogenMass=None,
         implicitSolventSaltConc=0.0,
         soluteDielectric=1.0,
         solventDielectric=78.5,
     )
Esempio n. 2
0
    def test_pressure_coupling_should_add_barostat(self):
        PRESS = 2.0 * atmosphere
        STEPS = 50
        pcouple_params = openmm_runner.PressureCouplingParams(
            enable=True, temperature=self.TEMP, pressure=PRESS, steps=STEPS)
        pme_params = openmm_runner.PMEParams(enable=True, tolerance=0.0005)

        with mock.patch(
                "meld.runner.openmm_runner.mm.MonteCarloBarostat",
                spec=MonteCarloBarostat,
        ) as mock_baro:
            mock_baro.return_value = mock.sentinel.baro_force

            openmm_runner._create_openmm_system(
                self.mock_parm,
                solvation_type="explicit",
                cutoff=1.0,
                use_big_timestep=False,
                use_bigger_timestep=False,
                implicit_solvent="vacuum",
                pme_params=pme_params,
                pcouple_params=pcouple_params,
                remove_com=True,
                temperature=self.TEMP,
                extra_bonds=[],
                extra_restricted_angles=[],
                extra_torsions=[],
                implicitSolventSaltConc=None,
                soluteDielectric=None,
                solventDielectric=None,
            )

            mock_baro.assert_called_with(PRESS, self.TEMP, STEPS)
            mock_sys = self.mock_parm.createSystem.return_value
            mock_sys.addForce.assert_called_with(mock.sentinel.baro_force)
Esempio n. 3
0
    def test_no_pme_uses_cutoffs(self):
        pme_params = openmm_runner.PMEParams(enable=False, tolerance=0.0001)

        openmm_runner._create_openmm_system(
            self.mock_parm,
            solvation_type="explicit",
            cutoff=1.0,
            use_big_timestep=False,
            use_bigger_timestep=False,
            implicit_solvent="vacuum",
            pme_params=pme_params,
            pcouple_params=self.pcouple_params,
            remove_com=True,
            temperature=self.TEMP,
            extra_bonds=[],
            extra_restricted_angles=[],
            extra_torsions=[],
            implicitSolventSaltConc=None,
            soluteDielectric=None,
            solventDielectric=None,
        )
        self.mock_parm.createSystem.assert_called_with(
            removeCMMotion=True,
            nonbondedMethod=ff.CutoffPeriodic,
            nonbondedCutoff=1.0,
            constraints=ff.HBonds,
            implicitSolvent=None,
            rigidWater=True,
            hydrogenMass=None,
            ewaldErrorTolerance=pme_params.tolerance,
        )
Esempio n. 4
0
 def test_bigger_timestep_sets_allbonds_and_hydrogen_masses(self):
     openmm_runner._create_openmm_system(
         self.mock_parm,
         solvation_type="explicit",
         cutoff=1.0,
         use_big_timestep=False,
         use_bigger_timestep=True,
         implicit_solvent="vacuum",
         pme_params=self.pme_params,
         pcouple_params=self.pcouple_params,
         remove_com=True,
         temperature=self.TEMP,
         extra_bonds=[],
         extra_restricted_angles=[],
         extra_torsions=[],
         implicitSolventSaltConc=None,
         soluteDielectric=None,
         solventDielectric=None,
     )
     self.mock_parm.createSystem.assert_called_with(
         removeCMMotion=True,
         nonbondedMethod=ff.PME,
         nonbondedCutoff=1.0,
         constraints=ff.AllBonds,
         implicitSolvent=None,
         rigidWater=True,
         hydrogenMass=4.0 * gram / mole,
         ewaldErrorTolerance=self.pme_params.tolerance,
     )
Esempio n. 5
0
 def test_big_timestep_sets_allbonds_and_hydrogen_masses(self):
     openmm_runner._create_openmm_system(
         self.mock_parm,
         solvation_type="implicit",
         cutoff=None,
         use_big_timestep=True,
         use_bigger_timestep=False,
         implicit_solvent="obc",
         pme_params=self.pme_params,
         pcouple_params=self.pcouple_params,
         remove_com=False,
         temperature=self.TEMP,
         extra_bonds=[],
         extra_restricted_angles=[],
         extra_torsions=[],
         implicitSolventSaltConc=None,
         soluteDielectric=None,
         solventDielectric=None,
     )
     self.mock_parm.createSystem.assert_called_with(
         removeCMMotion=False,
         nonbondedMethod=ff.NoCutoff,
         nonbondedCutoff=999.0,
         constraints=ff.AllBonds,
         implicitSolvent=OBC2,
         hydrogenMass=3.0 * (gram / mole),
         implicitSolventSaltConc=0.0,
         soluteDielectric=1.0,
         solventDielectric=78.5,
     )