















\section*{Author Information}
\subsection*{Corresponding Author}
{\renewcommand\labelitemi{}
	\begin{itemize}
		\item \acsauthor{Daniel Merkle}{\denmark}{0000-0001-7792-375X}; 
		Email: \href{mailto:daniel@imada.sdu.dk}{daniel@imada.sdu.dk}
	\end{itemize}
}
\subsection*{Authors}

{\renewcommand\labelitemi{}
	\begin{itemize}
		\item \acsauthor{Jakob L. Andersen}{\denmark}{0000-0002-4165-3732}
		\item \acsauthor{Rolf Fagerberg}{\denmark}{0000-0003-1004-3314}
		\item \acsauthor{Christoph Flamm}{\vienna}{0000-0001-5500-2415}
		\item \acsauthor{Walter Fontana}{\boston}{0000-0003-4062-9957}
		\item \acsauthor{Juraj Kol\v{c}\'ak}{\denmark}{0000-0002-9407-9682}
		\item \acsauthor{Christophe V.F.P. Laurent}{\denmark}{0000-0002-9112-6981}
		\item \acsauthor{Nikolai N{\o}jgaard}{\denmark}{0000-0002-7053-4716}
	\end{itemize}
}

\section*{Acknowledgments}
This work is supported by the Novo Nordisk Foundation grant NNF19OC0057834 and by the Independent Research Fund Denmark, Natural Sciences, grants DFF-0135-00420B and DFF-7014-00041.


\section{Introduction}
\label{sec:introduction}

Catalysis is the increase of a reaction rate of a chemical reaction by the introduction of a
special substance---the catalyst---into the reaction without manipulating basic state variables such as temperature, pressure, free energies of the educts and products, or the equilibrium constant.
Although the catalyst reacts with one or more reactants it is  regenerated during the process of catalysis and comes out of the process structurally unchanged.
This capability places catalysis at the forefront of modern chemistry.

A core requirement for improving, or even implementing a catalysis powered process, is the understanding of the catalytic mechanism in question.\cite{BusaccaFSS2011}
The commonly employed overall reaction description as a list of educt and product molecules is therefore insufficient.
In some cases---and this is particularly true for enzymatic reactions---the catalyst itself, or its active site, is unknown.
In combination with the catalyst being restored to its initial state after a completed cycle, such a description may lead to obstruction of the role the catalyst plays in driving the reaction.
This is especially noticeable with \emph{atom maps} relating the atoms of product molecules with their original positions in the educts.
As catalysts commonly participate in bond rearrangements during the reaction, trading atoms with the substrates is not uncommon.

Traditionally, an enzymatic reaction is specified in its full detail by means of a stepwise \emph{reaction mechanism}.
Here, we capture the mechanism in a formal way using a definition that is unambiguous on the topological level.
To achieve this we employ the formalism of graph transformation.
A core concept of the latter is an inherently \enquote{executable} rule: a schema representing the transformation of the educt molecules into the product molecules.
Rules can be used to capture the reaction steps, allowing the reaction mechanism to be represented by a sequence of rule applications.

A similar representation of reaction mechanisms has previously been used to explain reactions by mechanisms constructed directly from consecutive rule application.\cite{AndersenFFFKLMN2021}
However, this approach is hindered by combinatorics inherent to application of the rules, as well as the prediction of the catalytic context.
This issue may be alleviated through larger rules, which encapsulate several steps or even entire mechanisms.

A single rule representing an entire reaction mechanisms opens up further possibilities, such as the classification of mechanisms based on their topological similarity.
The single rule representation can also aid in discovery and exploitation of electron flow patterns behind the reaction.

To obtain a single structure summarizing the overall bond rearrangements described in a mechanism, we build upon the notion of \emph{imaginary transition states} (ITSs).\cite{Fujita1986}
Originally, an ITS was defined as a structural formula with three bond types (i.e., bonds only seen in the educt molecules, bonds only seen in the product molecules, and invariant bonds) resulting from the superposition of the educts and products of an overall reaction.
By including the full and detailed reaction mechanism we decorate the ITS with the intermediary modifications related to the catalytic nature of a reaction.
To that end we have to augment the concept of ITSs with two additional bonds types explaining the transient modifications.
One type for bonds that appear in educts and products and another one for bonds that are not present in educts nor products.
In essence, such an ITS is a stack of reaction steps and contains all the necessary instructions to generate the product molecules from the educt molecules.

The compactness of ITSs is helpful for understanding the underlying chemistry.
An important point is the atom map between all the participating species (i.e., educt and product molecules, and catalyst) intrinsically captured by the ITS.\cite{MannNSBSF2014}
This is conceivably valuable for the development of processes where \enquote{quality by design} plays a central role.\insertref

Within the graph transformation framework, the concept of an ITS naturally correlates with a rule, allowing us to use those ITS rules to propose mechanisms for new reactions.
Such ITS rules can additionally be stripped of the catalytic context, allowing us to match reactions without explicitly listed catalysts, as seen in many enzymatic reactions.
Upon a successful match, the original catalytic context can be restored to the newly proposed mechanism.
We demonstrate this approach by proposing detailed mechanisms for hundreds of reactions, using the open-source software framework MØD.\cite{AndersenFMS2016}\todoJK{canonmatch}

ITSs serve as a base for a classification system for organic reactions,\cite{Hendrickson1997} motivating a similar application of our extended ITSs for classification of enzymatic reactions.
A full-fledged classification scheme, comparable to the Enzyme Commission (EC) classification, is out of the scope of this article.
Nevertheless, our preliminary results support the idea of utilizing ITSs for automated classification of enzymatic reactions.


\section{Introduction}
\label{sec:introductionAlt}

In chemistry, a given overall reaction is often known to proceed as a
sequence of smaller reaction steps, collectively termed the reaction
mechanism. Each step in a reaction mechanism typically consists of the
relocation of a small set of electrons.

In particular, this is the case for catalytic reactions. Catalytic
reactions are reactions where an additional reagent---the
catalyst---opens up a route between the starting materials and the
products with a lower activation barrier than the corresponding
uncatalyzed process having the same overall reaction.
Alternatively, the catalyst might also be able to accelerate an existing (non-catalyzed) pathway if the transition state exhibits a stronger binding than the substrate. 
In such a scenario the activation energy would also be lowered.\cite{Olivo2021}
The catalyst is
not itself consumed in the process. It participates in intermediate
reaction steps, but is in the end regenerated and comes out of the
process structurally unchanged.\cite{twigg2018catalyst}

For catalytic reactions in biochemistry, the number of steps in a
reaction mechanism may be quite large: the 
Mechanism and Catalytic Site Atlas (M-CSA) database~\cite{RibeiroHFTFT2017} lists close to thousand enzymes and for many of these it gives
suggestions for reaction mechanisms, some of which
contain over ten steps.
More importantly, most of
the molecular changes induced in intermediate steps are often not reflected in the overall reaction at all.

Thus, for catalytic reactions in general, and for enzymatic reactions
in particular, the overall reaction is often too simple to capture the
essential chemical components involved in the reaction. For instance, the overall reaction is unable to distinguish between different enzymatic mechanisms for a given reaction.

Our aim in this paper is to develop a richer, yet still succinct,
notion of overall reaction which expresses major aspects of the
underlying reaction mechanism. Our claim is that this may be a useful
tool when describing, analyzing, searching for, and designing
catalytic reactions, in particular when combined with computational methods. In the second part of the paper, we give some
first use cases justifying this claim.

We call our notion Overlay Graphs
(OG). Our starting point is the
so-called Imaginary Transition Structures (ITS) of
Fujita.\cite{Fujita1986} ITS are structural formulas with three bond
types: bonds only seen in the educt molecules, bonds only seen in the
product molecules, and bonds appearing in both. We propose to augment
the concept of ITS with two additional bonds types capturing transient
bond changes in the underlying reaction mechanism.  The first new type
is for bonds that appear in both educts and products, but are transiently
absent in the mechanism. The second new type is for bonds that do not
appear in neither educts nor products, but are transiently present in
the mechanism.

The concept of OG\ is quite straight-forward on the intuitive
level---see \hyperref[fig:mech_example]{Figure \ref{fig:mech_example}}
for an example. However, we take the effort to also define the
concept of OG\ more rigorously by expressing it in the context of graph transformation.\cite{EhrigEGT2006}
As we outline now, this effort comes with a number of benefits.

It is standard to describe molecules by chemical graphs, i.e.,
undirected graphs with vertices labeled by atom types and edges
labeled by bond types. As chemical reaction constitute a change of
educt molecules into product molecules, formal methods for specifying
transformations of graphs are well suited for modeling chemical
reactions. In this paper, we use the so-called double push-out (DPO)
formalism~\cite{HabelMP2001} for graph transformation when developing our notion of
OG. Besides ensuring a high level of precision in our
definitions, it also provides an interface to the computational
framework MØD.\cite{AndersenFMS2016} This framework is able to test for matches between
graphs and graph transformation rules, and in case of a match to
calculate the effect of applying the transformation rule to the graph. In a chemical context, this amounts to being able to execute (\textit{in silico}) a
set of specified reactions on a set of given substrates.

The DPO formalism is very flexible, since graph transformation rules
used in matches can specify the full educt molecule, just the core reaction center, or anything in between, which allows for modeling classes of reactions with a single rule. One further benefit is that individual
atoms can be tracked across reactions. An enzyme, although topologically unchanged by the
reaction that it catalyzes, may well swap atoms with the substrate, so tracking individual atoms is relevant for instance when investigating biochemical pathways via stable isotope labeling of molecules.

Clearly, being able to computationally model, manipulate, search, and
execute chemical reactions on the level of DPO opens up many avenues of investigation. The second part of this paper exemplifies this in the context of OG.

In short, our contributions contain the extension of the notion of ITS graphs to OG{} by means of a strict generalization. That is, if a mechanisms consists of a single step, the obtained OG{} is identical to the ITS graph.
We additionally capture the notion of OG{} in full mathematical formalism, allowing us to utilize the concept within MØD, and consequently perform computational analyses.
To counteract the lack of knowledge of the exact activate site for many enzymatic reactions, we propose a reduced version of an OG{}, called substrate OG{}, which only specifies the substrates.
This version allows us to investigate enzymatic reactions without explicit knowledge of the catalytic pocket.
Finally, we construct OG{}s for a number of carboxylic ester hydrolases from the M-CSA database.
We use the obtained OG{}s to demonstrate not only their use in interpreting the underlying chemistry, but also in searching for reactions which could be explained by the same mechanism.
The latter application further motivates the possibility of using OG{}s as means of automated mechanism classification, akin to the application of ITS graphs for classification of organic reactions.\cite{Hendrickson1997}



\section{Methods}
\label{sec:method}

\subsection{Reaction Mechanisms}

Rather than a singular change, a chemical reaction is often understood as a sequence of \emph{reaction steps} that describe the conversion of educt into product molecules through a series of intermediates.
On the other hand, a  reaction \emph{mechanism} is composed of a sequence of steps and is commonly used to describe catalytic reactions---especially in enzymology.
An example of a reaction mechanism consisting of four steps is shown in \hyperref[fig:mech_example]{Figure \ref{fig:mech_example}}.
While the overall reaction description portraits the catalytic components as \enquote{observers} and oftentimes does not even explicitly represent them, a reaction mechanism provides the exact instructions on how the reaction should be executed, including transient modifications of the catalytic components.

In order to obtain an unambiguous topological description, we understand a reaction mechanism as a sequence of electron movements on top of the educt molecules.
By convention this flow of electrons is depicted by \enquote{curved arrows} (magenta arrows in \hyperref[fig:mech_example]{Figure \ref{fig:mech_example}}).
These electron movements are generally aggregated in the form of reaction steps (\hyperref[fig:mech_example]{Figure \ref{fig:mech_example}}), which can range from individual electron movements to entire reactions.
One can therefore utilize reaction mechanisms to describe a single catalytic reaction, as well as a whole metabolic processes, e.g. the TCA cycle.\cite{KrebsKK1987, ZubayPV1995, EhrigHL2006}
Additionally, rather than treating the catalysts---in our case, enzymes---as whole molecules, we only represent its actively participating components, i.e. active amino acids and/or cofactors.

The key aspect of such an interpretation of a reaction mechanism lies in the electron movements being described on top of the educt molecules.
This naturally provides the atom maps, which relate atoms in the intermediates and products to their original position in the educt molecules.
It is by virtue of the atom maps, that our definition of a reaction mechanism gives a complete topological description of a reaction, including all transient modifications.
To further ensure a reaction mechanism is fully unambiguous, including the causal information, it has to constitute reaction steps that correspond to individual electron jumps, that is, the smallest chemically relevant changes.

\begin{figure*}
	\centering
	\resizebox{.9\linewidth}{!}{%
		\input{figs/mechanism_figure/218_1}
	}
	\caption
		Example of a four step mechanism (M-CSA \mcsaentry{218}).~%
		This \ECnumsimple{3}{1}{1}{3}~reaction is performed by a pancreatic Triacylglycerol lipase (\uniprot{P29183}) and catalyzes the conversion of a triacylglycerol (iv) into a fatty acid ion (x) and diacylglycerol (viii).~%
		In the first step the Histidine (ii) deprotonates the Serine (i), which is then able to attack the substrate (iv).~%
		After this, the Serine is covalently bound to the substrate (vi) and the Histidine side chain is fully protonated (v).~%
		In the second step the oxyanion collapses, which leads to the release of diacylglycerol (viii) and the deprotonation of the Histidine (ii).~%
		In the third step, the Histidine (ii) deprotonates the water (iii).~%
		This allows the water molecule to attack the acylated Serine (vii).~%
		In step four, the oxyanion collapses once more, which leads to the elimination of a fatty acid ion (x) and the reconstitution of the amino acids.~%
		The lower right panel shows all the steps overlaid on top of each other, corresponding to the OG{}.~%
		Here, the bonds created or broken during the reaction are shown in green and red, respectively.~%
		Transiently modified bonds are depicted in black or blue.~%
		The atoms and bonds depicted in gray are not directly involved in the reaction.%
	}
	\label{fig:mech_example}
