def test_calculate_starting_points_no_need_to_minimize(self): atoms, residues, chains = parse_complex_from_file( self.golden_data_path + '1PPE_rec.pdb') receptor = Complex(chains, atoms) atoms, residues, chains = parse_complex_from_file( self.golden_data_path + '1PPE_lig.pdb') ligand = Complex(chains, atoms) # Move structures to origin receptor_center = receptor.center_of_coordinates() ligand_center = ligand.center_of_coordinates() receptor_translation = [-1. * c for c in receptor_center] ligand_translation = [-1. * c for c in ligand_center] receptor.translate(receptor_translation) ligand.translate(ligand_translation) poses = FTDockCoordinatesParser.get_list_of_poses( self.golden_data_path + '1PPE.ftdock', ligand_center) assert 10000 == len(poses) for i in range(5): assert self.quaternions[i] == poses[i].q for j in range(3): assert_almost_equal(self.translations[i][j], poses[i].translation[j])
def test_calculate_starting_points_no_need_to_minimize(self): atoms, residues, chains = parse_complex_from_file(self.golden_data_path + '1PPE_rec.pdb') receptor = Complex(chains, atoms) atoms, residues, chains = parse_complex_from_file(self.golden_data_path + '1PPE_lig.pdb') ligand = Complex(chains, atoms) # Move structures to origin receptor_center = receptor.center_of_coordinates() ligand_center = ligand.center_of_coordinates() receptor_translation = [-1.*c for c in receptor_center] ligand_translation = [-1.*c for c in ligand_center] receptor.translate(receptor_translation) ligand.translate(ligand_translation) poses = FTDockCoordinatesParser.get_list_of_poses(self.golden_data_path + '1PPE.ftdock', ligand_center) assert 10000 == len(poses) for i in range(5): assert self.quaternions[i] == poses[i].q for j in range(3): assert_almost_equal(self.translations[i][j], poses[i].translation[j])
def test_center_of_coordinates_zero_atoms(self): protein = Complex(chains=[]) cc = protein.center_of_coordinates() assert_almost_equals(0.0, cc[0]) assert_almost_equals(0.0, cc[1]) assert_almost_equals(0.0, cc[2])
def test_center_of_coordinates(self): protein = Complex(chains=self.chains) cc = protein.center_of_coordinates() assert_almost_equals(1.75, cc[0]) assert_almost_equals(1.75, cc[1]) assert_almost_equals(1.75, cc[2])