Exemplo n.º 1
0
        private void SearchVFMappings()
        {
            //        Console.Out.WriteLine("searchVFMappings ");
            IQuery  query  = null;
            IMapper mapper = null;

            vfLibSolutions = new Dictionary <INode, IAtom>();
            if (queryMol != null)
            {
                query  = new QueryCompiler(queryMol).Compile();
                mapper = new VFMapper(query);
                if (mapper.HasMap(GetProductMol()))
                {
                    var map = mapper.GetFirstMap(GetProductMol());
                    if (map != null)
                    {
                        foreach (var e in map)
                        {
                            vfLibSolutions[e.Key] = e.Value;
                        }
                    }
                }
                SetVFMappings(true, query);
            }
            else if (GetReactantMol().Atoms.Count <= GetProductMol().Atoms.Count)
            {
                query  = new QueryCompiler(mol1, IsBondMatchFlag).Compile();
                mapper = new VFMapper(query);
                if (mapper.HasMap(GetProductMol()))
                {
                    var map = mapper.GetFirstMap(GetProductMol());
                    if (map != null)
                    {
                        foreach (var e in map)
                        {
                            vfLibSolutions[e.Key] = e.Value;
                        }
                    }
                }
                SetVFMappings(true, query);
            }
            else
            {
                query  = new QueryCompiler(GetProductMol(), IsBondMatchFlag).Compile();
                mapper = new VFMapper(query);
                if (mapper.HasMap(GetReactantMol()))
                {
                    var map = mapper.GetFirstMap(GetReactantMol());
                    if (map != null)
                    {
                        foreach (var e in map)
                        {
                            vfLibSolutions[e.Key] = e.Value;
                        }
                    }
                }
                SetVFMappings(false, query);
            }
        }
Exemplo n.º 2
0
        public void TestItShouldNotMatchBenzeneToPyridine()
        {
            IMapper mapper = new VFMapper(benzene, true);

            Assert.IsFalse(mapper.HasMap(pyridine));

            mapper = new VFMapper(pyridine, true);

            Assert.IsFalse(mapper.HasMap(benzene));
        }
Exemplo n.º 3
0
        private void SearchVFMappings()
        {
            IQuery  query  = null;
            IMapper mapper = null;

            vfLibSolutions = new List <IReadOnlyDictionary <INode, IAtom> >();
            if (queryMol != null)
            {
                query  = new QueryCompiler(queryMol).Compile();
                mapper = new VFMapper(query);
                if (mapper.HasMap(GetProductMol()))
                {
                    var maps = mapper.GetMaps(GetProductMol());
                    if (maps != null)
                    {
                        vfLibSolutions.AddRange(maps);
                    }
                }
                SetVFMappings(true, query);
            }
            else if (GetReactantMol().Atoms.Count <= GetProductMol().Atoms.Count)
            {
                query  = new QueryCompiler(mol1, IsBondMatchFlag).Compile();
                mapper = new VFMapper(query);
                if (mapper.HasMap(GetProductMol()))
                {
                    var maps = mapper.GetMaps(GetProductMol());
                    if (maps != null)
                    {
                        vfLibSolutions.AddRange(maps);
                    }
                }
                SetVFMappings(true, query);
            }
            else
            {
                query  = new QueryCompiler(GetProductMol(), IsBondMatchFlag).Compile();
                mapper = new VFMapper(query);
                if (mapper.HasMap(GetReactantMol()))
                {
                    var maps = mapper.GetMaps(GetReactantMol());
                    if (maps != null)
                    {
                        vfLibSolutions.AddRange(maps);
                    }
                }
                SetVFMappings(false, query);
            }
        }
Exemplo n.º 4
0
        public void TestItShouldMatchHexaneToHexaneWhenUsingMolecule()
        {
            IMapper mapper = new VFMapper(hexane, true);

            Assert.IsTrue(mapper.HasMap(hexane));
        }
Exemplo n.º 5
0
        public void TestItShouldNotMatchTolueneToPhenol()
        {
            IMapper mapper = new VFMapper(toluene, true);

            Assert.IsFalse(mapper.HasMap(phenol));
        }
Exemplo n.º 6
0
        public void TestItShouldMatchPropaneToCyclopropane()
        {
            IMapper mapper = new VFMapper(propane, true);

            Assert.IsTrue(mapper.HasMap(cyclopropane));
        }
Exemplo n.º 7
0
        public void TestItShouldMatchAcetoneToAcetone()
        {
            IMapper mapper = new VFMapper(acetone, true);

            Assert.IsTrue(mapper.HasMap(acetone));
        }
Exemplo n.º 8
0
        public void TestItShouldNotMatchTolueneToBenzene()
        {
            IMapper mapper = new VFMapper(toluene, true);

            Assert.IsFalse(mapper.HasMap(benzene));
        }
Exemplo n.º 9
0
        public void TestItShouldNotMatchChlorobenzeneTo4ChloroIsoquinoline()
        {
            IMapper mapper = new VFMapper(chlorobenzene, true);

            Assert.IsFalse(mapper.HasMap(chloroisoquinoline4));
        }
Exemplo n.º 10
0
        public void TestItShouldNotMatchPyridazineToNaphthalene()
        {
            IMapper mapper = new VFMapper(pyridazine, true);

            Assert.IsFalse(mapper.HasMap(naphthalene));
        }
Exemplo n.º 11
0
        public void TestItShouldMatchBenzeneToBenzene()
        {
            IMapper mapper = new VFMapper(benzene, true);

            Assert.IsTrue(mapper.HasMap(benzene));
        }