\end{figure*}

\subsection{Graph Transformation Framework}
\label{sec:graph_transformation}

To be able to reason about ambiguity of mechanisms, we need to express them within a sufficiently formal setting.
Since molecules are traditionally represented as undirected,
connected, and typed graphs, the formalism of graph transformation seems
appropriate.
The framework has a well established foundation rooted in category theory,\cite{EhrigPS1973,HabelMP2001,EhrigEGT2006}
as well as numerous chemical applications.\cite{SilvaAHWBSF2019, AndersenFMS2015, AndersenMR2019, AndersenFFKMS2018,hcn:13,flow}

A molecule is treated as a typed graph, where a typed node represents an atom with a charge while a typed edge represents a bond of a given order.
A collection of molecules is then represented by a disconnected typed  graph, referred to as a mixture, where each connected component is a molecule.
A rule describes how one mixture can be transformed into another.
This is achieved by embedding an input pattern into a mixture and transforming the matched part according to an output pattern.

Formally, a (double-pushout) rule is a span $p = (L \xleftarrow{l}{} K\xrightarrow{r}{} R)$, where $L$ and $R$ are the left and right patterns respectively, and $K$ is the invariant graph, containing elements common to $L$ and $R$.
The exact correspondence between $L$ and $R$ is then given by the injections $l$ and $r$.

