Ejemplo 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;
            }
        }
Ejemplo n.º 2
0
        public void TestCalculateOverlapsAndReduceExactMatch()
        {
            var            sp        = new SmilesParser(builder);
            var            Molecule1 = sp.ParseSmiles("O1C=CC=C1");
            var            Molecule2 = sp.ParseSmiles("O1C=CC=C1");
            CDKRMapHandler instance  = new CDKRMapHandler();

            instance.CalculateOverlapsAndReduceExactMatch(Molecule1, Molecule2, true);
            // TODO review the generated test code and remove the default call to fail.
            Assert.IsNotNull(FinalMappings.Instance.Count);
        }
Ejemplo n.º 3
0
        public void TestGetMappings()
        {
            var            sp        = new SmilesParser(builder);
            var            Molecule1 = sp.ParseSmiles("O1C=CC=C1");
            var            Molecule2 = sp.ParseSmiles("O1C=CC=C1");
            CDKRMapHandler instance  = new CDKRMapHandler();

            instance.CalculateOverlapsAndReduceExactMatch(Molecule1, Molecule2, true);
            var result = instance.Mappings;

            Assert.AreEqual(2, result.Count);
        }