Esempio n. 1
0
        public override void SearchMCS(bool shouldMatchBonds)
        {
            CDKRMapHandler rmap = new CDKRMapHandler();

            try
            {
                if ((source.Atoms.Count == target.Atoms.Count) && source.Bonds.Count == target.Bonds.Count)
                {
                    rOnPFlag = true;
                    rmap.CalculateOverlapsAndReduceExactMatch(source, target, shouldMatchBonds);
                }
                else if (source.Atoms.Count > target.Atoms.Count && source.Bonds.Count != target.Bonds.Count)
                {
                    rOnPFlag = true;
                    rmap.CalculateOverlapsAndReduce(source, target, shouldMatchBonds);
                }
                else
                {
                    rOnPFlag = false;
                    rmap.CalculateOverlapsAndReduce(target, source, shouldMatchBonds);
                }

                SetAllMapping();
                SetAllAtomMapping();
                SetFirstMapping();
                SetFirstAtomMapping();
            }
            catch (CDKException)
            {
                rmap = null;
            }
        }
Esempio n. 2
0
        public void TestCalculateOverlapsAndReduce()
        {
            var            sp        = new SmilesParser(builder);
            var            Molecule1 = sp.ParseSmiles("O1C=CC=C1");
            var            Molecule2 = sp.ParseSmiles("C1CCCC1");
            CDKRMapHandler instance  = new CDKRMapHandler();

            instance.CalculateOverlapsAndReduce(Molecule1, Molecule2, true);
            Assert.IsNotNull(FinalMappings.Instance.Count);
        }