Esempio n. 1
0
        public void TestGetSize()
        {
            var fingerprinter = new LingoFingerprinter();

            Assert.IsNotNull(fingerprinter);
            Assert.AreEqual(-1, fingerprinter.Length);
        }
Esempio n. 2
0
        public override void TestGetCountFingerprint()
        {
            var fpr = new LingoFingerprinter(4);
            var sp  = CDK.SmilesParser;
            var mol = sp.ParseSmiles("Oc1ccccc1");
            ICountFingerprint fp = fpr.GetCountFingerprint(mol);

            Assert.AreEqual(2, fp.GetCountForHash("cccc".GetHashCode()));
            Assert.AreEqual(1, fp.GetCountForHash("Oc0c".GetHashCode()));
            Assert.AreEqual(1, fp.GetCountForHash("c0cc".GetHashCode()));
            Assert.AreEqual(1, fp.GetCountForHash("0ccc".GetHashCode()));
            Assert.AreEqual(1, fp.GetCountForHash("ccc0".GetHashCode()));
        }
Esempio n. 3
0
        public override void TestGetRawFingerprint()
        {
            var lfp = new LingoFingerprinter(3);
            var sp  = CDK.SmilesParser;
            var mol = sp.ParseSmiles("SPONC");
            var map = lfp.GetRawFingerprint(mol);

            Assert.AreEqual(3, map.Count);
            // depend on canonical ordering of the SMILES since lingos uses Unique SMILES
            var subs = new[] { "PON", "ONC", "SPO" };

            foreach (var s in subs)
            {
                Assert.IsTrue(map.ContainsKey(s));
            }
        }