def test_generateConformers(self): sm = SmallMol(self.benzamidine_mol2) current_conformer = sm.numFrames sm.generateConformers(num_confs=10, append=False) n_conformers = sm.numFrames self.assertGreater(n_conformers, current_conformer, 'The generation of conforemr should provide at least the ' 'same amount of conformer')
def test_writeGenerateAndWriteConformers(self): sm = SmallMol(self.benzamidine_mol2) sm.generateConformers(num_confs=10, append=False) tmpfname = os.path.join(NamedTemporaryFile().name, 'benzamidine.sdf') tmpdir = os.path.dirname(tmpfname) sm.write(tmpfname, merge=False) direxists = os.path.isdir(tmpdir) n_files = len(glob(os.path.join(tmpdir, '*.sdf'))) self.assertTrue(direxists, 'The directory where to store the conformations where not created') self.assertGreater(n_files, 1, 'None conformations were written. At least one should be present')
def test_removeGenerateConformer(self): molsmile = SMILE_SMI sm = SmallMol(molsmile) sm.generateConformers(num_confs=10, append=False) n_confs = sm.numFrames sm.dropFrames([0]) n_confs_del = sm.numFrames sm.dropFrames() n_confs_zero = sm.numFrames self.assertEqual(n_confs_del, n_confs - 1, "The number of conformations after the deletion was not reduced of " "exactly one unit") self.assertEqual(n_confs_zero, 0, "The number of conformations after the deletion was not reduced to 0")