Example #1
0
    def test_implicit_runner_amap(self):
        p = subsystem.SubSystemFromSequence("NALA ALA CALA")
        b = builder.SystemBuilder()
        sys = b.build_system([p])
        sys.temperature_scaler = temperature.ConstantTemperatureScaler(300.0 * u.kelvin)

        opt = options.RunOptions()
        opt.timesteps = 20
        opt.use_amap = True
        opt.amap_beta_bias = 10

        runner = openmm_runner.OpenMMRunner(sys, opt, platform="Reference")
        runner.prepare_for_timestep(sys.get_state_template(), 0.0, 1)

        pos = sys._coordinates.copy()
        vel = np.zeros_like(pos)
        alpha = 0.0
        energy = 0.0
        box_vectors = np.zeros(3)
        s = state.SystemState(pos, vel, alpha, energy, box_vectors)

        s = runner.minimize_then_run(s)
        s = runner.run(s)

        assert s
Example #2
0
    def test_explicit_runner_scaler(self):
        p = subsystem.SubSystemFromSequence("NALA ALA CALA")
        b = builder.SystemBuilder(explicit_solvent=True)
        sys = b.build_system([p])
        sys.temperature_scaler = temperature.ConstantTemperatureScaler(300.0 * u.kelvin)
        rest2_scaler = temperature.GeometricTemperatureScaler(
            0, 1, 300.0 * u.kelvin, 350.0 * u.kelvin
        )

        opt = options.RunOptions(solvation="explicit")
        opt.rest2_scaler = temperature.REST2Scaler(300.0 * u.kelvin, rest2_scaler)
        opt.minimize_steps = 100
        opt.timesteps = 2
        opt.use_rest2 = True

        runner = openmm_runner.OpenMMRunner(sys, opt, platform="Reference")
        runner.prepare_for_timestep(sys.get_state_template(), 0.0, 1)

        pos = sys._coordinates.copy()
        vel = np.zeros_like(pos)
        alpha = 0.0
        energy = 0.0
        box_vectors = sys._box_vectors
        s = state.SystemState(pos, vel, alpha, energy, box_vectors)

        s = runner.minimize_then_run(s)
        s = runner.run(s)

        assert s
Example #3
0
 def test_lyn_should_match_lys(self):
     p = subsystem.SubSystemFromSequence("NCYX ALA CCYX")
     p.add_disulfide(ResidueIndex(0), ResidueIndex(2))
     b = builder.SystemBuilder()
     system = b.build_system([p])
     system.index.residue(0, expected_resname="CYS", one_based=False)
     system.index.residue(2, expected_resname="CYS", one_based=False)
Example #4
0
    def setUp(self):
        # create a tri-ala molecule
        p = subsystem.SubSystemFromSequence("NALA ALA CALA")
        b = builder.SystemBuilder()
        self.system = b.build_system([p, p])

        # mock openmm system to recieve the new cmap torsion force
        self.mock_openmm_system = mock.Mock(spec=openmm.System)

        # patch out CMAPTorsionForce so we can see how it is called
        self.patcher = mock.patch(
            "meld.runner.transform.cmap.mm.CMAPTorsionForce",
            spec=openmm.CMAPTorsionForce,
        )
        self.MockCMAP = self.patcher.start()
        self.mock_cmap = mock.Mock(spec=openmm.CMAPTorsionForce)
        self.MockCMAP.return_value = self.mock_cmap
Example #5
0
 def make_system(self, restype):
     sequence = f"NALA {restype} CALA"
     p = subsystem.SubSystemFromSequence(sequence)
     b = builder.SystemBuilder()
     self.system = b.build_system([p])
Example #6
0
 def test_lyn_should_match_lys(self):
     p1 = subsystem.SubSystemFromSequence("NALA LYN CLYS")
     b = builder.SystemBuilder()
     system = b.build_system([p1])
     system.index.residue(1, expected_resname="LYS", one_based=False)
Example #7
0
 def setUp(self):
     p1 = subsystem.SubSystemFromSequence("NALA CYS CLYS")
     p2 = subsystem.SubSystemFromSequence("NARG TRP CTYR")
     b = builder.SystemBuilder()
     self.system = b.build_system([p1, p2])
Example #8
0
 def setUp(self):
     p1 = subsystem.SubSystemFromSequence("NALA ALA CALA")
     p2 = subsystem.SubSystemFromSequence("NALA ALA CALA")
     b = builder.SystemBuilder()
     self.system = b.build_system([p1, p2])
Example #9
0
 def test_ash_should_match_asp(self):
     p1 = subsystem.SubSystemFromSequence("NALA GLH CLYS")
     b = builder.SystemBuilder()
     system = b.build_system([p1])
     system.index.atom(1, "CA", expected_resname="GLU", one_based=False)
Example #10
0
 def test_hip_should_match_his(self):
     p1 = subsystem.SubSystemFromSequence("NALA HIP CLYS")
     b = builder.SystemBuilder()
     system = b.build_system([p1])
     system.index.atom(1, "CA", expected_resname="HIS", one_based=False)
Example #11
0
 def setUp(self):
     p = subsystem.SubSystemFromSequence("NALA ALA CALA")
     b = builder.SystemBuilder()
     self.system = b.build_system([p])
     self.system.temperature_scaler = temperature.ConstantTemperatureScaler(
         300.0 * kelvin)