Exemplo n.º 1
0
        public void TestVersion()
        {
            Fingerprinter fpr = new Fingerprinter(1024, 7);

            fpr.SetPathLimit(2000);
            fpr.SetHashPseudoAtoms(true);
            string expected = "CDK-Fingerprinter/" + CDK.Version + " searchDepth=7 pathLimit=2000 hashPseudoAtoms=" + true.ToString();

            Assert.AreEqual(expected, fpr.GetVersionDescription());
        }
Exemplo n.º 2
0
        public void PseudoAtomFingerprintArom()
        {
            SmilesParser  smipar    = CDK.SmilesParser;
            string        query     = "*1cnccc1";
            string        indole    = "n1cnccc1";
            var           queryMol  = smipar.ParseSmiles(query);
            var           indoleMol = smipar.ParseSmiles(indole);
            Fingerprinter fpr       = new Fingerprinter();
            BitArray      fp1       = fpr.GetFingerprint(queryMol);
            BitArray      fp2       = fpr.GetFingerprint(indoleMol);

            Assert.IsTrue(FingerprinterTool.IsSubset(fp2, fp1));
            Assert.IsFalse(FingerprinterTool.IsSubset(fp1, fp2));
            fpr.SetHashPseudoAtoms(true);
            BitArray fp3 = fpr.GetFingerprint(queryMol);
            BitArray fp4 = fpr.GetFingerprint(indoleMol);

            Assert.IsFalse(FingerprinterTool.IsSubset(fp4, fp3));
            Assert.IsFalse(FingerprinterTool.IsSubset(fp3, fp4));
        }