In our case, we want an atom that is changing charge to preserve its identity.
That is, we want to be able to relabel a vertex, rather than delete and recreate it with the new label.
To achieve this, we use a previously described formalism,\cite{AndersenFMS2016,AndersenFMS2018,BehrKAM2021} where the invariant graph $K$ is untyped, allowing us to relate two vertices with different labels via $l$ and $r$.

The notion of vertex identity is expressed in what is called the \emph{combined graph} of a rule.
A combined graph contains all vertices and edges, that appear in either $L$ or $R$, typed by both their type in $L$ and their type in $R$, if defined.
The notion of a graph transformation rule and its combined graph is illustrated in \hyperref[fig:rule]{Figure~\ref{fig:rule}}.

\begin{figure}
	\tikzset{dAtom/.append style={node distance=1.5em}}
	\tikzset{vDot/.append style={node distance=1.5em}}
	\begin{subfigure}[b]{\linewidth}
        \centering
		\input{figs/rule_1.tex}
		\caption{}
		\label{fig:rule_example}
	\end{subfigure}
	\begin{subfigure}[b]{\linewidth}
		\centering
		\input{figs/rule_1_combined.tex}
		\caption{}
		\label{fig:rule_combined}
	\end{subfigure}
	
    \caption{\subref{fig:rule_example} The graph transformation rule corresponding to the first step of the mechanism in \hyperref[fig:mech_example]{Figure~\ref{fig:mech_example}}.
    The dotted lines represent the implicit non-bond constraints. E.g. the nitrogen and hydrogen atoms cannot be already bonded on the educt side, as the rule creates a new bond between them.
    \subref{fig:rule_combined} The combined graph of the rule in~\subref{fig:rule_example}.%
    }
    \label{fig:rule}
\end{figure}

The application of a rule $p$ on a graph (mixture) $G$ can be broken up into two steps.
First, finding an embedding of $L$ in $G$, the \emph{match} $m$.
The match not only has to respect the atom and bond types, but also what we refer to as \emph{non-bond constraints}, typically between atoms that the rule creates a bond between, thus preventing parallel bonds.
Second, what appears on the left side $L$ is removed and the contents of $R$ are added instead, to obtain the mixture $H$.
Formally, the rule application is defined in the commutation of the following diagram:
\begin{center}
	\begin{tikzpicture}[nMorphism/.style={node distance=1cm}]
		\node[nMorphism]  (L) {$L$};
		\node[nMorphism, right=of L]  (K) {$K$};
		\node[nMorphism, right=of K]  (R) {$R$};
		\node[nMorphism, below=of L]  (G) {$G$};
		\node[nMorphism, right=of G]  (D) {$D$};
		\node[nMorphism, right=of D]  (H) {$H$};

		\draw[eMorphism] (K) to node[eLabel] {$l$} (L);
		\draw[eMorphism] (K) to node[eLabel] {$r\vphantom{l}$} (R);
		\draw[eMorphism] (D) to (G);
		\draw[eMorphism] (D) to (H);
		\draw[eMorphism] (L) to node[eLabel] {$m\vphantom{d}$} (G);
		\draw[eMorphism] (K) to node[eLabel] {$d$} (D);
		\draw[eMorphism] (R) to node[eLabel] {$h$} (H);
	\end{tikzpicture}
\end{center}

We call such transformations of $G$ into $H$ \emph{direct derivations}, denoted by $G\xRightarrow{p, m}{} H$.
By letting the result graph act as the host for successive applications, we can construct a sequence of direct derivations $G\xRightarrow{p_1,m_1}{}H_1\xRightarrow{p_2, m_2}{}H_2,\dots , H_{n-1}\xRightarrow{p_n, m_n} H_n$, referred to simply  as a \emph{derivation}, $G\Rightarrow^* H_n$.

Conveniently, a reaction mechanism converting the mixture of educt molecules $E$ into the mixture of product molecules $P$, can be formalized in terms of a derivation $E\Rightarrow^* P$.
Each direct derivation in $E\xRightarrow{p_1,m_1}{}H_1\xRightarrow{p_2, m_2}{}H_2,\dots , H_{n-1}\xRightarrow{p_n, m_n} P$, defines an atom map sending each atom through the derivation.
As a consequence, a mechanism defines a unique causal trajectory for each atom in $E$ into $P$.

\subsection{Overlay Graphs}
\label{sec:its}

In this section we introduce and formalize the notion of an overlay graph (OG{}) of a reaction mechanism.
An OG{} is essentially an abstraction of a reaction mechanism, where the causal information is omitted.
However, all the transient modifications are preserved, which gives an account of the minimal topological structure immediately necessary for the execution of the reaction.

It turns out that graph transformation rules themselves are a suitable construction for such aggregation of the individual steps.
As a mechanism is already defined by means of a derivation and thus, in particular, a sequence of rules, one can employ the rule composition framework\cite{AndersenFMS2018} and obtain representation of the whole mechanism as a single rule.

Just as the rest of the graph transformation framework, rule composition is defined within the category theory formalism.
In principle, composition of two rules $p_1$ and $p_2$ into a single rule $p$ consists of ensuring two properties.
The left side of $p$ should include the left side of $p_1$ as well as the part of the left side of $p_2$ which is not produced by $p_1$.
Similarly, the right side of $p$ should contain the right side of $p_2$ as well as the part of the right side of $p_1$ which is not consumed by $p_2$.

