def to_pdb(self): self._populate_molecule() self.molecule.add_sequential_ids() self.molecule.update_internal_state() parameters = Parameters() self.molecule.set_force_field_parameters(parameters) self._rotate_to_default_position() return self.molecule
def setUp(self): self.molecule = Molecule(pdb_file_location='tests/data/ref01.pdb') self.parameters = Parameters() self.molecule.set_force_field_parameters(self.parameters) self.optimization = GradientDescent(self.atom_energy_function) self.optimization.dimensions_number = 3 self.optimization.iterations = 40 self.optimization.precision = 0.01 self.optimization.small_step = 0.00015 self.optimization.smallest_step = self.optimization.small_step / 128 self.force_field = ForceField(self.parameters) self.atom_index = 0
def test_rotation(self): parameters = Parameters() self.generated.set_force_field_parameters(parameters) topology = self.generated.get_topology() phi = [] psi = [] for i in range(len(input_phi_psi)): phi.append(input_phi_psi[i][1]) psi.append(input_phi_psi[i][2]) topology.rotate_backbone('PHI', phi) topology.rotate_backbone('PSI', psi) expected = Molecule(pdb_file_location='tests/data/rotated.pdb') rmsd = self.generated.rmsd(expected) self.assertLess(rmsd, 0.05)
class AmberTestCase(unittest.TestCase): def setUp(self): self.parameters = Parameters() def test_read_amino_acids(self): self.assertEqual(len(self.parameters.amino_acids), 94) def test_read_angle_type(self): self.assertTrue(self.parameters.get_angle_type('CT', 'S', 'S') is not None) def test_bond_atom_type(self): for amino_acid in self.parameters.amino_acids.values(): for bond in amino_acid.bonds: self.assertTrue(bond.atom_01_type is not None) self.assertTrue(bond.atom_02_type is not None) def test_read_molecule(self): molecule = Molecule(pdb_file_location='tests/data/1l2y-01.pdb') self.assertEqual(len(molecule.amino_acids), 20)
def setUp(self): self.parameters = Parameters() self.ligand = Molecule(pdb_file_location='tests/data/ligand.pdb')
def setUp(self): self.parameters = Parameters()