def test_11_invertChirality(self): molsmile = CHIRAL_SMI sm = SmallMol(molsmile) aname = CHIRAL_DETAILS[0][0] chiral = CHIRAL_DETAILS[0][1] aidx = sm.get('idx', 'atomname {}'.format(aname))[0] sm.invertChirality(aidx) newchiral = sm.isChiral(returnDetails=True)[1][0][-1] self.assertNotEqual(chiral, newchiral, msg="The chirality was not formally changed") sm.generateConformers(num_confs=1, append=False) m = sm.toMolecule() fname = NamedTemporaryFile().name + '.mol2' m.write(fname) sm2 = SmallMol(fname) newchiral_confirm = sm2.isChiral(returnDetails=True)[1][0][-1] self.assertEqual(newchiral, newchiral_confirm, msg="The chirality was not structurally changed")
def test_06_isChiral(self): smi = CHIRAL_SMI sm = SmallMol(smi) ischiral, details = sm.isChiral(returnDetails=True) self.assertListEqual( details, CHIRAL_DETAILS, 'chiral atom does not match.' 'Expected: {}; Now: {}'.format(CHIRAL_DETAILS, details))
def test_11_invertChirality(self): molsmile = CHIRAL_SMI sm = SmallMol(molsmile) aname = CHIRAL_DETAILS[0][0] chiral = CHIRAL_DETAILS[0][1] aidx = sm.get('idx', 'atomname {}'.format(aname))[0] sm.invertChirality(aidx) newchiral = sm.isChiral(returnDetails=True)[1][0][-1] self.assertNotEqual(chiral, newchiral, msg="The chirality was not formally changed") sm.generateConformers(num_confs=1, append=False) m = sm.toMolecule() fname = NamedTemporaryFile().name + '.mol2' m.write(fname) sm2 = SmallMol(fname) newchiral_confirm = sm2.isChiral(returnDetails=True)[1][0][-1] self.assertEqual(newchiral, newchiral_confirm, msg="The chirality was not structurally changed")
def test_06_isChiral(self): smi = CHIRAL_SMI sm = SmallMol(smi) ischiral, details = sm.isChiral(returnDetails=True) self.assertListEqual(details, CHIRAL_DETAILS, 'chiral atom does not match.' 'Expected: {}; Now: {}'.format(CHIRAL_DETAILS, details))