In the following, we revisit the necessary rule composition notions in an informal way, using the rules corresponding to the first two steps of the mechanism in \hyperref[fig:mech_example]{Figure~\ref{fig:mech_example}} as an example.
Readers are referred to the literature for the comprehensive treatment.\cite{AndersenFMS2018}

As aforementioned, the composed rule depends on the overlap between the right side of the first rule, and the left side of the second rule.
In general, any such overlap can be chosen for rule composition, our rules, however, come from a derivation.
For any two rules $p_i = (L_i \xleftarrow{l_i}{} K_i \xrightarrow{r_i}{} R_i)$ for $i \in \{ 1, 2\}$ we are composing,
we thus also have a couple of direct derivations $D_i = H_{i-1}\xRightarrow{p_i, m_i} H_{i}$, again for $i \in \{1, 2\}$.
The direct derivations give us the atom maps by means of the matches $m_1$ and $m_2$, and the corresponding right side embeddings $h_1$ and $h_2$.
The overlap can thus be extracted in form of the subgraph of $H_1$ delimited by $h_1$ and $m_2$, denoted as $H$ in \hyperref[fig:h_pushout_hyperdiagram]{Figure~\ref{fig:h_pushout_hyperdiagram}}.

The graph $H$ represents an interface between $R_1$ and $L_2$, and thus between the two rules.
This allows us to construct the composed rule $p = p_1 \mathbin{\bullet_{H_1}} p_2 = (L \xleftarrow{l}{} K \xrightarrow{r}{} R)$
where $L, K, R$ as well as $l$ and $r$ follow from the commutative diagram in \hyperref[fig:composition_hyperdiagram]{Figure~\ref{fig:composition_hyperdiagram}}.

\begin{figure}
	\centering
	\resizebox{\linewidth}{!}{%
		\input{figs/H_pushout_hyper.tex}%
	}
	\caption{
		Commutative diagram showing the construction of the graph $H$.
		Note that $R_1$ and $L_2$ are isomorphic in our case, however, the atom maps provided by the derivation differentiate between the two intermediate oxygen atoms, indicated by different positions.
		None of the oxygen atoms thus appears in the shared subgraph of $R_1$ and $L_2$, denoted $I$.
		On the other hand, both oxygen atoms appear in the interface graph $H$.%
	}
	\label{fig:h_pushout_hyperdiagram}
\end{figure}

More precisely, the graph $H$ marks the vertices shared by both $p_1$ and $p_2$.
The rest of the composition is then an iterative process of extending this interface along the rules $p_1$ and $p_2$, via $C_1$ and $C_2$, respectively for $K_1$ and $K_2$, and finally $L$ and $R$, respectively, for $L_1$ and$R_2$.
Finally, the graph $K$ is constructed as the structure shared by $C_1$ and $C_2$.
Intuitively, all the constructions consist of completing directed squares within the diagram, and represent the construction of a smallest graph combining two others in the target corner, while the source corner specifies the shared subgraph.

\begin{figure*}
	\centering
	\input{figs/composition_hyperdiagram4.tex}%
	\caption{
		Commutative diagram for rule composition of two rules
		$p_1 = (L_1 \xleftarrow{l_1}{} K_1 \xrightarrow{r_1}{} R_1)$
		and $p_2 = (L_2 \xleftarrow{l_2}{} K_2 \xrightarrow{r_2}{} R_2)$ with direct derivations
		$D_1 = H_0\xRightarrow{p_1, m_1} H_1$ and $D_2 = H_1\xRightarrow{p_2, m_2} H_2$ respectively. We note
		that $h_1$ and $m_2$ are defined by $D_1$ and $D_2$ as illustrated by the commutative diagram of rule application.
		The resulting rule is $p= p_1 \mathbin{\bullet_{H_1}} p_2 = (L \xleftarrow{l}{} K \xrightarrow{r}{} R)$ with $l= s_1\circ w_1$ and $r = t_2 \circ w_2$.
		The colors from red to violet encode the order in which the individual graphs are inferred. Black color indicates the input graphs.%
	}

	\label{fig:composition_hyperdiagram}
\end{figure*}

The composition naturally gives rise to the direct derivation
$H_0\xRightarrow{p, m}H_2$ transforming $H_0$ directly into $H_2$ without the use of the intermediate graph $H_1$, called the \emph{composed derivation}.
This derivation is depicted in the bottom part of the commutative diagram in \hyperref[fig:composition_hyperdiagram]{Figure~\ref{fig:composition_hyperdiagram}}.

The rule composition is well suited for the task of aggregating a mechanism as it keeps track of transient modifications.
Take the non-bond constraints in $L$ and $R$ as an example, in particular, between the nitrogen and hydrogen atoms.
The same non-bond constraint is implicit in the original rules $p_1$ (on the left side) and $p_2$ (on the right side), due to the bond being created or broken, respectively.
The composed rule $p$, however, does not create nor break said bond, the inherited constraint being explicit.
This property allows us to express that the action carried out by $p$ relies on the transient formation of the nitrogen-hydrogen bond, thus the bond cannot be already present in a matched mixture.
Similarly, the carboxylic double bond broken by $p_1$ but reinstated by $p_2$ is present in both $L$ and $R$, however, its absence from $K$ indicates its transient breakage along the execution of $p$.

One might consider transient changes of formal charges to be similar.
However, formal charges are encoded as changes in the type (label) of a vertex.
As the vertices are not typed in $K$, the change of label is not reflected.
This is in line with the transient change in formal charge not imposing a constraint on the applicability of the composed rule.

As each composed rule comes with its composed derivation, we can iterate the process until the entire mechanism is captured within a single rule.

\begin{definition}[Overlay Rule]
	Let $M = E\xRightarrow{p_1,m_1}{}H_1\xRightarrow{p_2, m_2}{}H_2, \dots , H_{n-1}\xRightarrow{p_n, m_n} P$ be a reaction mechanism.
	Then the overlay rule $p(M)$ of $M$ is the rule
	$p(M) = p_1 \bullet_{H_1} p_2, \dots , p_{n-1} \bullet_{H_n-1} p_{n}$.

	We refer to the corresponding composed derivation $D(M)=E\xRightarrow{p(M), m}P$ as the \emph{overlay derivation}.
\end{definition}

