def testSSSR(self): """ Test the Molecule.getSmallestSetOfSmallestRings() method with a complex polycyclic molecule. """ molecule = Molecule() molecule.fromSMILES('C(CC1C(C(CCCCCCCC)C1c1ccccc1)c1ccccc1)CCCCCC') #http://cactus.nci.nih.gov/chemical/structure/C(CC1C(C(CCCCCCCC)C1c1ccccc1)c1ccccc1)CCCCCC/image sssr = molecule.getSmallestSetOfSmallestRings() self.assertEqual( len(sssr), 3)
def testSSSR(self): """ Test the Molecule.getSmallestSetOfSmallestRings() method with a complex polycyclic molecule. """ molecule = Molecule() molecule.fromSMILES('C(CC1C(C(CCCCCCCC)C1c1ccccc1)c1ccccc1)CCCCCC') #http://cactus.nci.nih.gov/chemical/structure/C(CC1C(C(CCCCCCCC)C1c1ccccc1)c1ccccc1)CCCCCC/image sssr = molecule.getSmallestSetOfSmallestRings() self.assertEqual(len(sssr), 3)
def testCombineTwoRingsIntoSubMolecule(self): # create testing molecule smiles1 = 'C1CCC2CCCCC2C1' mol1 = Molecule().fromSMILES(smiles1) # get two SSSRs SSSR = mol1.getSmallestSetOfSmallestRings() ring1 = SSSR[0] ring2 = SSSR[1] # combine two rings into submolecule submol, _ = combineTwoRingsIntoSubMolecule(ring1, ring2) self.assertEqual(len(submol.atoms), 10) bonds = [] for atom in submol.atoms: for bondAtom, bond in atom.edges.iteritems(): if bond not in bonds: bonds.append(bond) self.assertEqual(len(bonds), 11)