Introduction to Structural Homology Algorithms

© Copyright 2011 Herbert J. Bernstein

Consider the problem of looking for the presence of a particular structural feature, say a nose of a certain shape, in some larger, more complex structure, say a face. (See http://en.wikipedia.org/wiki/Facial_recognition_system ). Similarly, consider the problem of looking for structural features in one protein that match features in another protein, so we may try to infer possible functions for the first protein. (See http://en.wikipedia.org/wiki/Structural_alignment). In each case we are trying to align one set of points in three dimensions with another set of points. We can abstract and discretize such problems as:

Assume you have a three dimensional set A of N points, each with an X, a Y and a Z coordinate, and another set B of M points, each with an X a Y and a Z coordinate. Design a program that will shift and rotate the set B to get the closest possible match between the points of B and the points of A.

This problem, called the structural homology problem or the structural alignment problem ( can be very difficult to solve, if we just go at it by brute force, especially if M is different from N. Our objective in this page is not to solve the problem, but to explore some of the algorithmic issues that arise.

The abstracted problem

Let is try to carefully specify the abstraction, idenfifying the inputs and the outputs. The abstraction we choose is to try to find the "best alignment$quot between two finite sets of points. More specifically, give two sets finite sets A, B ⊂ R3, find a translation T and rotation Θ, such that the points of ΘB + T are "as close as possible" to the points of A. Call the number of points in A, card(A), N and card(B). In addition to whatever other attributes a point, ai ∈ A may have it will have a vector of 3 real coordinates [X(ai), Y(ai), Z(ai)] and in addition to whatever other attributes a point, bi ∈ B may have it will have a vector of 3 real coordinates [X(bi), Y(bi), Z(bi)].

Assume M is smaller than N. One brute force solution is:

For large M, TK(M) is dominated by the time to compute the covariance matrix which is the product of a 3 x M matrix by an M x 3 matrix, consisting of 9 dot products of M-vectors, involving M-products and M-1 sums, and the time to compute the centroids, another O(M) process, so the overall cost of this brute-force approach is O(M N!/((N-M)!M!)).

One of the problems with the brute force approach is that we are repeatedly considering the full sets of 3-dimensional coordinates. Perhaps we can save some time if, instead of considering the coordinates themselves, we can consider some signatures of the two structures that are invariant under translation and rotation, so that, instead of having to look at all possible subsets that match in number, we could filter our search to only look at subsets that have matching signatures.

One commonly used signature is the distance matrix giving the distances among pairs of points (see en.wikipedia.org/wiki/Distance_matrix). This can be a very powerful technique for structural homology of polymers, such as proteins, because the ordering of the points is prescribed. (See en.wikipedia.org/wiki/Structural_alignment#DALI). Let us consider the more general, non polymeric problem.

The distance matrix for A requires O(N (N-1)/2) distance calculations. The distance matrix for B requires O(M (M-1)/2) distance calculations. We need to look for submatrices in A that match B. This would seem to have made our problem worse. Instead of having to look for subsets of M things in a set of N things, now we are looking for subsets of M (M-1)/2 things in a sets of N (N-1)/2 things, but, if the distance matrix of B is rare among the subsets of the distance matrix of A, this approach can greatly reduce the number of subsets to be examined in detail. If both are essentially uniform lattices on the same spacing, then the matching problem is actually worse, but the additional information of the distance matrix should allow us to recognize that fact early.

If the order is not prescribed by a polymeric structure, one important step to simplify this search is to impose an ordering, but there are many alternative approaches to imposing an ordering on a matrix. It is easier to impose an ordering on B and then to use that to order the matrix. The difficulty with that approach is that the ordering imposed on A may be different for whatever subsets match B. Therefore we consider an approach to ordering driven by the data -- taking the entries in the distance matrix as a spectrum of distances ordered by those disances for each starting point.

This, if there are, say three points forming a distance matrix, written as the full symmetric form, even though only the upper super-diagonal triangle is needed.


   |   0    2.8    1.4  |
   |   2.8   0     3.7  |
   |   1.4  3.7    0    |
Then the distance spectra for points 1, 2 and 3 would be [1.4, 2.8], [2.8, 3.7] and [1.4, 3.7]. The filter for candidate search match starting points would begin with an attempt to align the spectra of the points in B with the spectra of the points in A.

Matching spectra

The matching of spectra with dicrete peaks is similar to looking for particular sequences of characters scattered in a document. This problem differs from exact word matching, because other peaks may be distributed among the matching peaks. For the more resticted word matching problem, see http://en.wikipedia.org/wiki/String_searching_algorithm. We also need to allow for imprecise matches of similar, but not identical patterns of distances. Thus the problem is similar to the "reverse" spectral matching problems of mass-spectrometry and NMR (looking for a match to a probe spectrum in a larger sectrum from an unknown, see http://en.wikipedia.org/wiki/Mass_spectrometry_software). Because we only need to look at the portion of the larger spectrum the aligns with the smaller one (i.e. we don't need to look at smaller distances in the larger spectrum than the smallest distance in the smaller spectrum, not look at larger distances in the larger spectrum than the largest distance in the small spectrum, the cost of getting to this point is:

We can greatly speed up this filtering by making hash tables as we initially generate the spectra marking the presence of particular ranges of peaks. If we assign a bit to each range, then the only spectra from A that will need to be examined will be the ones with all the bits from the spectra of B.