Overlay rules provide the formal support for the notion of an OG{}.
To obtain a visualization akin to the original ITS concept,~\cite{Fujita1986} we construct the OG{} by collapsing the rule into a single graph.
Similarly to the combined graph of a rule, the OG{} contains all atoms, bonds and even explicit non-bond constraints that appear on either side of the overlay rule.
Instead of the usual before-and-after labels of the combined graph of a rule, OG{}s follow a colour scheme describing the treatment of each element during the mechanism.
The action, permanent changes, is given in green and red for atoms and bonds that are introduced, respectively eliminated by the overlay rule.
This includes increase, respectively, decrease in valence of a bond.
Transient changes appear in black, for bonds that are temporarily broken or modified and blue for the explicit non-bond constraints, that is bonds that are temporarily created.
An example OG{} of the mechanism from  \hyperref[fig:mech_example]{Figure~\ref{fig:mech_example}} appears in \hyperref[fig:its_graph]{Figure~\ref{fig:its_graph}}.

\begin{figure}
	\begin{subfigure}[b]{\linewidth}
		\centering
		\resizebox{\linewidth}{!}{%
			\input{./figs/its_graph.tex}
		}
		\caption{}
	\label{fig:its_graph}
	\end{subfigure}
	\begin{subfigure}[b]{\linewidth}
		 \centering
		 \resizebox{\linewidth}{!}{%
		 	\input{figs/substrate_rule.tex}
		 }
		 \caption{}
		 \label{fig:substrate_rule}
	\end{subfigure}
	\caption{%
		OG{}s of the triglyceride lipase mechanism from \hyperref[fig:mech_example]{Figure~\ref{fig:mech_example}}.~%
		The bonds created or broken during the reaction are shown in green and red, respectively.~%
		Non-bond constraints are depicted in blue.~%
		The gray parts of the molecules are not part of the OG{} nor overlay rule and are only included to frame the reaction.~%
		\subref{fig:its_graph} OG{} of the original mechanism.~%
		\subref{fig:substrate_rule} The corresponding substrate OG{}.~%
		Observe that the hydrogen atom donated by the serine is green, meaning that the overlay rule \enquote{creates} it, while the hydrogen of the water molecule that is used to restore the serine is in red, effectively \enquote{erased} by the rule.%
	}
	\label{fig:its_and_substrate}
\end{figure}

As any other graph transformation rules, overlay rules are applicable to mixtures beyond the educt graph of the original reaction.
As an overlay rule models the aggregated action of a mechanism, it also represents the necessary and sufficient condition for the execution of said mechanism.
In other words, any application of an overlay rule bears witness to executability of the represented mechanism in a given mixture.

Of particular interest are direct derivations of the form $E\xRightarrow{p(M_1), m} P$ where $(E, P)$ is reaction different from the source of the mechanism $M_1$.
For each such derivation, we can construct a mechanism $M_2$ consisting of the exact same electron movements as $M_1$, remapped to the educt graph $E$.
It is easy to see from \hyperref[fig:mech_example]{Figure~\ref{fig:mech_example}}, that sources and targets of all electron movements appear within the overlay rule.
Their location in $E$ is thus captured by the match $m$.

Overlay rules thus allow for discovery of potential mechanisms by means of a single rule application.
Unlike previous approaches,\cite{AndersenFFFKLMN2021} overlay rules treat mechanism as an indivisible unit and do not allow for recombination.
Applying a rule only once, however, bypasses much of the combinatorial explosion associated with the number of possible mixtures one can achieve by repeated application of rules.\cite{AndersenFFFKLMN2021}

\subsection{Substrate Overlay Rules}
\label{sec:substrate_its}

The overlay rules are universal, applicable to any reaction mechanism.
Our application focus being enzymatic reactions, we dedicate this section to treatment of overlay rules within the scope of enzymatic reactions.

The catalytic nature of the reactions does not directly impact the process of mechanism discovery and therefore the overlay rule can be still applied to any educt mixtures of choice.
Since the mechanism, and in turn the overlay rule, captures the exact involvement of the catalytic components in the reaction (i.e., active amino acids and cofactors), the new educt graph has to specify the catalysts to match the overlay rule.
Explicit specification of the catalytic moiety is very rare, however, especially for enzymatic reactions where the catalytic site of the enzyme might not be known at all.

The knowledge of the exact participation of the catalysts in the mechanism is invaluable for the interpretation and visualization of the reaction mechanism.
Due to the cyclical nature of catalysis, however, the chemical structure of the catalyst appears untouched in the overall reaction.
Explicit representation of the catalyst thus fails to add value to the overlay rules from the perspective of executability.

Instead, we introduce a reduced version of the rule called \emph{substrate overlay rule}, where only the part of the mechanism that takes place within the substrate molecules is represented.
Analogous to the representation of the catalytic components in the overall reaction schema, the role of the catalyst is made implicit.
Substrate overlay rules are thus applicable to mixtures consisting exclusively of substrate molecules.

An obvious prerequisite to the construction of substrate overlay rules is the identification of catalytic components.
As the energy landscape is abstracted away in our model, the usual definition of a catalyst is reduced to molecules that appear in the exact same configuration on both sides of the overall reaction.
We formalize this notion by a graph $C$ of catalytic molecules contained in both $E$ and $P$ as a subgraph, identified by a pair of injections $C \xrightarrow{c_1} E$ and $C \xrightarrow{c_2} P$.

\begin{definition}[Substrate Overlay Rule]
	Let $p(M) = L\xleftarrow{l} K \xrightarrow{r} R$ be an overlay rule, $D=E \xRightarrow{p(M),m} P$ the overlay derivation and let $C$ be the graph of the catalytic components with $C \xrightarrow{c_1} E$ and $C \xrightarrow{c_2} P$.

	Then the rule $L'\xleftarrow{l'} K' \xrightarrow{r'} R'$ where $L'$, $K'$, $R'$, $l' = u_1 \circ n_1$ and $r' = u_2 \circ n_2$ come from the commutative diagram in \hyperref[fig:substrate_hyperdiagram]{Figure~\ref{fig:substrate_hyperdiagram}} is a substrate rule of $M$.

	\label{def:substrate_rule}
\end{definition}

\begin{figure*}
	\centering
	\input{figs/substrate_hyperdiagram.tex}%
	\caption{%
		Commutative diagram for inference of the substrate rule.
		$E'$ and $P'$ are the substrate part of the educt graph and product graph respectively.
		The left and right graphs $L'$ and $R'$ of the substrate overlay rule correspond to the shared part of $E'$ and $L$, respectively $P'$ and $R$.
		Similarly, $K'$ corresponds to the shared part of $L'$, $R'$ and $K$.
		The colours from red to cyan indicate the other in which the individual graphs are constructed. Black colour indicates the input graphs.%
	}
	\label{fig:substrate_hyperdiagram}
\end{figure*}

