public void TestCountableMACCSCount_Rings() { var parser = CDK.SmilesParser; var printer = new SubstructureFingerprinter(StandardSubstructureSets.GetCountableMACCSSMARTS()); IAtomContainer mol; ICountFingerprint cfp; // Aromatic 6-rings mol = parser.ParseSmiles("C1=CC=CC(=C1)CCCC2=CC=CC=C2"); AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol); Aromaticity.CDKLegacy.Apply(mol); cfp = printer.GetCountFingerprint(mol); Assert.IsTrue(cfp.GetCountForHash(128) == 2); // 6-ring Assert.IsTrue(cfp.GetCountForHash(111) == 2); // aromaticity Assert.IsTrue(cfp.GetCountForHash(7) == 0); // 7-ring Assert.IsTrue(cfp.GetCountForHash(82) == 0); // 5-ring // Non-aromatic 6-rings mol = parser.ParseSmiles("C1CC(CCC1)CCCCC2CCCCC2"); AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol); Aromaticity.CDKLegacy.Apply(mol); cfp = printer.GetCountFingerprint(mol); Assert.IsTrue(cfp.GetCountForHash(128) == 2); // 6-ring Assert.IsTrue(cfp.GetCountForHash(111) == 0); // aromaticity Assert.IsTrue(cfp.GetCountForHash(7) == 0); // 7-ring Assert.IsTrue(cfp.GetCountForHash(82) == 0); // 5-ring // Aromatic 6-ring, 3-ring and 4-ring mol = parser.ParseSmiles("C1CC1C(CCC2CCC2)CC3=CC=CC=C3"); AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol); Aromaticity.CDKLegacy.Apply(mol); cfp = printer.GetCountFingerprint(mol); Assert.IsTrue(cfp.GetCountForHash(128) == 1); // 6-ring Assert.IsTrue(cfp.GetCountForHash(111) == 1); // aromaticity Assert.IsTrue(cfp.GetCountForHash(10) == 1); // 3-ring Assert.IsTrue(cfp.GetCountForHash(1) == 1); // 4-ring Assert.IsTrue(cfp.GetCountForHash(7) == 0); // 7-ring Assert.IsTrue(cfp.GetCountForHash(82) == 0); // 5-ring // Aromatic 6-ring, 3-ring and 4-ring mol = parser.ParseSmiles("C1(CC1C(CCC2CCC2)CC3=CC=CC=C3)C(C(C(C4CC4)C5CC5)C6CC6)C7CC7"); AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol); Aromaticity.CDKLegacy.Apply(mol); cfp = printer.GetCountFingerprint(mol); Assert.IsTrue(cfp.GetCountForHash(128) == 1); // 6-ring Assert.IsTrue(cfp.GetCountForHash(111) == 1); // aromaticity Assert.IsTrue(cfp.GetCountForHash(10) == 5); // 3-ring Assert.IsTrue(cfp.GetCountForHash(1) == 1); // 4-ring Assert.IsTrue(cfp.GetCountForHash(7) == 0); // 7-ring Assert.IsTrue(cfp.GetCountForHash(82) == 0); // 5-ring }
public void TestCountableMACCSCount2() { var parser = CDK.SmilesParser; var printer = new SubstructureFingerprinter(StandardSubstructureSets.GetCountableMACCSSMARTS()); IAtomContainer mol; ICountFingerprint cfp; // Test molecule 1 mol = parser.ParseSmiles("C([S](O)(=O)=O)C1=C(C=CC=C1)CCCC[N+](=O)[O-]"); AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol); Aromaticity.CDKLegacy.Apply(mol); cfp = printer.GetCountFingerprint(mol); Assert.IsTrue(cfp.GetCountForHash(46) == 2); Assert.IsTrue(cfp.GetCountForHash(27) == 1); Assert.IsTrue(cfp.GetCountForHash(59) == 2); Assert.IsTrue(cfp.GetCountForHash(49) == 1); Assert.IsTrue(cfp.GetCountForHash(111) == 1); Assert.IsTrue(cfp.GetCountForHash(129) == 3); Assert.IsTrue(cfp.GetCountForHash(115) == 2); Assert.IsTrue(cfp.GetCountForHash(120) == 3); Assert.IsTrue(cfp.GetCountForHash(41) == 3); Assert.IsTrue(cfp.GetCountForHash(93) == 0); Assert.IsTrue(cfp.GetCountForHash(91) == 0); Assert.IsTrue(cfp.GetCountForHash(24) == 0); // Test molecule 2: Diatrizoic acid mol = parser.ParseSmiles("CC(=O)NC1=C(C(=C(C(=C1I)C(=O)O)I)NC(=O)C)I"); AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol); Aromaticity.CDKLegacy.Apply(mol); cfp = printer.GetCountFingerprint(mol); Assert.IsTrue(cfp.GetCountForHash(15) == 3); Assert.IsTrue(cfp.GetCountForHash(135) == 3); Assert.IsTrue(cfp.GetCountForHash(139) == 4); Assert.IsTrue(cfp.GetCountForHash(93) == 3); Assert.IsTrue(cfp.GetCountForHash(73) == 6); Assert.IsTrue(cfp.GetCountForHash(91) == 0); }