Ejemplo n.º 1
0
        /// <summary>
        /// Create a pattern which can be used to find molecules which contain the
        /// <paramref name="query"/> structure.
        /// </summary>
        /// <param name="query">the substructure to find</param>
        /// <returns>a pattern for finding the <paramref name="query"/></returns>
        public static new Pattern CreateSubstructureFinder(IAtomContainer query)
        {
            bool isQuery = query is IQueryAtomContainer;

            return(new Ullmann(query, isQuery ? AtomMatcher.CreateQueryMatcher() : AtomMatcher.CreateElementMatcher(),
                               isQuery ? BondMatcher.CreateQueryMatcher() : BondMatcher.CreateOrderMatcher()));
        }
Ejemplo n.º 2
0
        public void HasNext()
        {
            var state = CreateNaphthaleneToBenzene(AtomMatcher.CreateAnyMatcher(), BondMatcher.CreateAnyMatcher());
            var it    = new StateStream(state);

            Assert.IsFalse(it.Any());
        }
Ejemplo n.º 3
0
        public void Next()
        {
            var state = CreateBenzeneToNaphthalene(AtomMatcher.CreateAnyMatcher(), BondMatcher.CreateAnyMatcher());
            var it    = new StateStream(state).GetEnumerator();

            it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 0, 1, 2, 7, 8, 9 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 0, 9, 8, 7, 2, 1 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 1, 0, 9, 8, 7, 2 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 1, 2, 7, 8, 9, 0 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 2, 1, 0, 9, 8, 7 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 2, 3, 4, 5, 6, 7 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 2, 7, 6, 5, 4, 3 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 2, 7, 8, 9, 0, 1 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 3, 2, 7, 6, 5, 4 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 3, 4, 5, 6, 7, 2 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 4, 3, 2, 7, 6, 5 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 4, 5, 6, 7, 2, 3 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 5, 4, 3, 2, 7, 6 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 5, 6, 7, 2, 3, 4 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 6, 5, 4, 3, 2, 7 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 6, 7, 2, 3, 4, 5 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 7, 2, 1, 0, 9, 8 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 7, 2, 3, 4, 5, 6 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 7, 6, 5, 4, 3, 2 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 7, 8, 9, 0, 1, 2 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 8, 7, 2, 1, 0, 9 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 8, 9, 0, 1, 2, 7 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 9, 0, 1, 2, 7, 8 }, it.Current)); it.MoveNext();
            Assert.IsTrue(Compares.AreDeepEqual(new int[] { 9, 8, 7, 2, 1, 0 }, it.Current)); it.MoveNext();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Create a state for matching subgraphs using the Ullmann refinement
        /// procedure.
        /// </summary>
        /// <param name="container1">query container</param>
        /// <param name="container2">target container</param>
        /// <param name="g1">query container adjacency list</param>
        /// <param name="g2">target container adjacency list</param>
        /// <param name="bonds1">query container bond map</param>
        /// <param name="bonds2">target container bond map</param>
        /// <param name="atomMatcher">method of matching atom semantics</param>
        /// <param name="bondMatcher">method of matching bond semantics</param>
        public UllmannState(IAtomContainer container1, IAtomContainer container2, int[][] g1, int[][] g2,
                            EdgeToBondMap bonds1, EdgeToBondMap bonds2, AtomMatcher atomMatcher, BondMatcher bondMatcher)
        {
            this.bondMatcher = bondMatcher;
            this.g1          = g1;
            this.g2          = g2;
            this.bond1       = bonds1;
            this.bonds2      = bonds2;
            this.m1          = new int[g1.Length];
            this.m2          = new int[g2.Length];
            Arrays.Fill(m1, UNMAPPED);
            Arrays.Fill(m2, UNMAPPED);

            // build up compatibility matrix
            matrix = new CompatibilityMatrix(g1.Length, g2.Length);
            for (int i = 0; i < g1.Length; i++)
            {
                for (int j = 0; j < g2.Length; j++)
                {
                    if (g1[i].Length <= g2[j].Length && atomMatcher.Matches(container1.Atoms[i], container2.Atoms[j]))
                    {
                        matrix.Set1(i, j);
                    }
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Create a pattern which can be used to find molecules which are the same
        /// as the <paramref name="query"/> structure.
        /// </summary>
        /// <param name="query">the substructure to find</param>
        /// <returns>a pattern for finding the <paramref name="query"/></returns>
        public static new Pattern CreateIdenticalFinder(IAtomContainer query)
        {
            bool isQuery = query is IQueryAtomContainer;

            return(CreateIdenticalFinder(query,
                                         isQuery ? AtomMatcher.CreateQueryMatcher() : AtomMatcher.CreateElementMatcher(),
                                         isQuery ? BondMatcher.CreateQueryMatcher() : BondMatcher.CreateOrderMatcher()));
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Non-public constructor for-now the atom/bond semantics are fixed.
 /// </summary>
 /// <param name="query">the query structure</param>
 /// <param name="atomMatcher">how atoms should be matched</param>
 /// <param name="bondMatcher">how bonds should be matched</param>
 private Ullmann(IAtomContainer query, AtomMatcher atomMatcher, BondMatcher bondMatcher)
 {
     this.query       = query;
     this.atomMatcher = atomMatcher;
     this.bondMatcher = bondMatcher;
     this.bonds1      = EdgeToBondMap.WithSpaceFor(query);
     this.g1          = GraphUtil.ToAdjList(query, bonds1);
     DetermineFilters(query);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Non-public constructor for-now the atom/bond semantics are fixed.
 /// </summary>
 /// <param name="query">the query structure</param>
 /// <param name="atomMatcher">how atoms should be matched</param>
 /// <param name="bondMatcher">how bonds should be matched</param>
 /// <param name="substructure">substructure search</param>
 private VentoFoggia(IAtomContainer query, AtomMatcher atomMatcher, BondMatcher bondMatcher, bool substructure)
 {
     this.query       = query;
     this.atomMatcher = atomMatcher;
     this.bondMatcher = bondMatcher;
     this.bonds1      = EdgeToBondMap.WithSpaceFor(query);
     this.g1          = GraphUtil.ToAdjList(query, bonds1);
     this.subgraph    = substructure;
     DetermineFilters(query);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Create a VF state for matching isomorphisms. The query is passed first
 /// and should read as, find container1 in container2.
 /// </summary>
 /// <param name="container1">the molecule to search for (query)</param>
 /// <param name="container2">the molecule to search in (target)</param>
 /// <param name="g1">adjacency list of the query</param>
 /// <param name="g2">adjacency list of the target</param>
 /// <param name="bonds1">bond lookup of the query</param>
 /// <param name="bonds2">bond lookup of the target</param>
 /// <param name="atomMatcher">what semantic attributes (symbol, charge, query) determines atoms to be compatible</param>
 /// <param name="bondMatcher">what semantic attributes (order/aromatic, query) determines bonds to be compatible</param>
 public VFState(IAtomContainer container1, IAtomContainer container2, int[][] g1, int[][] g2, EdgeToBondMap bonds1,
                EdgeToBondMap bonds2, AtomMatcher atomMatcher, BondMatcher bondMatcher)
     : base(g1, g2)
 {
     this.container1  = container1;
     this.container2  = container2;
     this.bonds1      = bonds1;
     this.bonds2      = bonds2;
     this.atomMatcher = atomMatcher;
     this.bondMatcher = bondMatcher;
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Create a state for matching benzene to naphthalene Benzene:
        /// InChI=1/C6H6/c1-2-4-6-5-3-1/h1-6H Naphthalene: InChI=1/C10H8/c1-2-6-10-8-4-3-7-9(10)5-1/h1-8H
        /// </summary>
        UllmannState CreateBenzeneToNaphthalene(AtomMatcher atomMatcher, BondMatcher bondMatcher)
        {
            IAtomContainer container1 = TestMoleculeFactory.MakeBenzene();
            IAtomContainer container2 = TestMoleculeFactory.MakeNaphthalene();
            EdgeToBondMap  bonds1     = EdgeToBondMap.WithSpaceFor(container1);
            EdgeToBondMap  bonds2     = EdgeToBondMap.WithSpaceFor(container2);

            int[][] g1 = GraphUtil.ToAdjList(container1, bonds1);
            int[][] g2 = GraphUtil.ToAdjList(container2, bonds2);
            return(new UllmannState(container1, container2, g1, g2, bonds1, bonds2, atomMatcher, bondMatcher));
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Create a match for the following parameters.
 /// </summary>
 /// <param name="container1">query structure</param>
 /// <param name="container2">target structure</param>
 /// <param name="g1">query adjacency list</param>
 /// <param name="g2">target adjacency list</param>
 /// <param name="bonds1">query bond map</param>
 /// <param name="bonds2">target bond map</param>
 /// <param name="atomMatcher">how atoms are matched</param>
 /// <param name="bondMatcher">how bonds are matched</param>
 public UllmannIterable(IAtomContainer container1, IAtomContainer container2, int[][] g1, int[][] g2,
                        EdgeToBondMap bonds1, EdgeToBondMap bonds2, AtomMatcher atomMatcher, BondMatcher bondMatcher)
 {
     this.container1  = container1;
     this.container2  = container2;
     this.g1          = g1;
     this.g2          = g2;
     this.bonds1      = bonds1;
     this.bonds2      = bonds2;
     this.atomMatcher = atomMatcher;
     this.bondMatcher = bondMatcher;
 }
Ejemplo n.º 11
0
        public void QueryMatch()
        {
            BondMatcher matcher = BondMatcher.CreateQueryMatcher();
            var         m_bond1 = new Mock <IQueryBond>(); IQueryBond bond1 = m_bond1.Object;
            var         m_bond2 = new Mock <IBond>(); IBond bond2 = m_bond2.Object;
            var         m_bond3 = new Mock <IBond>(); IBond bond3 = m_bond3.Object;

            m_bond1.Setup(n => n.Matches(bond2)).Returns(true);
            m_bond1.Setup(n => n.Matches(bond3)).Returns(false);
            Assert.IsTrue(matcher.Matches(bond1, bond2));
            Assert.IsFalse(matcher.Matches(bond1, bond3));
        }
Ejemplo n.º 12
0
        public void AliphaticStrictMatch()
        {
            BondMatcher matcher = BondMatcher.CreateStrictOrderMatcher();
            var         m_bond1 = new Mock <IBond>(); IBond bond1 = m_bond1.Object;
            var         m_bond2 = new Mock <IBond>(); IBond bond2 = m_bond2.Object;

            m_bond1.SetupGet(n => n.IsAromatic).Returns(false);
            m_bond2.SetupGet(n => n.IsAromatic).Returns(false);
            m_bond1.SetupGet(n => n.Order).Returns(BondOrder.Single);
            m_bond2.SetupGet(n => n.Order).Returns(BondOrder.Single);
            Assert.IsTrue(matcher.Matches(bond1, bond2));
            Assert.IsTrue(matcher.Matches(bond2, bond1));
        }
Ejemplo n.º 13
0
        public void AnyMatch()
        {
            BondMatcher matcher = BondMatcher.CreateAnyMatcher();
            IBond       bond1   = new Mock <IBond>().Object;
            IBond       bond2   = new Mock <IBond>().Object;
            IBond       bond3   = new Mock <IBond>().Object;

            Assert.IsTrue(matcher.Matches(bond1, bond2));
            Assert.IsTrue(matcher.Matches(bond2, bond1));
            Assert.IsTrue(matcher.Matches(bond1, bond3));
            Assert.IsTrue(matcher.Matches(bond1, null));
            Assert.IsTrue(matcher.Matches(null, null));
        }
Ejemplo n.º 14
0
        public void HasNext2()
        {
            var state = CreateBenzeneToNaphthalene(AtomMatcher.CreateAnyMatcher(), BondMatcher.CreateAnyMatcher());
            int cnt   = 0;
            var it    = new StateStream(state);

            foreach (var i in it)
            {
                Assert.IsNotNull(i);
                cnt++;
            }
            Assert.AreEqual(24, cnt);
        }
Ejemplo n.º 15
0
 /// <summary>
 /// Create a match for the following parameters.
 /// </summary>
 /// <param name="container1">query structure</param>
 /// <param name="container2">target structure</param>
 /// <param name="g1">query adjacency list</param>
 /// <param name="g2">target adjacency list</param>
 /// <param name="bonds1">query bond map</param>
 /// <param name="bonds2">target bond map</param>
 /// <param name="atomMatcher">how atoms are matched</param>
 /// <param name="bondMatcher">how bonds are matched</param>
 /// <param name="subgraph">perform subgraph search</param>
 public VFIterable(IAtomContainer container1, IAtomContainer container2, int[][] g1, int[][] g2,
                   EdgeToBondMap bonds1, EdgeToBondMap bonds2, AtomMatcher atomMatcher, BondMatcher bondMatcher,
                   bool subgraph)
 {
     this.container1  = container1;
     this.container2  = container2;
     this.g1          = g1;
     this.g2          = g2;
     this.bonds1      = bonds1;
     this.bonds2      = bonds2;
     this.atomMatcher = atomMatcher;
     this.bondMatcher = bondMatcher;
     this.subgraph    = subgraph;
 }
Ejemplo n.º 16
0
        public void InfeasibleBonds()
        {
            var m = new Mock <BondMatcher>(); BondMatcher mock = m.Object;

            m.Setup(n => n.Matches(It.IsAny <IBond>(), It.IsAny <IBond>())).Returns(false);
            VFSubState state = CreateBenzeneToNaphthalene(AtomMatcher.CreateAnyMatcher(), mock);

            state.m1[0] = 0;
            state.m1[1] = 1;
            state.m1[2] = 2;
            state.m1[3] = 3;
            state.m1[4] = 4;
            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    Assert.IsFalse(state.Feasible(i, j));
                }
            }
        }
Ejemplo n.º 17
0
        public void TestNextM()
        {
            UllmannState state = CreateBenzeneToNaphthalene(AtomMatcher.CreateAnyMatcher(), BondMatcher.CreateAnyMatcher());

            Assert.AreEqual(state.NextM(0, -1), 0);
            Assert.AreEqual(state.NextM(0, 0), 1);
            Assert.AreEqual(state.NextM(0, 1), 2);
            state.m2[1] = 0; // 1 has been mapped and should be skipped over
            Assert.AreEqual(state.NextM(0, 0), 2);
        }
Ejemplo n.º 18
0
        public void Add()
        {
            UllmannState state = CreateBenzeneToNaphthalene(AtomMatcher.CreateAnyMatcher(), BondMatcher.CreateAnyMatcher());

            Assert.IsTrue(Compares.AreDeepEqual(
                              new int[][] {
                new[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
                new[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
                new[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
                new[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
                new[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
                new[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
            },
                              state.matrix.Fix()
                              ));
            Assert.IsTrue(state.Add(0, 0));
            Assert.IsTrue(Compares.AreDeepEqual(
                              new int[][] {
                new[] { 1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
                new[] { -1, 1, -1, -1, -1, -1, -1, -1, -1, 1 },
                new[] { 1, -1, 1, -1, -1, -1, -1, -1, 1, -1 },
                new[] { -1, 1, -1, 1, -1, -1, -1, 1, -1, 1 },
                new[] { 1, -1, 1, -1, -1, -1, -1, -1, 1, -1 },
                new[] { -1, 1, -1, -1, -1, -1, -1, -1, -1, 1 }
            },
                              state.matrix.Fix()));
            Assert.IsTrue(state.Add(1, 9));
            Assert.IsTrue(Compares.AreDeepEqual(
                              new int[][] {
                new[] { 1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
                new[] { -1, -2, -1, -1, -1, -1, -1, -1, -1, 1 },
                new[] { 1, -1, -2, -1, -1, -1, -1, -1, 1, -1 },
                new[] { -1, 1, -1, -2, -1, -1, -1, 1, -1, 1 },
                new[] { 1, -1, 1, -1, -1, -1, -1, -1, 1, -1 },
                new[] { -1, 1, -1, -1, -1, -1, -1, -1, -1, 1 }
            },
                              state.matrix.Fix()));
            Assert.IsTrue(state.Add(2, 8));
            Assert.IsTrue(Compares.AreDeepEqual(
                              new int[][] {
                new[] { 1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
                new[] { -1, -2, -1, -1, -1, -1, -1, -1, -1, 1 },
                new[] { -3, -1, -2, -1, -1, -1, -1, -1, 1, -1 },
                new[] { -1, -3, -1, -2, -1, -1, -1, 1, -1, 1 },
                new[] { 1, -1, 1, -1, -1, -1, -1, -1, 1, -1 },
                new[] { -1, 1, -1, -1, -1, -1, -1, -1, -1, 1 }
            },
                              state.matrix.Fix()));
            Assert.IsTrue(state.Add(3, 7));
            Assert.IsTrue(Compares.AreDeepEqual(
                              new int[][] {
                new[] { 1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
                new[] { -1, -2, -1, -1, -1, -1, -1, -1, -1, 1 },
                new[] { -3, -1, -2, -1, -1, -1, -1, -1, 1, -1 },
                new[] { -1, -3, -1, -2, -1, -1, -1, 1, -1, -4 },
                new[] { -4, -1, 1, -1, -1, -1, -1, -1, 1, -1 },
                new[] { -1, 1, -1, -1, -1, -1, -1, -1, -1, 1 }
            },
                              state.matrix.Fix()));
            Assert.IsTrue(state.Add(4, 2));
            Assert.IsTrue(Compares.AreDeepEqual(
                              new int[][] {
                new[]  { 1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
                new[] { -1, -2, -1, -1, -1, -1, -1, -1, -1, 1 },
                new[] { -3, -1, -2, -1, -1, -1, -1, -1, 1, -1 },
                new[] { -1, -3, -1, -2, -1, -1, -1, 1, -1, -4 },
                new[] { -4, -1, 1, -1, -1, -1, -1, -1, -5, -1 },
                new[] { -1, 1, -1, -1, -1, -1, -1, -1, -1, -5 }
            },
                              state.matrix.Fix()));
            Assert.IsTrue(state.Add(5, 1));
            Assert.IsTrue(Compares.AreDeepEqual(
                              new int[][] {
                new[] { 1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
                new[] { -1, -2, -1, -1, -1, -1, -1, -1, -1, 1 },
                new[] { -3, -1, -2, -1, -1, -1, -1, -1, 1, -1 },
                new[] { -1, -3, -1, -2, -1, -1, -1, 1, -1, -4 },
                new[] { -4, -1, 1, -1, -1, -1, -1, -1, -5, -1 },
                new[] { -1, 1, -1, -1, -1, -1, -1, -1, -1, -5 }
            },
                              state.matrix.Fix()));
        }
Ejemplo n.º 19
0
        public void InfeasibleTerminalCount()
        {
            VFState state = CreateBenzeneToNaphthalene(AtomMatcher.CreateAnyMatcher(), BondMatcher.CreateAnyMatcher());

            Assert.IsTrue(state.Feasible(4, 4)); // 4, 4 is feasible
            state.Add(0, 0);
            state.Add(1, 1);
            state.Add(2, 2);
            state.Add(3, 3);
            Assert.IsFalse(state.Feasible(4, 4)); // 4, 4 is infeasible
        }
Ejemplo n.º 20
0
        public void TestNextN()
        {
            UllmannState state = CreateBenzeneToNaphthalene(AtomMatcher.CreateAnyMatcher(), BondMatcher.CreateAnyMatcher());

            Assert.AreEqual(state.NextN(0), 0);
            state.size = 1;
            Assert.AreEqual(state.NextN(0), 1);
            state.size = 2;
            Assert.AreEqual(state.NextN(0), 2);
        }
Ejemplo n.º 21
0
        public void Accessors()
        {
            UllmannState state = CreateBenzeneToNaphthalene(AtomMatcher.CreateAnyMatcher(), BondMatcher.CreateAnyMatcher());

            state.size = 1;
            Assert.AreEqual(state.Count, 1);
            Assert.AreEqual(state.NMax(), state.g1.Length);
            Assert.AreEqual(state.MMax(), state.g2.Length);
        }
Ejemplo n.º 22
0
        public void Mapping()
        {
            UllmannState state = CreateBenzeneToNaphthalene(AtomMatcher.CreateAnyMatcher(), BondMatcher.CreateAnyMatcher());

            state.m1[0] = 1;
            state.m1[1] = 2;
            Assert.IsTrue(Compares.AreDeepEqual(state.m1, state.Mapping()));
            Assert.AreNotSame(state.m1, state.Mapping());
        }
Ejemplo n.º 23
0
        public void InfeasibleRemainCount()
        {
            VFSubState state = CreateBenzeneToNaphthalene(AtomMatcher.CreateAnyMatcher(), BondMatcher.CreateAnyMatcher());

            Assert.IsTrue(state.Feasible(0, 0)); // 0,0 is feasible
                                                 // XXX: depends on molecule order not changing
            state.m1[1] = 1;
            state.m1[5] = 5;
            state.t2[1] = 1;
            state.t2[9] = 1;
            Assert.IsFalse(state.Feasible(0, 0)); // 0,0 is infeasible
        }
Ejemplo n.º 24
0
 /// <summary>
 /// Create a pattern which can be used to find molecules which contain the
 /// <paramref name="query"/> structure.
 /// </summary>
 /// <param name="query">the substructure to find</param>
 /// <param name="atomMatcher">how atoms are matched</param>
 /// <param name="bondMatcher">how bonds are matched</param>
 /// <returns>a pattern for finding the <paramref name="query"/></returns>
 public static Pattern CreateSubstructureFinder(IAtomContainer query, AtomMatcher atomMatcher, BondMatcher bondMatcher)
 {
     return(new VentoFoggia(query, atomMatcher, bondMatcher, true));
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Create a pattern which can be used to find molecules which are the same
 /// as the <paramref name="query"/> structure.
 /// </summary>
 /// <param name="query">the substructure to find</param>
 /// <param name="atomMatcher">how atoms are matched</param>
 /// <param name="bondMatcher">how bonds are matched</param>
 /// <returns>a pattern for finding the <paramref name="query"/></returns>
 public static Pattern CreateIdenticalFinder(IAtomContainer query, AtomMatcher atomMatcher, BondMatcher bondMatcher)
 {
     return(new VentoFoggia(query, atomMatcher, bondMatcher, false));
 }