In simple terms, the substrate overlay rule is obtained by only extracting the part of the overlay rule that corresponds to the substrate parts of $E$ and $P$.
\hyperref[fig:substrate_hyperdiagram]{Figure~\ref{fig:substrate_hyperdiagram}} illustrates this four step process on the overlay rule in \hyperref[fig:its_and_substrate]{Figure~\ref{fig:its_and_substrate}}.
First, $E'$ and $P'$ are constructed as complements of $C$ within $E$ and $P$ (\hyperref[fig:substrate_hyperdiagram]{Figure~\ref{fig:substrate_hyperdiagram}} red), that is, as all the educt and product molecules that are not catalysts.
In the next step, $L'$ is obtained as the shared part of $E'$ and $L$, and $R'$ is extracted from $P'$ and $R$ (\hyperref[fig:substrate_hyperdiagram]{Figure~\ref{fig:substrate_hyperdiagram}} yellow).
$L'$ and $R'$ are thus projections of $L$ and $R$ onto the substrate parts of $E$ and $P$, respectively.
Finally the same operation is used to obtain $K'$ as the shared part of $L'$, $R'$ and $K$.
To be formally correct, this is done in two phases.
First, $N_1$ and $N_2$ are built from $L'$ and $K$, respectively $R'$ and $K$ (\hyperref[fig:substrate_hyperdiagram]{Figure~\ref{fig:substrate_hyperdiagram}} green),
followed by $K'$ itself from $N_1$ and $N_2$ (\hyperref[fig:substrate_hyperdiagram]{Figure~\ref{fig:substrate_hyperdiagram}} cyan).
The construction relies on the same concepts as the diagram in \hyperref[fig:composition_hyperdiagram]{Figure~\ref{fig:composition_hyperdiagram}}, especially extracting a shared portion of two graphs according to their embedding in a common supergraph.

Separation of the substrate overlay rule construction into a educt and product side is crucial, since substrate and catalyst components might trade atoms.
Consider for instance the OG{} depicted in \hyperref[fig:its_graph]{Figure~\ref{fig:its_graph}}.
The depicted reaction is catalyzed by an enzyme,
represented here as two amino acid side chains.
One may be led to believe that the participation of the catalyst has to be via transient modifications (black and blue bonds).
This is indeed the case for the histidine which serves as a temporary proton acceptor, illustrated by the non-bond constraints to the hydrogen atoms.
However, the serine gives away a hydrogen atom to the triglyceride substrate only to be regenerated by a \emph{different} hydrogen atom coming from a water molecule.
This behavior is represented in the OG{} as non-transient modifications (red and green bonds).

Within the substrate overlay rule, we see the hydrogen atom of the serine being added, while the water hydrogen atom leaving to the serine is removed by the rule.
We illustrate those operations with the same color scheme as the one used for bonds in the OG{} in \hyperref[fig:substrate_rule]{Figure~\ref{fig:substrate_rule}}.
Although atoms are allowed to be added and removed, the catalytic component being regenerated guarantees that each substrate overlay rule is still mass invariant.

The atom exchange between the substrates and the catalytic components is not limited to hydrogen atoms.
For instance, a description of a formyl-CoA transferase reaction from \mcsaentry{155} in the M-CSA database,\cite{RibeiroHFTFT2017}, describes the aspartate 169 as being regenerated using a different oxygen atom than the original one.

One may further observe that the injections $c_1$ and $c_2$ are not necessarily unique if the educt or product mixtures contain several copies of the same molecule.
While the function of an substrate overlay rule is unaffected by the choice of the injections $c_1$ and $c_2$,
some choices lead to larger and unnecessarily complex rules, possibly obfuscating the chemical interpretation.
A \enquote{most condensed} substrate overlay rule can be obtained using the knowledge of the atom map to coordinate the choice of $c_1$ and $c_2$.

\section{Outlook}
We utilize graph transformation formalism to define reaction mechanisms with no space for ambiguity on the topological level.
We demonstrate how said formalism can be used to extend the concept of an ITS from simple reactions to reaction mechanisms, fully capturing the transient behaviour.
We demonstrate the utility of said generalization in two areas.
For interpretation and visualization in form of an OG{} and for proposal of reaction mechanisms, including reactions without know catalytic context, in the form of overlay rules.
The application potential, however, stretches much further.

The identification of a common patterns within the OG{}s of \ECnum{3}{1}{1}{} reactions suggests the possibility of using the OG{}s for an automated enzymatic reaction classification.
The identification of patterns within OG{}s does not stop at classification either, using a suitable recombination framework would allow one to design novel mechanisms within the OG{} formalism.
Last but not least, one should appreciate the notion of OG{}s being strictly rigorous, attributing a level of precision to the results and signifying abstraction potential.
\section{Results and Discussion}
\label{sec:results}

\subsection{Obtaining Overlay Graphs}
\label{sec:building_its}

To construct a sample set of OG{}s to study, we utilized the M-CSA database.\cite{RibeiroHFTFT2017}
The aim of this database is to provide a non-redundant overview of known enzymatic reaction mechanisms.
Similarly to our understanding of a reaction mechanism, the M-CSA specifies mechanisms as sequences of elementary reaction steps.
The reaction steps, however, do not explicitly encode the atom maps between the intermediates, products and the educt molecules.
To separate the two notions, we thus refer to the M-CSA notion of a mechanism as \emph{reaction sequence}.
As of the time of writing, the M-CSA database contains \num{888} reaction sequences.\cite{mcsa_api}

The reaction sequences of M-CSA are defined by means of electron pushing diagrams.
While such a formalism provides atom maps between the educt and the product molecules of individual reaction steps, the links between the products of a step and the educts of the subsequent step are missing.
Arguably, the graphical representation of the steps proposed by the M-CSA is sufficient to allow a human user to infer the atom maps.
Such intent, however, lacks any formal support and leaves bond rotations between steps a distinct possibility.
Additionally, the data behind the visualizations do not necessarily reflect the visual hints in a machine readable format, making any automated analysis laborious.

To ensure we correctly represented the intended mechanism, we considered all possible atom maps.
This resulted in \num{2802} mechanisms, and consequently, overlay rules, corresponding to a total of \num{600} reaction sequences from the M-CSA.
We observed that most of the reaction sequences (\num{435}) encode a unique mechanism, followed by the ones that only allowed two possibilities (\num{100}).
On the other hand, we found five reaction sequences that could be explained by over \num{100} different mechanisms, and one reaction sequence totaling \num{964} non-isomorphic overlay rules.

The ambiguity arises from symmetries present in the educt and product graphs.
Such symmetries are only significant for the overlay rule construction if they involve atoms with varied histories.
Consider the example in \hyperref[fig:symmetry]{Figure~\ref{fig:symmetry}},
illustrating how the atom map between two steps reflects in their composition.
The first step attaches a hydrogen to an amine group \ch{H2N}, while the second cleaves a hydrogen atom from the resulting \ch{H3N+} group.
All three hydrogen atoms of the \ch{H3N+} group are symmetrical, the letter rule can thus match any of them.
The hydrogen atoms that were part of the \ch{H2N} from the beginning have a different history than the hydrogen atom used to create the \ch{H3N+} group, resulting in two non-isomorphic mechanisms and in turn OG{}s.

\begin{figure}
	\centering
	\input{figs/symmetry.tex}
	\caption{The rule cleaving off a hydrogen atom can be mapped to any of the three hydrogen atoms of the \ch{H3N+} group. Depending on the match used by the mechanism, there are two different outcomes to the composition of the two rules, resulting in different overlay rules and OG{}s.}

	\label{fig:symmetry}
