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); } }
public void TestItShouldNotMatchBenzeneToPyridine() { IMapper mapper = new VFMapper(benzene, true); Assert.IsFalse(mapper.HasMap(pyridine)); mapper = new VFMapper(pyridine, true); Assert.IsFalse(mapper.HasMap(benzene)); }
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); } }
public void TestItShouldMatchHexaneToHexaneWhenUsingMolecule() { IMapper mapper = new VFMapper(hexane, true); Assert.IsTrue(mapper.HasMap(hexane)); }
public void TestItShouldNotMatchTolueneToPhenol() { IMapper mapper = new VFMapper(toluene, true); Assert.IsFalse(mapper.HasMap(phenol)); }
public void TestItShouldMatchPropaneToCyclopropane() { IMapper mapper = new VFMapper(propane, true); Assert.IsTrue(mapper.HasMap(cyclopropane)); }
public void TestItShouldMatchAcetoneToAcetone() { IMapper mapper = new VFMapper(acetone, true); Assert.IsTrue(mapper.HasMap(acetone)); }
public void TestItShouldNotMatchTolueneToBenzene() { IMapper mapper = new VFMapper(toluene, true); Assert.IsFalse(mapper.HasMap(benzene)); }
public void TestItShouldNotMatchChlorobenzeneTo4ChloroIsoquinoline() { IMapper mapper = new VFMapper(chlorobenzene, true); Assert.IsFalse(mapper.HasMap(chloroisoquinoline4)); }
public void TestItShouldNotMatchPyridazineToNaphthalene() { IMapper mapper = new VFMapper(pyridazine, true); Assert.IsFalse(mapper.HasMap(naphthalene)); }
public void TestItShouldMatchBenzeneToBenzene() { IMapper mapper = new VFMapper(benzene, true); Assert.IsTrue(mapper.HasMap(benzene)); }