Пример #1
0
        public void TestDecode()
        {
            BitArray bitSet = PubchemFingerprinter
                              .Decode("AAADcYBgAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAABAAAAGAAAAAAACACAEAAwAIAAAACAACBCAAACAAAgAAAIiAAAAIgIICKAERCAIAAggAAIiAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==");

            int[] setBits = new int[] { 0, 9, 10, 178, 179, 255, 283, 284, 332, 344, 355, 370, 371, 384, 416, 434, 441, 446,
                                        470, 490, 516, 520, 524, 552, 556, 564, 570, 578, 582, 584, 595, 599, 603, 608, 618, 634, 640, 660,
                                        664, 668, 677, 678, 679 };
            foreach (var set in setBits)
            {
                Assert.IsTrue(bitSet[set], "bit " + set + " was not set");
            }
        }
Пример #2
0
        public void TestBenzene()
        {
            var mol = parser.ParseSmiles("c1ccccc1");

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol);
            var adder = CDK.HydrogenAdder;

            adder.AddImplicitHydrogens(mol);
            AtomContainerManipulator.ConvertImplicitToExplicitHydrogens(mol);

            Aromaticity.CDKLegacy.Apply(mol);
            IFingerprinter printer = new PubchemFingerprinter();
            BitArray       fp      = printer.GetBitFingerprint(mol).AsBitSet();
            BitArray       ref_    = PubchemFingerprinter
                                     .Decode("AAADcYBgAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAABAAAAGAAAAAAACACAEAAwAIAAAACAACBCAAACAAAgAAAIiAAAAIgIICKAERCAIAAggAAIiAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==");

            Assert.IsTrue(BitArrays.Equals(ref_, fp));
        }
Пример #3
0
        public void TestCID25181289()
        {
            var mol = parser.ParseSmiles("C=C(C1=CC=C(C=C1)O)NNC2=C(C(=NC(=C2Cl)Cl)C(=O)O)Cl");

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol);
            var adder = CDK.HydrogenAdder;

            adder.AddImplicitHydrogens(mol);
            AtomContainerManipulator.ConvertImplicitToExplicitHydrogens(mol);
            Aromaticity.CDKLegacy.Apply(mol);

            IFingerprinter printer = new PubchemFingerprinter();
            BitArray       fp      = printer.GetBitFingerprint(mol).AsBitSet();
            BitArray       ref_    = PubchemFingerprinter
                                     .Decode("AAADccBzMAAGAAAAAAAAAAAAAAAAAAAAAAA8QAAAAAAAAAABwAAAHgIYCAAADA6BniAwzpJqEgCoAyTyTASChCAnJiIYumGmTtgKJnLD1/PEdQhkwBHY3Qe82AAOIAAAAAAAAABAAAAAAAAAAAAAAAAAAA==");

            Assert.IsTrue(BitArrays.Equals(ref_, fp));
        }
Пример #4
0
        public void TestCID5934166()
        {
            var mol = parser.ParseSmiles("C1=CC=C(C=C1)C[N+]2=C(C=C(C=C2C=CC3=CC=CC=C3)C4=CC=CC=C4)C5=CC=CC=C5");

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol);
            var adder = CDK.HydrogenAdder;

            adder.AddImplicitHydrogens(mol);
            AtomContainerManipulator.ConvertImplicitToExplicitHydrogens(mol);
            Aromaticity.CDKLegacy.Apply(mol);

            IFingerprinter printer = new PubchemFingerprinter();
            BitArray       fp      = printer.GetBitFingerprint(mol).AsBitSet();
            BitArray       ref_    = PubchemFingerprinter
                                     .Decode("AAADceB+AAAAAAAAAAAAAAAAAAAAAAAAAAA8YMGCAAAAAAAB1AAAHAAAAAAADAjBHgQwgJMMEACgAyRiRACCgCAhAiAI2CA4ZJgIIOLAkZGEIAhggADIyAcQgMAOgAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==");

            Assert.IsTrue(BitArrays.Equals(ref_, fp));
        }
Пример #5
0
        public void TestCID2518130()
        {
            var mol = parser.ParseSmiles("COC1C(C(C(C(O1)CO)OC2C(C(C(C(O2)CO)S)O)O)O)O");

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol);
            var adder = CDK.HydrogenAdder;

            adder.AddImplicitHydrogens(mol);
            AtomContainerManipulator.ConvertImplicitToExplicitHydrogens(mol);
            Aromaticity.CDKLegacy.Apply(mol);

            IFingerprinter printer = new PubchemFingerprinter();
            BitArray       fp      = printer.GetBitFingerprint(mol).AsBitSet();
            BitArray       ref_    = PubchemFingerprinter
                                     .Decode("AAADceBwPABAAAAAAAAAAAAAAAAAAAAAAAAkSAAAAAAAAAAAAAAAGgQACAAACBS0wAOCCAAABgQAAAAAAAAAAAAAAAAAAAAAAAAREAIAAAAiQAAFAAAHAAHAYAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==");

            Assert.IsTrue(BitArrays.Equals(ref_, fp));
        }
Пример #6
0
 public void TestDecode_invalid()
 {
     PubchemFingerprinter.Decode("a");
 }