\end{figure}

The symmetries can generally be of two types.
Symmetries of the molecule itself, or a part of it, like the hydrogen atoms of the amine group in \hyperref[fig:symmetry]{Figure~\ref{fig:symmetry}}.
Or symmetries arising between multiple instances of the same molecule.
The latter is the case in the M-CSA \mcsaentry{38}, which includes up to four water molecules with different histories, contributing to the total of \num{964} overlay rules. 

Many of the symmetries deal with disjoint sets of atoms and are thus independent.
Hence, the number of possible non-isomorphic overlay rules grows exponentially with the number of symmetries.
Even a partial atom map, which fixes at least one of the atoms involved in such symmetries, can therefore reduce the number of OG{}s exponentially.
E.g., the M-CSA \mcsaentry{186} has \num{24} possible mechanisms.
However, mapping only four atoms, each in only one intermediate, is enough to identify a unique OG{}.

\subsection{Interpretation of OG{}s}
\label{sec:its_graph_interpretation}

OG{}s being directly interpretable is a major strength of the formalism.
While the causality information explicit in the reaction sequence is lost, OG{}s describe the entire reaction in a single picture, and anchor it within the educt molecules by means of the atom maps.
To illustrate, we took a closer look at OG{}s of the subclass of enzyme reactions classified by the Enzyme Commission (EC) number \ECnum{3}{1}{1}{}.
The example from \hyperref[fig:mech_example]{Figure~\ref{fig:mech_example}} also belongs to this class.
The subclass \ECnum{3}{1}{1}{} is well suited for our analysis as it provides a very topological description of the contained reactions, unlike many other EC classes.

In particular, hydrolase reactions (\ECnum{3}{}{}{}) identify water as one of the educt molecules, which is split into an alcohol group and a proton in the product molecules.
The second level, \ECnum{3}{1}{}{}, identifies an ester bond as the target for the hydrolase reaction to cleave.
Finally, the third level, \ECnum{3}{1}{1}{}, specifies the cleaved ester bond to be part of a carboxylic ester.
The carboxylic acyl group does not necessarily have to participate in the ester hydrolase reaction.
For all \num{24} reaction sequences we obtain for the \ECnum{3}{1}{1}{} classified entries in the M-CSA, however, we observe the carboxylic acyl group taking on the role of an electron sink.

The \ECnum{3}{1}{1}{} reaction sequences in the M-CSA database contain on average little ambiguity.
Only two reaction sequences allow for more than a single OG{} (two and five, respectively), for a total of \num{29} OG{}s.
The ambiguity of the reaction sequence in both cases spans from the symmetries of hydrogen atoms of an \ch{H2O+} group, respectively an \ch{H3N+} group,
similar to the example in \hyperref[fig:symmetry]{Figure~\ref{fig:symmetry}}.

The structural characteristics of the \ECnum{3}{1}{1}{} reactions directly translate into patterns in the OG{}s and lead to a high degree of similarity.
In particular, all obtained OG{}s share the same core, matching the substrate OG{} in \hyperref[fig:substrate_rule]{Figure~\ref{fig:substrate_rule}}.
The core pattern appears in two variations.
In \hyperref[fig:substrate_rule]{Figure~\ref{fig:substrate_rule}}, there are two hydrogen atoms traded with the catalyst.
Some M-CSA reaction sequences, however, only specify one hydrogen atom being transferred from the water molecule to the former ester oxygen without the catalyst acting as an intermediary.

The generated OG{}s contain a number of differences outside of the common core characteristic of the \ECnum{3}{1}{1}{} class.
These differences mostly pertain to the nature of the enzyme itself, in form of the active amino acids, as well as the exact nature of its involvement in the reaction.
To this end, we identified two axes of interest along which the OG{}s, and by extension also the reactions they represent, differ.

First, while the duty of the electron sink falls exclusively to the carboxylic acyl group, the role of the electron source remains open.
Most often, the latter role is taken on by the enzyme.
In particular, by means of a histidine, or an aspartate, or even a two histidines acting in concert.
However, we also observed OG{}s where the electron source was part of the substrate.
Interestingly, in both such cases, the electron source, an \ch{N} or \ch{O} atom, was not directly adjacent to the reaction center and was regenerated to its original configuration, mirroring the actions of the enzyme.
This points towards a more fine-grained definition of catalysis, in which not a whole molecule, but rather a functional part could be considered a catalyst.

The second difference spans from the necessity to lock the substrate in place by linking it to one of the amino acids by a covalent bond (described hereafter as docking).
Most often we observed the substrate carbon atom of the ester bond being bound to a serine, alternatively an aspartate or a threonine.
Four reaction sequences, however, completely omit such docking.

To illustrate, we depict an example for each combination of the above two factors in \hyperref[fig:311_comp]{Figure~\ref{fig:311_comp}}.
The example in the top left showcasing the most complex involvement of the enzyme, responsible for both providing the electron source and docking the substrate, is the most most prevalent one, present in \num{19} (\SI{66}{\percent}) of the \num{29} OG{}s.
Moreover, all the relevant OG{}s come from reaction sequences that described them uniquely, giving us \num{19} (\SI{79}{\percent}) out of all \num{24} reaction sequences which exhibited such behavior.

In opposition, the bottom right OG{} in \hyperref[fig:311_comp]{Figure~\ref{fig:311_comp}} showcases the least possible involvement of the enzyme, not providing an electron source nor being used for docking.
In fact, the role of the enzyme in the bottom right OG{} is fully passive,
limited to the creation of suitable physicochemical environment.
Only two OG{}s, derived from a single reaction sequence match this pattern.

\begin{figure}
	\centering
	\resizebox{\linewidth}{!}{%
		\input{figs/311_comparison.tex}%
	}
	\caption{
		Comparison of different patterns observed among the OG{}s representing the reactions classified as \ECnumsimple{3}{1}{1}{-}.
		On the left, an amino acid is used to dock the substrate during the reaction.
		No docking takes place on the right.
		At the top, the electron source is part of the enzyme.
		At the bottom the electron source is part of the substrate itself.%
	}
	\label{fig:311_comp}
\end{figure}

Our observations suggest that the enzyme function can be simplified in case part of the function can be outsourced to the substrate, or alternatively, made passive.

\subsection{Using Overlay Rules to Explain Reactions by a Known Mechanism}
\label{sec:matching_its_rules}

One of the benefits of the graph transformation formalism is the executability of the overlay rules and thus, implicitly, the mechanisms.
Taking advantage of this property, we took the overlay rules obtained for the M-CSA entries classified as \ECnum{3}{1}{1}{} and used them to propose reaction mechanisms---including catalytic components---as an explanation for other reactions, specified simply by the overall reaction description $(E, P)$.
To this end we extracted over \num{13000} overall reaction descriptions from the Rhea database, an expert curated database of biologically interesting reactions.\cite{LombardotMAAHNIXCRB2019}

