public void Testfp2() { var parser = CDK.SmilesParser; IFingerprinter printer = new MACCSFingerprinter(); var mol1 = parser.ParseSmiles("CC(N)CCCN"); var mol2 = parser.ParseSmiles("CC(N)CCC"); var mol3 = parser.ParseSmiles("CCCC"); AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol1); AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol2); AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol3); Aromaticity.CDKLegacy.Apply(mol1); Aromaticity.CDKLegacy.Apply(mol2); Aromaticity.CDKLegacy.Apply(mol3); BitArray bs1 = printer.GetBitFingerprint(mol1).AsBitSet(); BitArray bs2 = printer.GetBitFingerprint(mol2).AsBitSet(); BitArray bs3 = printer.GetBitFingerprint(mol3).AsBitSet(); Assert.IsFalse(bs1[124]); Assert.IsFalse(bs2[124]); Assert.IsFalse(bs3[124]); Assert.IsFalse(FingerprinterTool.IsSubset(bs1, bs2)); Assert.IsTrue(FingerprinterTool.IsSubset(bs2, bs3)); }
public override void TestBug706786() { IAtomContainer superStructure = Bug706786_1(); IAtomContainer subStructure = Bug706786_2(); AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(superStructure); AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(subStructure); AddImplicitHydrogens(superStructure); AddImplicitHydrogens(subStructure); IFingerprinter fpr = new MACCSFingerprinter(); IBitFingerprint superBits = fpr.GetBitFingerprint(superStructure); IBitFingerprint subBits = fpr.GetBitFingerprint(subStructure); Assert.IsTrue(BitArrays.Equals( AsBitSet(53, 56, 65, 71, 73, 88, 97, 104, 111, 112, 126, 130, 136, 138, 139, 140, 142, 143, 144, 145, 148, 149, 151, 153, 156, 158, 159, 161, 162, 163, 164), superBits.AsBitSet())); Assert.IsTrue(BitArrays.Equals( AsBitSet(56, 97, 104, 108, 112, 117, 131, 136, 143, 144, 146, 151, 152, 156, 161, 162, 163, 164), subBits.AsBitSet())); }