Structure match

MolecularGraph.connected_mcisMethod
connected_mcis(mol1::MolGraph, mol2::MolGraph; kwargs...) -> (Dict, Symbol)
connected_mces(mol1::MolGraph, mol2::MolGraph; kwargs...) -> (Dict, Symbol)

Compute connected maximum common substructure (MCS) of mol1 and mol2.

Keyword arguments

  • timeout(Real): abort calculation and return suboptimal results if the execution

time has reached the given value (default=60, in seconds).

  • targetsize(Int): abort calculation and return suboptimal result so far if the

given mcs size achieved.

source
MolecularGraph.disconnected_mcisMethod
disconnected_mcis(mol1::MolGraph, mol2::MolGraph; kwargs...) -> (Dict, Symbol)
disconnected_mces(mol1::MolGraph, mol2::MolGraph; kwargs...) -> (Dict, Symbol)

Compute disconnected maximum common substructure (MCS) of mol1 and mol2.

Keyword arguments

  • timeout(Real): abort calculation and return suboptimal results if the execution

time has reached the given value (default=60, in seconds).

  • targetsize(Int): abort calculation and return suboptimal result so far if the

given mcs size achieved.

source
MolecularGraph.emaptonmapMethod
nmap = emaptonmap(emap, mol, query)

Convert an edge-based mapping, of the form returned by edge_substruct_matches, into a map between nodes. Commonly, nmap[i] is a length-1 vector [j], where i=>j is the mapping from nodeattr(query, i) to nodeattr(mol, j). In cases where the mapping is ambiguous, nmap[i] may be multivalued.

source
MolecularGraph.ematchgenMethod
ematchgen(mol1::MolGraph, mol2::MolGraph) -> Function
ematchgen(mol::MolGraph{T1,V1,E1}, qmol::MolGraph{T2,V2,E2}
    ) where {T1,T2,V1,V2,E1,E2<:QueryTree}
ematchgen(mol1::MolGraph{T1,V1,E1}, mol2::MolGraph{T2,V2,E2}
    ) where {T1,T2,V1,V2,E1<:QueryTree,E2<:QueryTree}

Return a default edge attribute matching function for graph isomorphism algorithms.

source
MolecularGraph.substruct_matchesMethod
substruct_matches(mol1, mol2; kwargs...) -> Iterator

Return a lazy iterator that generate node mappings between mol and query if mol has query as a substructure.

options

  • vmatch::Function: a function for semantic atom attribute matching (default: MolecularGraph.vmatch)
  • ematch::Function: a function for semantic bond attribute matching (default: MolecularGraph.ematch)
  • mandatory::Dict{Int,Int}: mandatory node mapping (or edge mapping if matchtype=:edgeinduced)
  • forbidden::Dict{Int,Int}: forbidden node mapping (or edge mapping if matchtype=:edgeinduced)
  • timeout::Union{Int,Nothing}: if specified, abort vf2 calculation when the time reached and return empty iterator (default: 10 seconds).
source
MolecularGraph.tdmcisMethod
tdmcis(mol1::MolGraph, mol2::MolGraph; kwargs...) -> (Dict, Symbol)
tdmces(mol1::MolGraph, mol2::MolGraph; kwargs...) -> (Dict, Symbol)

Compute disconnected MCS of mol1 and mol2 with topological constraint (td-MCS).

Keyword arguments

  • diameter(Int): distance cutoff for topological constraint.
  • tolerance(Int): distance mismatch tolerance for topological constraint.
  • timeout(Real): abort calculation and return suboptimal results if the execution

time has reached the given value (default=60, in seconds).

  • targetsize(Int): abort calculation and return suboptimal result so far if the

given mcs size achieved.

References

  1. Kawabata, T. (2011). Build-Up Algorithm for Atomic Correspondence between

Chemical Structures. Journal of Chemical Information and Modeling, 51(8), 1775–1787. https://doi.org/10.1021/ci2001023

  1. https://www.jstage.jst.go.jp/article/ciqs/2017/0/2017P4/article/-char/en
source
MolecularGraph.vmatchgenMethod
vmatchgen(mol1::MolGraph, mol2::MolGraph) -> Function
vmatchgen(mol1::MolGraph{T1,V1,E1}, mol2::MolGraph{T2,V2,E2}
    ) where {T1,T2,V1,V2<:QueryTree,E1,E2} -> Function
vmatchgen(mol1::MolGraph{T1,V1,E1}, mol2::MolGraph{T2,V2,E2}
    ) where {T1,T2,V1<:QueryTree,V2<:QueryTree,E1,E2}

Return a default vertex attribute matching function for graph isomorphism algorithms.

source