Closed mojaie closed 3 years ago
After consideration, structure matching methods will be as follows:
exactmatches(mol::UndirectedGraph, query::UndirectedGraph; kwargs...)
substructmatches(mol::UndirectedGraph, query::UndirectedGraph; kwargs...)
nodeinducedmatches(mol::UndirectedGraph, query::UndirectedGraph; kwargs...)
edgeinducedmatches(mol::UndirectedGraph, query::UndirectedGraph; kwargs...)
These methods return a lazy iterator that generate node mappings (or edge mappings for edgeinducedmatches
).
There will be some convenient methods, hasexactmatch
, hassubstructmatch
, hasnodeinducedmatch
, hasedgeinducedmatch
that returns whether the structures have matches or not.
Here is rough correspondence between the new method and the old one is as follows.
structmatches
-> exactmatches
isstructmatch
-> hasexactmatch
substructmatches
-> edgeinducedmatches
issubstructmatch
-> hasedgeinducedmatch
querymatch
, fastquerymatches
-> substructmatches
vf2 isomorphism detection methods in MolecularGraph.Graph
are also reconstructed and renamed.
See src/substructurematch.jl
and src/graph/isomorphism/vf2.jl
for details.
Merged d551ee55a9d3403de7ca4f5a967bb8e7fa12c685
(sub)structure matching methods will be integrated and renamed.
structmatches(mol::UndirectedGraph, query::UndirectedGraph, matchtype::Symbol; kwargs...)
now returns a lazy iterator that generate all isomorphism mappings betweenmol
andquery
mol
should beGraphMol
orSubgraphView{GraphMol}
query
should beGraphMol
,SubgraphView{GraphMol}
orQueryMol
matchtype
should be one of the followings:exact
:mol
is isomorphic toquery
:substruct
: a subgraph ofmol
is monomorphic toquery
(typical substructure search):nodeinduced
: a node-induced subgraph ofmol
is isomorphic toquery
:edgeinduced
: an edge-induced subgraph ofmol
is isomorphic toquery
isstructmatch(mol, query, matchtype; kwargs...)
returns whether there is an isomorphism mapping betweenmol
andquery
-> `!isempty(structmatches(mol, query, matchtype))