The overall reaction descriptions in the Rhea database do not explicitly list the catalytic components.
We therefore used the substrate overlay rules and adopted the catalytic context of the original reactions.
As observed in the previous section, there is a high degree of similarity between the overlay rules for the reactions in \ECnum{3}{1}{1}{}.
Indeed, \num{18} overlay rules are isomorphic to each other on the substrate level, \hyperref[fig:substrate_rule]{Figure~\ref{fig:substrate_rule}} depicting one of them.
In total, there are only \num{11} substrate overlay rules unique up to isomorphism among the original \num{29}.

The similarity of the overlay rules does not stop at isomorphisms.
Three of the substrate overlay rules are a target of a monomorphism from another rule, effectively only refinements of the latter, having the same action but a larger invariant graph.
Such rules are guaranteed to only apply if the smaller rules apply as well, and produce the same result.
We therefore discarded such rules, while retaining all possible product mixtures.

A closer inspection further revealed that one reaction sequence cleaves a \ch{C-N} bond despite being marked as \ECnum{3}{1}{1}{} in the M-CSA.
Whether a case of misclassification or an oversight in the M-CSA database, we discarded the resulting substrate overlay rule to avoid introducing noise into our results.

Finally, we introduced a manual change to the \num{7} remaining substrate overlay rules.
The modification spans from a different convention for representation of carboxylic acid, one of the ester hydrolase products, between the M-CSA and Rhea.
While the M-CSA, and by extension our rules, use a \ch{COOH} group, Rhea uses exclusively \ch{COO-} and a free floating proton, \ch{H+}, for each reaction marked as \ECnum{3}{1}{1}{}.
The modified rules thus additionally cleave the \ch{O-H} bond of the carboxylic acid.
As the carboxylic acid \ch{O-H} bond comes from the water molecule, the modified rules have a necessarily bigger context, fully specifying the water molecule on the educt side.

Using the \num{14} substrate overlay rules, both the originals and the manual revision, we reproduced \num{588} different reactions from Rhea.
\num{97} (\SI{16.5}{\percent}) of the matches were indeed classified as \ECnum{3}{1}{1}{} within the Rhea database.
We thus retrieved \SI{74.6}{\percent} of the \num{130} \ECnum{3}{1}{1}{} reaction in Rhea, all using the modified rules.
We further found \num{30} (\SI{5.1}{\percent}) reactions classified in different EC classes and \num{461} (\SI{78.4}{\percent}) reactions which were assigned no EC class in Rhea.
These results are summarized in \hyperref[tab:rhea_ec]{Table~\ref{tab:rhea_ec}}.

A manual cursory inspection of a sample of the \num{461} reactions with no EC class in Rhea database found the reactions visually corresponding to carboxylic ester hydrolases.
The investigated reactions equipped with the relevant cross-link were indeed classified as \ECnum{3}{1}{1}{} in the UniProt database,\cite{UniProt2020} e.g. \href{https://www.rhea-db.org/rhea/17794}{Rhea:17794} or \href{https://www.rhea-db.org/rhea/32968}{Rhea:32968}.

The majority of the reactions classified differently than \ECnum{3}{1}{1}{} we explain are transferases that cleave one ester bond and create a new one using an alcohol group of the other educt molecule.
The alcohol group acting as a substitute for the educt water used in the hydrolases.
All these matches result from the original substrate overlay rules, as the water molecule is fully specified in the modified version.

\begin{table*}
	\centering

	\begin{tabular}{@{}lrl@{}}
		\toprule
		EC class           & Incidence & Description                                      \\
		\midrule
		None               & \num{461} &                                                  \\
		\ECnum{3}{1}{1}{}  &  \num{97} & Carboxylic ester hydrolases                    \\
		\ECnum{2}{3}{1}{}  &  \num{19} & Acyltransferases other than amino-acyl          \\
		\ECnum{3}{6}{1}{}  &   \num{3} & Phosphorus-containing acid anhydrate hydrolases \\
		\ECnum{2}{3}{2}{}  &   \num{2} & Aminoacyltransferases                           \\
		\ECnum{4}{2}{99}{} &   \num{2} & Other carbon-oxygen lyases                      \\
		\ECnum{5}{4}{1}{}  &   \num{2} & Intramolecular acyl transferases                \\
		\ECnum{2}{1}{3}{}  &   \num{1} & Carboxy-/carbomyltransferases                   \\
		\ECnum{3}{2}{1}{}  &   \num{1} & Glycosidases                                    \\
		\bottomrule
	\end{tabular}
	\caption{The EC classification of the reactions explained by our substrate overlay rules as declared in the Rhea database.}
	\label{tab:rhea_ec}
\end{table*}

Furthermore, there are \num{33} \ECnum{3}{1}{1}{} reactions our substrate overlay rules did not capture.
\num{14} (\SI{42.4}{\percent}) were due to encoding issues resulting from periodicity not reflected in the smiles strings or use of different levels of abstraction or tautomerisation between the educts and products in the Rhea database.
Further, \num{5} (\SI{15.2}{\percent}) reactions involved interactions with iron ions.
Direct metal ion interactions are currently not supported by our methods.

Finally, the remaining \num{14} (\SI{42.4}{\%}) contained extra modifications of the products of the carboxylic ester bond cleavage.
We detail the types of additional chemistry observed in \hyperref[tab:unmatched_rhea]{Table~\ref{tab:unmatched_rhea}}.

\begin{table}
	\centering

	\small

	\begin{tabular}{@{}lr@{}}
		\toprule
		Description & Incidence \\
		\midrule
		Keto-enol tautomerionesation & \num{5} \\
		Second carboxylic ester bond cleavage  & \num{3} \\
		Decarboxylation  & \num{3} \\
		Cyclisation & \num{2} \\
		Release of sulfite group & \num{1} \\
		\bottomrule
	\end{tabular}
	\caption{Types of additional modifications to the product molecules of the carboxylic ester bond cleavage observed in the Rhea database, with incidence.}
	\label{tab:unmatched_rhea}
\end{table}

We explored in greater detail the most prevalent modification, keto-enol tautomerisation.
M-CSA database contains two elementary reaction steps corresponding to keto-enol tauromerisation, step \num{4} in \mcsaentry{85} and step \num{4} in \mcsaentry{463}, both described as spontaneous tautomerisation occurring outside of the enzyme active site.
To this end, we enriched our rules by composing them with the steps corresponding to the spontaneous keto-enol tauromerisation.
The compositions were performed on the ester oxygen, which, instead of an alcohol group, ends up in a ketone group.

Using the composed rules, we were able to explain four of the five Rhea reactions, one eluding due to the keto-enol tautomerisation occurring twice, on the former ester oxygen as well as an alcohol group already present in the educt molecule.
The composed rules, however, failed to increase our coverage of the Rhea database outside of the four motivating \ECnum{3}{1}{1}{} reactions.
