def test_move_step_rot_full_step_trans_full(self):
     atoms, residues, chains = parse_complex_from_file(self.golden_data_path + '1PPElig.pdb')
     ligand = Complex(chains, atoms)
     adapter = MJ3hAdapter(self.receptor, ligand)
     scoring_function = MJ3h()
     coordinates1 = Coordinates([0.,0.,0.,1.,0.,0.,0.])
     landscape_position1 = DockingLandscapePosition(scoring_function, coordinates1, 
                                                   adapter.receptor_model, 
                                                   adapter.ligand_model, step_translation=10.0)
     adapter2 = MJ3hAdapter(self.receptor, ligand)
     coordinates2 = Coordinates([10.,0.,0.,1.,0.,0.,0.])
     landscape_position2 = DockingLandscapePosition(scoring_function, coordinates2, 
                                                   adapter2.receptor_model, 
                                                   adapter2.ligand_model)
     
     landscape_position1.move(landscape_position2)
     
     assert landscape_position1 == landscape_position2
Ejemplo n.º 2
0
    def test_move_step_rot_full_step_trans_full(self):
        atoms, residues, chains = parse_complex_from_file(
            self.golden_data_path + '1PPElig.pdb')
        ligand = Complex(chains, atoms)
        adapter = MJ3hAdapter(self.receptor, ligand)
        scoring_function = MJ3h()
        coordinates1 = Coordinates([0., 0., 0., 1., 0., 0., 0.])
        landscape_position1 = DockingLandscapePosition(scoring_function,
                                                       coordinates1,
                                                       adapter.receptor_model,
                                                       adapter.ligand_model,
                                                       step_translation=10.0)
        adapter2 = MJ3hAdapter(self.receptor, ligand)
        coordinates2 = Coordinates([10., 0., 0., 1., 0., 0., 0.])
        landscape_position2 = DockingLandscapePosition(scoring_function,
                                                       coordinates2,
                                                       adapter2.receptor_model,
                                                       adapter2.ligand_model)

        landscape_position1.move(landscape_position2)

        assert landscape_position1 == landscape_position2
Ejemplo n.º 3
0
    def test_move_step_rot_full_step_trans_half(self):
        atoms, residues, chains = parse_complex_from_file(self.golden_data_path + '1PPElig.pdb')
        ligand = Complex(chains, atoms)
        adapter = TOBIAdapter(self.receptor, ligand)
        scoring_function = TOBI()
        coordinates1 = Coordinates([0.,0.,0.,1.,0.,0.,0.])
        landscape_position1 = DockingLandscapePosition(scoring_function, coordinates1, 
                                                      adapter.receptor_model, 
                                                      adapter.ligand_model, step_translation=5.0)
        adapter2 = TOBIAdapter(self.receptor, ligand)
        coordinates2 = Coordinates([10.,0.,0.,1.,0.,0.,0.])
        landscape_position2 = DockingLandscapePosition(scoring_function, coordinates2, 
                                                      adapter2.receptor_model, 
                                                      adapter2.ligand_model)
        
        landscape_position1.move(landscape_position2)

        expected_translation = np.array([5.,0.,0.])
        expected_rotation = Quaternion()
        
        assert (expected_translation == landscape_position1.translation).all()
        assert expected_rotation == landscape_position1.rotation
    def test_move_step_rot_full_step_trans_half(self):
        atoms, residues, chains = parse_complex_from_file(self.golden_data_path + '1PPElig.pdb')
        ligand = Complex(chains, atoms)
        adapter = TOBIAdapter(self.receptor, ligand)
        scoring_function = TOBI()
        coordinates1 = Coordinates([0.,0.,0.,1.,0.,0.,0.])
        landscape_position1 = DockingLandscapePosition(scoring_function, coordinates1, 
                                                      adapter.receptor_model, 
                                                      adapter.ligand_model, step_translation=5.0)
        adapter2 = TOBIAdapter(self.receptor, ligand)
        coordinates2 = Coordinates([10.,0.,0.,1.,0.,0.,0.])
        landscape_position2 = DockingLandscapePosition(scoring_function, coordinates2, 
                                                      adapter2.receptor_model, 
                                                      adapter2.ligand_model)
        
        landscape_position1.move(landscape_position2)

        expected_translation = np.array([5.,0.,0.])
        expected_rotation = Quaternion()
        
        assert (expected_translation == landscape_position1.translation).all()
        assert expected_rotation == landscape_position1.rotation
Ejemplo n.º 5
0
    def test_move_step_rot_half_step_trans_half_and_anm(self):
        atoms, _, chains = parse_complex_from_file(self.golden_data_path /
                                                   '1PPElig.pdb')
        ligand = Complex(chains, atoms)
        adapter = MJ3hAdapter(self.receptor, ligand)
        scoring_function = MJ3h()
        coordinates1 = Coordinates(
            [0., 0., 0., 1., 0., 0., 0., 1., 1., 1., 1.])
        landscape_position1 = DockingLandscapePosition(scoring_function,
                                                       coordinates1,
                                                       adapter.receptor_model,
                                                       adapter.ligand_model,
                                                       step_translation=5.0,
                                                       step_rotation=0.5,
                                                       step_nmodes=0.5,
                                                       num_rec_nmodes=2,
                                                       num_lig_nmodes=2)
        adapter2 = MJ3hAdapter(self.receptor, ligand)
        coordinates2 = Coordinates(
            [10., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0.])
        landscape_position2 = DockingLandscapePosition(scoring_function,
                                                       coordinates2,
                                                       adapter2.receptor_model,
                                                       adapter2.ligand_model,
                                                       num_rec_nmodes=2,
                                                       num_lig_nmodes=2)

        landscape_position1.move(landscape_position2)

        expected_translation = np.array([5., 0., 0.])
        expected_rotation = Quaternion(0.707106781, 0.0, 0.707106781, 0.0)
        expected_anm = np.array([0.64644661, 0.64644661])
        assert np.allclose(expected_translation,
                           landscape_position1.translation)
        assert expected_rotation == landscape_position1.rotation
        assert np.allclose(expected_anm, landscape_position1.rec_extent)
        assert np.allclose(expected_anm, landscape_position1.lig_extent)