## 2 Results and Discussion
### Algorithm  
Rationale  
The core of the problem is to find a match of a query atom set \(A\) in a larger atom set \(B\), where \(A=\left\{a_{1},\ldots,a_{m}\right\}\) with each atom \(a_{i}=\left(\mathbf{x}_{i},s_{i}\right)\) given by its Cartesian co-ordinates \(\mathbf{x}_{i}\) and atom type \(s_{i}\), and analogously \(B=\left\{b_{1},\ldots,b_{n}\right\}\) with \(b_{j}=\left(\mathbf{y}_{j},t_{j}\right)\). In the language of graph theory, the distance matrix \(D_{A}\) of \(A\) defines a complete graph on \(A\) with nodes standing for atoms and being attributed by atom types \(s_{i}\) and edges standing for distances \(\left|\mathbf{x}_{i}-\mathbf{x}_{j}\right|\) between atoms. The distance matrix \(D_{B}\) defines a complete graph on \(B\) in an analogous way with nodes attributed by types \(t_{i}\) and edges by distances \(\left|\mathbf{y}_{i}-\mathbf{y}_{j}\right|\). In the following we use the terms \"atom\", \"node\", and \"vertex\" synonymously. To keep the presentation simple, we assume that all atoms are of the same type, i.e. \(s_{i}=t_{j}\,\forall i,j:i\in\left\{1,\ldots,m\right\},j\in\left\{1,\ldots,n\right\}\); the actual implementation of the algorithm does not have this restriction, as shown in the applications section. The essential assumption underlying EpitopeMatch is that the query epitope and its cognate optimal matches differ not too much, i.e. if \(a_{i}\) is matched with \(b_{k}\) and \(a_{j}\) with \(b_{l}\), then the distance difference \(d_{ijkl}=||\mathbf{x}_{i}-\mathbf{x}_{j}|-\left|\mathbf{y}_{k}-\mathbf{y}_{l} \right|||\) should be small. The assumption is justified by the purpose for which EpitopeMatch has been developed, namely to identify patterns that as a whole have similar physico-chemical properties. This similarity crucially relies on the similar geometric arrangement of the corresponding functional groups in the matched sets. The exploitation of the assumption has two consequences: firstly, most of the potentially existing matches are not taken into account because they are too different and thus the search space is drastically reduced, and, secondly, the RMSD values \(R\) between the corresponding sets of coordinates in optimal matches are small, typically up to a few A. The assumption is exploited in the following way. EpitopeMatch starts by identifying small and accurate (low \(d_{ijkl}\)) subgraph matches by explicitly considering only \(d_{ijkl}<\delta\) with a low threshold \(\delta\) of typically \(\delta\approx 0.1\) A. Then the algorithm iteratively increases \(\delta\) and extends previously found subgraph matches, and, if possible, joins them to larger subgraph matches. The iteration is stopped when \(\delta\) exceeds a preset limit, or when a full match with the query set \(A\) has been achieved. This central part of the algorithm - the finding of an optimal structural alignment with the query - is shown as pseudo-code in Algorithm 1 (see Appendix). After the iteration in Algorithm 1 with increasing \(\delta_{1}\), the best matching sets are optimally superimposed in Cartesian space and the respective \(R\) values are computed. Finally, if the algorithm scans a whole database of structures \(B_{i}\), it generates a Pareto-optimal set with respect to the objective dimensions RMSD \(R\) and number of matching pairs \(N_{p}\). The algorithm is organized in the five steps described below. Step 1: Finding seed matches with small distance tolerance  
We set the initial distance tolerance \(\delta_{1}\) to a small value that roughly corresponds to the accuracy of the experimental method used for determination of the macromolecular structure, e.g. \(\delta_{1}=\)0.1 A. As seeds of possible matches we try to identify pairs of atoms \(a_{i}\) and \(b_{k}\) from \(A\) and \(B\), respectively, for which there are at least \(\
u\) other atoms \(a_{j}\) and \(b_{l}\), respectively, with distances \(|\mathbf{x}_{i}-\mathbf{x}_{j}|\) and \(|\mathbf{y}_{k}-\mathbf{y}_{l}|\) differing by at most \(\delta_{1}\).