## 2 Material and Methods  
### In a Nutshell  
The proposed approach performs a search for local structural motifs in a set of 3D structures of macromolecules. The basic ideas for this approach originate in [36], where we analyzed different possibilities to represent RNA structures as a reduced alphabet and the possibility of storing and querying that alphabet in suffix-based indices. The paper clearly shows that the proposed methodology of suite codes [32] is too narrow for a RNA search. To tackle this drawback we used the notion of n-grams. However, n-grams can be used more easily in hash tables than in the originally implemented suffix-based structures. Wewere also interested in how the sophisticated suite methodology compares to a simple \(\eta\)-\(\theta\) torsion angle discretization. A novel development that enhances the practical application is that LaJolla performs a final 3D superposition to remove statistical artifacts that have no real 3D significance. During the development, it turned out that the approach is not only useful for RNA structures but also for proteins using the respective transformers (for instance \(\phi\)-\(\psi\)). String representation of linear polymers  
This approach is based on the simple observation that macromolecular structures share a common property: They are made up of chains formed by molecular building blocks, and possess a linear molecular backbone with repeating units. This property allows for the application of abstractions that are able to translate these macromolecules into a one-dimensional (1D) linear representation (Figure 2). This in turn allows for the use of efficient algorithms deriving from the field of string matching and text mining [35]. A simple translation procedure from a 3D structure to a 1D string is to use the sequence of nucleic acids or amino acids. However, as already stated in the introduction, a high similarity in sequence does not imply that the structures are similar. To overcome this, the default procedure uses torsion angles between defined atoms. In the case of RNA structures, the translator maps the residues to \(\eta\)-\(\theta\) pseudotorsion angles (Definition 1). In case of proteins \(\phi\)-\(\psi\) torsion angles are used (Definition 2). **Definition 1**: _Given three consecutive nucleotides N1, N2, N3 of a nucleic acid chain. Let \(\eta\) be the torsion angle defined by atoms (\(N1_{C4^{\prime}}\), \(N2_{P}\)) and (\(N2_{C4^{\prime}}\), \(N3_{P}\)). Let \(\theta\) be the torsion angle defined by atoms (\(N2_{P}\), \(N2_{C4^{\prime}}\)) and (\(N3_{P}\), \(N3_{C4^{\prime}}\))._  
**Definition 2**: _Given three consecutive amino acids A1, A2, A3 of a polypeptide chain let \(\phi\) be the torsion angle defined by atoms (\(A1_{C},A2_{N}\)) and (\(A2_{CA}\), \(A2_{C}\)). Let \(\psi\) be the torsion angle defined by atoms (\(A2_{N},A2_{CA}\)) and (\(A2_{C}\), \(A3_{N}\))._  
Once a sequence of torsion angles is generated it can be translated into a sequence of characters using any function. In the case of proteins as well as for RNAs the main clusters of the dihedral angle plots are translated into distinct characters (see also Figure 1). Figure 2: An informal diagram showing the steps issued for the initial generation of the hash table used as index structure for the structural alignment. The result of that translation step is a string where single characters represent the torsion angles of the chain residues and therefore the macromolecule as a whole. Traditional string matching algorithms can subsequently be applied, enabling the user to index and to search for macromolecular structures. An n-gram based index structure for fast searches  
A hash table is a data structure that stores key - value pairs. A value can be a character, a string or an arbitrary object. The key is generated by a mathematical function (hashing function) that translates the value into the key. This key in turn allows us to retrieve the value from a hash table in an average run time of O(1) [37].