---
abstract: |
    Knowing a biomolecule’s structure is inherently linked to and a prerequisite for any detailed understanding of its function. Significant effort has gone into developing technologies for structural characterization. These technologies do not directly provide 3D structures; instead they typically yield noisy and erroneous distance information between specific entities such as atoms or residues, which have to be translated into consistent 3D models.

    Here we present an approach for this translation process based on maxent-stress optimization. Our new approach extends the original graph drawing method for the new application’s specifics by introducing additional constraints and confidence values as well as algorithmic components. Extensive experiments demonstrate that our approach infers structural models ([*i.e.,* ]{}sensible 3D coordinates for the molecule’s atoms) that correspond well to the distance information, can handle noisy and error-prone data, and is considerably faster than established tools. Our results promise to allow domain scientists nearly-interactive structural modeling based on distance constraints.\
    **Keywords:** Distance geometry, protein structure determination, 3D graph drawing, maxent-stress optimization
author:
- Michael Wegner
- Oskar Taubert
- Alexander Schug
- Henning Meyerhenke
bibliography:
- 'references.bib'
- 'references-Michael-orig.bib'
title: 'Maxent-stress Optimization of 3D Biomolecular Models'
---

Introduction
============

**Context.** Proteins are biomolecular machines that fulfill a large variety of tasks in living systems, be it as reaction catalysts, molecular sensors, immune responses, or driving muscular activity [@voet2010biochemistry]. Knowing a protein’s 3D structure is a requirement for any detailed understanding of its function, and functional or structural disorder can lead to disease. Structure resolution techniques have made strong progress in recent years: biomolecules that were inaccessible a decade ago can now be structurally resolved, as exemplified by the rapid growth of structural databases [@PDB2015]. The resolution techniques, however, do not directly provide structural information as 3D coordinates. Instead, [*e.g.,* ]{}X-ray crystallography yields a diffraction pattern which has to be translated into a structural model. Similarly, Nuclear Magnetic Resonance (NMR) techniques measure coupled atomic spins, which can be translated into pairwise distances between specific atoms. These distances are typically incomplete, [*i.e.,* ]{}not all spatially adjacent atom pairs are detected [@stothers2012carbon]. Also computational tools, such as co-evolutionary analysis of multiple-sequences alignments of protein [@schug2009; @uguzzoni2017; @ovchinnikov2017] or RNA families [@leonadis2015] can provide distance constraints between residues for biomolecular structure prediction. Conceptually, one can understand the information provided by these techniques as incomplete and erroneous parts of the complete distance matrix. **Motivation.** Our goal is to provide an efficient and effective method to compute a full structural 3D model from incomplete and/or noisy distances. For this task, physics-based approaches are computationally prohibitive. Molecular dynamics-based approaches require weeks on supercomputers [@lange2008] and stochastic global optimization techniques [@schug2003] still days on medium-sized clusters. To lower computational costs, one can use more coarse-grained force-fields [@rohl2004], yet the computations still require hours to days depending on the input size.

For interactive or nearly-interactive work, however, running times of a few seconds would be desirable. This would support a quick back-and-forth between, [*e.g.,* ]{}assigning NMR chemical shifts to determine pairwise atomic distances and follow-up structural modeling[@stothers2012carbon]. These structural models allow then, in turn, improved NMR shift assignment and a repetition of the loop until no further improvement can be found. One forgoes describing the detailed physics and finds a near-optimal solution which respects all distance constraints. Exemplary tools which solve this distance geometry problem are  [@more1999] and  [@martin2011]. Challenges for such tools are efficiency, solution quality, and support for variations of the original problem such as the ability to deal with noise, error, or distance intervals.

**Outline and Contribution.** In this paper we transfer a maxent-stress optimization approach from 2D graph drawing [@gansner2013] to computing a 3D model from (incomplete) distance information. We exploit the resemblance of the objective functions (see Section \[sec:prelim\]), and extend the basic model and algorithm shown in Section \[sub:maxent\] by specifics of the biological application. Our algorithmic adaptations and extensions, as well as details regarding their implementation, are presented in Section \[sec:algo-impl\].

Extensive experiments (see Section \[sec:experiments\]) reveal that our algorithm is significantly faster than other competitive algorithms; at the same time its solution quality is very often better than the results of the best competitor. In particular in our most realistic instances, we outperform our competitors (i) in terms of quality by providing more accurate structural models in (ii) consistently high agreement with reference models and requiring (iii) only about $5$-$10$% of the running time. This stays true even when provided with noisy input data. We further extend our algorithm to support a weighted problem variant that allows to specify how certain a distance interval is and obtain very promising experimental results for this setting as well. To our knowledge, our algorithm is the first to support this new variant.

Preliminaries {#sec:prelim}
=============

Problem Definition
------------------

We model a biomolecule as a graph $G = (V, E)$, where the set $V$ of $n$ vertices models the atoms and the set $E$ of $m$ edges their relations. Distance information is given separately for all pairs $\{u,v\} \in S \subseteq V \times V$ by a distance matrix $D \in \mathbb{R}_{\geq 0}^{n \times n}$. For this purpose $d_{vw}$ denotes the distance between vertices $v$ and $w$—or is set to `nil` if the distance is unknown (for pairs $\notin S$). We are interested in finding an embedding of $G$ into $\mathbb{R}^3$, [*i.e.,* ]{}3D coordinates for the vertices, that respects the distances for $S$. This problem is known as (3D) *distance geometry problem* (DGP). In line with previous work, we account for inexact distance information due to measurement errors by introducing an interval in which the actual distance is contained. This modified DGP is called *interval distance geometry problem* [@liberti2014survey]:

\[Interval Distance Geometry Problem (iDGP)\] Let a simple undirected graph $G = (V,E)$, a distance interval function $d = [l,u]$ with $d: E \rightarrow \mathbb{R}^2$, and an integer $k > 0$ be given. Then determine whether there is an embedding $x : V \rightarrow \mathbb{R}^k$ such that $$\label{eq:iDGP}
        \forall \{v,w\} \in E: l_{vw} \leq \lVert x_v - x_w \rVert \leq u_{vw},$$ where $l_{vw}$ and $u_{vw}$ are lower and upper bounds for the distance of the edge $\{v,w\}$.

Here and in the following, $k$ equals $3$. Then DGP is prefixed by an ’M’ for ’molecular’. Note that the (M)DGP is contained in the i(M)DGP by setting the lower and upper bound of each interval to be equal to the actual distance. Saxe [@saxe1980] showed that deciding whether a valid embedding exists (in the DGP sense) is strongly NP-complete for $k=1$ and strongly NP-hard for $k > 1$. Interestingly, the problem becomes solvable in polynomial time if all distances are given [@blumenthal1953dg; @crippen1988distance; @dong2002linear]. Since solving the decision problem (finding a valid embedding) is difficult and even not always possible, we continue by considering the embedding task as an optimization problem, to be solved by heuristics. As a measure of error, one could use the *largest distance mean error* (LDME) defined as: $$\label{eq:ldme}
 \textnormal{LDME}(x) = \sqrt{\frac{1}{|E|} \sum_{ \{v,w\} \in E} \max(l_{vw} - \lVert x_v - x_w \rVert, \lVert x_v - x_w \rVert - u_{vw} , 0)^2}.$$ An embedding $x$ that has an LDME value of $0$ is obviously a solution of the iDGP as each distance constraint is met. One could thus minimize the LDME of the embedding found.

To be closer to the actual biophysical application and real-world data, we actually use the *root mean square deviation* ([RMSD]{}) to *evaluate* our solutions. The [RMSD]{}compares the embedding against a reference structure: $$\label{eq:rmsd}
\textnormal{{RMSD\xspace}}(x, x') = \min \sqrt{\frac{1}{|V|} \sum_{v \in V} \lVert x_v - x'_v \rVert^2},$$ with $x_v$ and $x_v'$ being the coordinates of the embedding and the reference structure, respectively. The minimum value is over all possible spatial translations and rotations of both superimposed structures. [RMSD]{}values $<1.5$Å  approach the structure resolution limit of experimental wet-lab techniques (NMR and X-ray) [@voet2010biochemistry]. While error functions that test the capability of the algorithm to match the constraints can be useful from an optimization point of view, a good value does not necessarily mean that the embedding reproduces the molecular structure. In particular, the algorithm must be able to handle noisy and erroneous data. In the end, the structure must also be physically meaningful. The [RMSD]{}addresses this challenge and is a standard measure of (dis)similarity in structural molecular biology by directly assessing the usefulness in a real-life scenario[@voet2010biochemistry]. We will therefore rely on the [RMSD]{}to compare algorithms.

Related Work {#sub:rel-work}
------------

There exist many algorithms for solving the MDGP optimization problem. Yet, for most algorithms the required running time is either very high or the solution quality is in the meantime rather low. Also, some algorithms currently do not support iMDGP—which limits their use in a real-world scenario. Due to space constraints the description of related work focuses on two tools, and , which we use in our experimental comparison as they are publicly available and established in the distance geometry research community – cf. a book on distance geometry edited by Mucherino [*et al.*]{} [@mucherino2012distance] and an even more recent survey by the same authors [@liberti2014survey]. Mentioned running times (in seconds) are based on experimental data in previous works and are thus not necessarily completely comparable. For a broader overview we refer to the aforementioned book and survey.

Liberti [*et al.*]{} [@liberti2014survey] found in their survey from 2014 that general-purpose global optimization solvers like Octave’s *fsolve* or spatial branch-and-bound techniques are not able to solve the problem for more than 10 vertices in a reasonable amount of time. One reason is that the objective function has a large number of local minima.

Moré and Wu [@more1997] implemented an algorithm called [^1] that transforms the objective function gradually into a smoother function that approximates the original function and has fewer local minima. The algorithm builds a hierarchy of increasingly smooth functions by iteratively applying a transformation. In a next step, employs Newton’s method as a local optimization on the smoothest function and then traces this solution back to the original objective function, applying a local optimization on each level. Liberti [*et al.*]{}state that the algorithm “has several advantages: it is efficient, effective for small-to-medium-sized instances, and, more importantly, can be naturally extended to solve iMDGP instances” [@liberti2014survey p. 23]. On the downside, on large-scale instances the solution quality decreases (while the running time remains reasonable). An et al. [@an2003large; @an2003solving] use a different continuation approach which improves the solution quality compared to . In their experiments the running time of their algorithm for proteins larger than atoms lies between and s. The double variable neighborhood search with smoothing (DVS) algorithm by Liberti et al. [@liberti2009double] combines the ideas of and variable neighborhood search into one algorithm. In their comparison to the quality of DVS was significantly better, but the running time two orders of magnitude slower already for small inputs.

Biswas [*et al.*]{} [@biswas2008distributed] proposed the DAFGL algorithm that decomposes the graph into clusters by running the symmetric reverse Cuthill-McKee algorithm on the distance matrix. The subproblems are solved with a semidefinite programming (SDP) formulation. DAFGL is capable of solving the iMDGP. While its solution quality are mostly reasonable, one has to consider that as much as 70% of distances smaller than 6  were provided with added noise. Also, larger instances increase the running time rapidly. The two largest molecules (PDB: 1toa and 1mqq, see Table \[tab:proteins\]) took already s and s with only modest to poor solution quality ([RMSD]{}: $3.2$Å and $9.8$Å) to solve, even though the algorithm makes use of a distributed SDP solver. Leung and Toh [@leung2009sdp] proposed the [^2] algorithm that is an advancement to the DAFGL algorithm by Biswas [*et al.*]{} [@biswas2008distributed]. If the problem is small enough, solves the problem with an SDP approach and refines the obtained solution with regularized gradient descent. Otherwise, splits the graph into two subgraphs and solves the problem recursively. uses the symmetric reverse Cuthill-McKee algorithm to cluster the vertices initially. In a second step tries to minimize the edge cut between different subgraphs by placing a vertex $v$ into the subgraph where most of its neighbors are placed. The algorithm puts some vertices in both subgraphs (overlapping atoms) to later stitch the two embedded subgraphs together. Its authors tested also in the iMDGP setting ([*i.e.,* ]{}supports inexact distances). The results indicate that is able to compute the structure of proteins with very sparse distance data and high noise in s for a protein having atoms. Fang and Toh [@fang2013using] presented some enhancements to for the iMDGP setting by incorporating knowledge about molecule conformations to improve the robustness of . Their experiments show that their changes indeed lead to better solutions (about 50–70%) with the cost of increased running times (also about 50–70%).

MaxEnt-Stress Optimization {#sub:maxent}
--------------------------

We aim at developing an algorithm for iMDGP (and its extension wiMDGP, see Section \[sub:algo-wiMDGP\]) with a significantly lower running time than previous algorithms and with solutions of good quality. Our main idea is to use an objective function proposed by Gansner [*et al.*]{} [@gansner2013] for planar graph drawing, called maxent-stress (short for *maximal entropy stress*). As the name suggests, it is composed of two parts, a stress part that penalizes deviations from the prescribed distances (with a quadratic penalty, possibly weighted) and an entropy part that penalizes vertices for getting too close to each other (atoms cannot overlap):

$$\label{eq:maxent-stress}
    \min_x \sum_{vw \in S} \omega_{vw} (\lVert x_v - x_w \rVert - d_{vw})^2 \; - \alpha H(x),$$

where $H(x) = -\operatorname{sgn}(q) \sum_{vw \notin S} \lVert x_v - x_w \rVert ^{-q}, q > -2$, is the entropy term, $\omega_{vw}$ a weighting factor for edge $\{v,w\}$, $\alpha \geq 0$ a user-defined control parameter, and $\operatorname{sgn}(q)$ the signum function with the special case that $sgn(0) = 1$.

To minimize function (\[eq:maxent-stress\]), Gansner [*et al.*]{} [@gansner2013] derive a solution from successively solving Laplacian linear systems of the form $Lx=b$ for $x$. A noteworthy feature of this successive iteration towards a local minimum is that the solution of the current iteration depends on the solution of the previous iteration, since the current right-hand side is computed from the solution in the previous iteration. Note that the computation of distances between vertex pairs not in $S$ is not required for function (\[eq:maxent-stress\]). Instead, vertex pairs not in $S$ are related to each other via the entropy term, which enters the right-hand side, too. If the parameter $q$ is set to be smaller than zero, the entropy term of vertex $u$ acts as a sum of attractive forces on $u$. Conversely, the term acts as a sum of repulsive forces if $q$ is larger than zero. The Gansner [*et al.*]{}algorithm typically needs several iterations to converge. In this process the entropy weighting factor $\alpha$ has a strong influence in the maxent-stress model: a high value will cause the vertices to expand into space indefinitely while a low value will cause no entropy influence. The maxent-stress algorithm therefore starts with $\alpha = 1$ and gradually reduces this value to $\alpha = 0.008$ with a rate of $0.3$. For each value of $\alpha$, a maximum of 50 linear system solves are performed and Gansner [*et al.*]{}set $q$ to $0$ except when the graph has more than 30% degree-1 vertices (then $q \gets 0.8$). Note that in this entropy context they assume $\Vert x \Vert^0 = \ln \Vert x \Vert$. If the relative difference $\lVert x' - x \rVert / \lVert x \rVert$ between two successive solutions $x$ and $x'$ is below $0.001$, the algorithm is terminated.

More implementation details ([*e.g.,* ]{}the approximation of the entropy term in case of $|S| \in {\mathcal{O}(n)}$) can be found in Section \[sec:impl\].

New Algorithm and its Implementation {#sec:algo-impl}
====================================

Now we describe the adaptations made to the generic maxent-stress algorithm in order to deal with iMDGP and an extension called wiMDGP. For more technical details we refer the interested reader to our code[^3].

Adapting the Maxent-stress Algorithm for iMDGP
----------------------------------------------

Recall that for iMDGP we are given a graph $G = (V, E)$ and the distance intervals $d = [l,u] : E \rightarrow \mathbb{R}_{\geq 0}^2$. We then want to find an embedding $x: V \rightarrow \mathbb{R}^3$ that respects the intervals as well as possible. Note that, in line with previous work, we assume the set $S$ of known distances to be equal to $E$ here. We also assume the edges in $E$ to be unweighted.

As Gansner [*et al.*]{}’s maxent-stress algorithm [@gansner2013] cannot cope with intervals, we solve the iMDGP by first running our implementation of the maxent-stress algorithm with an adapted distance $d' : E \rightarrow \mathbb{R}$ that is defined by $d'_{vw} \coloneqq (l_{vw} + u_{vw}) / 2$. One might expect that, in the resulting embedding, the distances should be roughly in the middle of their interval. This would already be a valid solution to the iMDGP. However, our preliminary experiments show that the output of the maxent-stress algorithm still violates distance constraints even on smaller graphs if called this way. We therefore apply local optimizations to the layout computed by the maxent-stress algorithm. One optimization is based on simulated annealing, while the other is a simple local optimization algorithm.

#### Optimization of the Embedding with Simulated Annealing. {#optimization-of-the-embedding-with-simulated-annealing. .unnumbered}

Simulated annealing (SA) is a well-known metaheuristic that can escape local optima by probabilistically (based on a temperature parameter) accepting neighbor solutions that are worse than the current one, see [*e.g.*]{}Talbi [@Talbi:2009:MDI:1718024].

Our SA algorithm is sketched as Algorithm \[alg:sa\_optimizer\] in Appendix \[sub:sa-alg\]. The SA metaheuristic is often especially powerful if the initial solution is randomly chosen and can then jump between local minima. In our setting we receive an embedding from the maxent-stress algorithm as input; its global structure should be already quite good and only some of the given distances are not in their desired intervals. Therefore, our SA algorithm is only used to overcome rather narrow local minima instead of jumping to a completely different solution.

The constants in Algorithm \[alg:sa\_optimizer\] have been manually chosen in informal experiments. The outermost loop breaks after a certain number of unsuccessful improvement attempts or if the temperature is really low. The second loop iterates until an equilibrium [w. r. t. ]{}the current temperature is reached—here controlled by the number of iterations and modifications. As we do not want to get completely different solutions for reasons mentioned above, we choose a low start temperature and decrease it rather quickly.

Within the innermost loop a new neighbor solution is computed. In fact, we use parallelism here to reduce the running time of the algorithm. While this can lead to some data races if the position of a vertex is altered by more than one thread, we did not experience any significant decrease in quality. The number of total iterations, steps with no improvement and the number of modifications are all chosen rather small to keep the running time low.

The main ingredients of the innermost loop are (i) the local error criterion, (ii) the local optimizer that computes a neighbor solution, and (iii) the acceptance function.

We define $\text{error}_{vw}(x)$ as $\text{error}_{vw}(x) \coloneqq \max \{ l_{vw} - \lVert x_v - x_w \rVert, \lVert x_v - x_w \rVert - u_{vw} , 0\}^2.
$ and the local error of an edge $\{v,w\}$ as: $$\text{localError}(\{v,w\}, x) \coloneqq \text{error}_{vw}(x) + \sum_{\mathclap{u \in N(v) \setminus \{w\}}} \text{error}_{vw}(x) + \sum_{\mathclap{u \in N(w) \setminus \{v\}}} \text{error}_{uw}(x),$$ where $N(v)$ denotes the neighborhood ([*i.e.*]{}the set of incident vertices) of $v$.

In each iteration a new neighbor solution is computed for an edge $\{v,w\}$. To this end, we apply a force-based approach that takes the edge lengths to their neighbors and the edge length of $\{v,w\}$ into account. The idea is to model the local system similarly to the spring embedder model [@eades1984] and the force-directed algorithm by Fruchterman and Reingold [@fruchterman1991]. The difference to those algorithms is that we have to deal with an interval for the length of an edge. In our local force optimization step, we only change the positions of $v$ and $w$ while keeping adjacent vertices fixed.

We say an edge $\{v,w\}$ is *violating* its distance constraint if the error$_{vw}(x)$ is larger than $10^{-9}$ (and not exactly 0 due to numerical reasons). In our spring model only the violating edges account for a repulsive or attractive force, while the other edges do not take part in the force calculation. In our model each spring has its equilibrium state in an interval that corresponds to the interval of the respective edge it models.

For an optimization on edge $\{v,w\}$, the forces acting on $v$ and $w$ are a combination of attractive and repulsive forces: $f(v) \coloneqq f_{rep}(v) + f_{attr}(v)$ and $f(w) \coloneqq f_{rep}(w) + f_{attr}(w)$. The repulsive and attractive forces for a vertex $v$ are defined as $f_{rep}(v) \coloneqq \sum_{w \in N_{rep}(v)} (x_v - x_w) \cdot \frac{l_{wv}^2}{\lVert x_w - x_v \rVert^2}$ and $f_{attr}(v) \coloneqq \sum_{w \in N_{attr}(v)} (x_w - x_v) \cdot \frac{u_{wv}^2}{\lVert x_w - x_v \rVert^2},$ where $N_{rep}(v) \subseteq N(v)$ is the set of neighbors of $v$ that are too close to $v$ ([*i.e.,* ]{}the edge is shorter than its lower bound) and $N_{attr}(v) \subseteq N(v)$ is the set of neighbors of $v$ that are too far away ([*i.e.,* ]{}the edge is longer than its upper bound).

Finally, the acceptance function always accepts improving changes. Error-increasing changes are probabilistically accepted according to the Boltzmann distribution based on the local error (as in many cases [@Talbi:2009:MDI:1718024]).

#### A Simple Local Optimization Algorithm. {#a-simple-local-optimization-algorithm. .unnumbered}

In addition to our SA optimization algorithm, we propose another simple local optimization algorithm. During one iteration the algorithm sorts the edges by their error ([*i.e.,* ]{}the deviation from the edge’s given distance interval) in descending order. For an edge $\{v,w\}$ having a length that is not in the given distance interval, the algorithm either prolongates or shortens the edge length such that it is exactly as long as the upper or lower bound given by the distance interval, respectively. We only accept the change if we reduce the local edge error. If we change the length of an edge $\{v,w\}$, we lock the other incident edges of $v$ and $w$ for the remainder of the current iteration to prevent an oscillating effect. We perform a maximum of iterations or less if there is no improvement between two successive iterations. Pseudocode of the method is shown as Algorithm \[alg:simple-local\] in Appendix \[sub:simple-local\].

Intervals with Confidence Values: wiMDGP {#sub:algo-wiMDGP}
----------------------------------------

Some distances can be measured more accurately than others in common biomolecular experimental methods. To account for this, we add a confidence to each interval. Such a confidence states how certain it is that the actual distance is contained in this interval, leading us to the following problem definition:

\[Weighted Interval Distance Geometry (Optimization) Problem (wiDGP)\] Let a simple undirected graph $G = (V,E)$, a distance interval function $d = [l,u]$, a confidence function $p: E \rightarrow \mathbb{R}$, and an integer $k > 0$ be given. Then minimize the following function: $$\label{eq:icDGOP}
        \sum_{\{v,w\} \in E} \omega_{vw} \cdot \text{error}_{\{v, w\}}(x),$$ where the weight $\omega_{vw}$ depends on the edge’s confidence value $c_{vw}$.

In order to support wiMDGP, we adapt the maxent-stress algorithm as well as the other two optimization algorithms. For wiMDGP we can use the weights $\omega_{vw}$ from Eq. (\[eq:maxent-stress\]), the maxent-stress optimization problem, as a penalty that increases the error of an edge if the confidence that the distance lies in the interval is high. After some manual parameter tuning, we have chosen the following function to define the weighting factors: $\omega_{vw} \coloneqq 1 + 5\exp^{-5 (1 - c_{vw})},$ where $c_{vw}$ denotes the confidence for edge $\{v,w\}$. This way, the weight of an edge is roughly in the interval $[1, 6]$ and increases rapidly between A confidence between $0$ and $0.6$ only tells us that we cannot be very certain about the distance and thus, the error term should not vary too much. For higher confidence values, we can be quite certain that the distance interval is correct, so we need to penalize the errors of such edges significantly higher. Choosing a larger interval for the weights turned out not to be beneficial in terms of solution quality in preliminary experiments.

Both our SA and simple local optimization algorithm use an adapted error function for an edge that includes the weighting function above. In our simple local optimizer, we additionally change the sorting of the edges such that edges with higher confidence are considered first. Confidence ties are broken by choosing the edge with larger error first.

Implementation Details {#sec:impl}
----------------------

##### Initial layout. {#initial-layout. .unnumbered}

For computing the initial layout, we implemented three algorithms. In addition to PivotMDS [@brandes], which was used by Gansner [*et al.*]{} [@gansner2013], these are two random vertex placement algorithms. The first one is a very simple method and places the coordinates randomly in a $k$-dimensional hypercube with predefined side length. The second one does include some of the distance information provided by the input. Given an edge $\{v,w\}$ and the coordinates of vertex $v$, we place $w$ at the boundary of a $k$-dimensional hypersphere with radius $d_{vw}$ and centered at $v$. The algorithm needs a start vertex with given coordinates, as neighbors will be placed around it. We choose the vertex with maximum degree in the graph; this way, the highest number of neighbors is placed in random directions around the start vertex, which should lead to better spatial spread.

Finally, PivotMDS is an approximation algorithm for multidimensional scaling that is based on sampling; for a detailed description the reader is referred to Brandes and Pich [@brandes].

Preliminary experiments indicated that PivotMDS and the random hypersphere approach fare similarly well. Since PivotMDS turned out to be more robust in terms of solution quality when applied to protein instances, we use it in all the following experiments. Its slower speed is more than outweighed by the more expensive maxent-stress algorithm.

##### Approximating the entropy term. {#approximating-the-entropy-term. .unnumbered}

The entropy term in Eq. (\[eq:maxent-stress\]) iterates over all elements not in $S$. As the set $S$ is usually sparse, this computation would thus require quadratic running time. Thus, it is important to approximate the distances required for the entropy calculations. We implemented both the well-known Barnes-Hut approximation (also used by Gansner [*et al.*]{}) as well as well-separated pair decomposition (WSPD) [@callahan1995].

Additionally, we evaluate the entropy lazily: instead of computing the entropy term in each iteration, we recompute it only when the function $\lfloor 5 \log i\rfloor$ changes, where $i$ is the iteration number. We expect the entropy term to significantly change more frequently at the beginning of a new iteration; thus, we use a function that causes the algorithm to recompute the entropy more often at lower iteration numbers. Lipp [*et al.*]{} [@lipp2015] use the same function for reducing the running time of their WSPD algorithm. This “lazy” computation of the entropy term significantly reduces the running time while the quality does not deteriorate much.

##### Solving the Laplacian linear systems. {#solving-the-laplacian-linear-systems. .unnumbered}

Recall that Gansner [*et al.*]{}derived an iteration of subsequent Laplacian linear systems for optimizing maxent-stress. They use the conjugate gradient method (CG) as a Laplacian solver in their implementation. The conjugate gradient method has superlinear time complexity. That is why we use lean algebraic multigrid (LAMG) instead, a fast solver proposed by Livne and Brandt [@livne2012] with linear empirical running time. We use our C++ implementation of LAMG; it is available in NetworKit and has been used for other Laplacian graph problems before [@DBLP:conf/siamcsc/BergaminiWLM16]. An alternative multilevel approach for solving the linear systems exists [@meyerhenke2015], but is harder to adapt to the present scenario.

##### Optimization Workflow. {#optimization-workflow. .unnumbered}

We combine our two optimization algorithms into one workflow: the solution found by the SA algorithm can often be further improved by a subsequent run of our simple local optimization algorithm. Sometimes it happens that the SA algorithm only finds a slightly worse solution compared to the maxent-stress algorithm. In this case we ignore the SA solution and only run the simple optimization algorithm.

Experiments {#sec:experiments}
===========

In this section we present a representative subset of our experiments and their results. To this end, we implemented our algorithm in C++ based on NetworKit [@staudtSM14], an open-source toolkit for graph algorithms and in particular interactive large-scale network analysis. We call our algorithm (for **M**axent-stress **O**ptimization of **Bi**omolecular models) and compare it with  [@more1997] (C/Fortran code) and  [@leung2009sdp] (compiled Matlab code), two of the very few publicly available established tools that can handle inexact inputs with intervals.

All experiments are done on a machine that has 256 GB of main memory and 2 sockets, each equipped with an 8-core Intel Xeon CPU E5-2680 clocked at 2.7 GHz (hyperthreading enabled). We compile our code with g++ version 4.8.1 and OpenMP 3.1. The MATLAB version installed on the system is MATLAB R2015a (8.5.0.197613) 64-bit.

Instances {#sub:exp-settings}
---------

To test the accuracy and efficiency of our approach in a real-world setting, we work on 10 proteins of different sizes [@berman2000] taken from the protein data bank (PDB) [@PDB2015], see Table \[tab:proteins\]. These proteins range from small globular proteins with 50 amino acids to large proteins with about 700 amino acids. We only consider *ATOM* entries in the file, which provide atomic coordinates. Also, we only work on the first chain in the case of multiple protein chains. Based on the coordinates of a protein, we can construct an instance for the various distance geometry problems. For each experiment we actually create three instances per protein ([*i.e.,* ]{}different contact distance information) to eliminate effects of particularly good/bad sets of input data. Also, each instance ([*i.e.,* ]{}same contact distance information) is re-run three times to eliminate stochasticity effects. The displayed data per protein are averaged over these three instances and three respective runs.

    Protein   \# atom/ vertices   \# residues   bond edges   contact edges
  --------- ------------------- ------------- ------------ ---------------
       1ptq                 402            50          412            3987
       1lfb                 641            78          654            6320
       1gpv                 735            87          696            7208
       1f39                 767           101          788            7621
       1ax8                1003           130         1016           10527
       1rgs                2015           264         2053           20731
       1toa                2138           277         2181           23168
       1kdh                2846           356         2904           30655
       1bpm                3671           481         3744           41027
       1mqq                5510           675         5665           62396

  : Proteins for distance geometry benchmarks and their basic properties [@berman2000]. Listed are the protein data bank (PDB) code [@PDB2015], and the size in atoms (vertices), amino acid residues, the number of edges equivalent to covalent bonds (= bonds edges) and the number of edges with atoms closer to each other than 5Å without being a covalent bond (= contact edges). []{data-label="tab:proteins"}

We use a percentage $p$ of all atom distances $\{v,w\} \in \binom{V}{2}$ for which $d_{vw} = \lVert x_v - x_w \rVert$ is below a cut-off distance of 5 Å, where $x$ denotes the coordinates from the protein file. We use 5 Å because this approximates the distance that can be determined by NMR experiments [@wuthrich1990; @stothers2012carbon] and since it is a typical cutoff in determining so-called contact maps ([*i.e.*]{}binary matrices that store only adjacencies whose length is below the cutoff) [@schug2010; @noel2013]. To construct an instance for iMDGP, we introduce the interval $[d_{vw} - \underline{\epsilon}, d_{vw} + \overline{\epsilon}]$, where $\underline{\epsilon}, \overline{\epsilon} = d_{vw} \cdot \mathcal{N}(0, \sigma^2)$ and $\sigma$ is the standard deviation. We denote instances created this way as instances.

In contrast, the more closely reflects standard NMR experiments by taking protein biochemistry into account. As all covalent bonds of a protein are known, instances can be assumed to have full knowledge of exact distances for these bonds: Chemically, the length of covalent bonds fluctuates very little, hence the interval for these bonds edges $\{v,w\}$ consists of a single distance $[d_{vw}, d_{vw}]$. In addition to the distance information of the bonds, we add more distances the same way as for constructing a instance.

Results & Discussion {#sub:exp-results}
--------------------

To quantify the structure determination quality of the different approaches, we compare them by [RMSD]{}. For the test instances, we observe low [RMSD]{}for and , while performs significantly worse (cf. Tables \[tab:t50\_0.1\] and \[tab:t30\_0.1\] as well as Table \[tab:t70\_0.1\] in Appendix \[sub:add-exp\]). As expected, the [RMSD]{}gets higher if less distance information is provided (the instances in Tables \[tab:t50\_0.1\] and \[tab:t30\_0.1\] provide only 50% and 30% of the contact edges, respectively, while the instances in Table \[tab:t70\_0.1\] provide 70%). The [RMSD]{}values do not increase, as one might expect *a priori*, necessarily with instance size (number of atoms/ vertices). Instead, these instances have more edges, which might make the embedding computationally more demanding but also of good quality. Indeed, and yield good embeddings regardless of system size. performs worse for larger systems. Also, is more consistent than and performs best in nearly all instances, in particular for those with less information (cf. instances 1gpv and 1rgs in Table \[tab:t30\_0.1\]). Similarly, the running times of are about an order of magnitude faster than and , with being slightly faster than . There is an overall trend of increased running times with system size, but some instances seem particular hard to compute ([*e.g.*]{}instances 1gpv, 1rgs, and 1toa in Table \[tab:t30\_0.1\]). Gaussian noise on the intervals does not significantly alter the results: given a relatively high amount of distance information, and produce embeddings of very high quality with [RMSD]{}$< 1$Å (see Tables \[tab:t70\_0.1\], \[tab:t70\_0.01\] and \[tab:t70\_0.001\] in Appendix \[sub:add-exp\]). It should be noted, though, that in Table \[tab:t70\_0.01\] yields the majority of best results in terms of solution quality—but is usually not far behind.

For the instances, we display the results only for (and show the same respective trends as above) as a heatmap in Figure \[heatmap\_bonds\]. For very low amounts of additional distance information (1-2%) in addition to the bonds, is unable to provide high-quality embeddings as displayed by [RMSD]{}values $> 5$Å. When provided as little as 8-12% distance information in addition to the bonds, the structure determination quality becomes below $3$Å [RMSD]{}, [*i.e.,* ]{}it approaches the wet-lab resolution. Interestingly, the amount of Gaussian noise does not strongly influence the embedding quality. Exemplary structure embeddings are displayed in Figures \[1mqq\] and \[1ptq\] in Appendix \[sub:add-exp\]. While the overall quality appears good here as well, one can see that most structural errors are found at the surface, where fewer edges are available.

The experimental results for are shown in Table \[tab:wiMDGP-t50\] in Appendix \[sec:add-exp-wiMDGP\]. As these instances cannot be directly compared against other cases, we merely report that produces high quality solutions, typically with [RMSD]{}$<1.0$Å  and comparable running times to the other instances with . To truly assess the use of this implementation on real-world data, one would have to work on curated wet-lab experimental data [@wuthrich1990; @voet2010biochemistry] or co-evolutionary signals [@schug2009]. This is clearly outside the scope of this paper.

Overall, in particular for limited and noisy distance information, provides consistently embeddings with higher quality and does so at significantly lower running times than both and . On average (geometric means over quotients for each of the Tables \[tab:t50\_0.1\] to \[tab:t70\_0.001\]), is between x and x faster than . At the same time its RMSD values are on average % to % better—except for Table \[tab:t70\_0.01\], where is % better. is not competitive in terms of solution quality and also x to x slower.

For instances and very high amounts of distance information, the embeddings provide [RMSD]{}$<1$Å, which is below the typical resolution of NMR or X-ray [@voet2010biochemistry]; even providing only $p=30\%$ leads to high quality embeddings. Both and perform considerably better than older algorithms such as[@biswas2008distributed], where some [RMSD]{}$>5$Å were reported. In the more realistic scenario of instances with all bond edges provided, only few contact edges (8-12%) can already lead to high quality embeddings with . Thus, we are confident that our algorithm will lead to improved interpretation of wet-lab experiments in particular in cases with sparse data, such as sparse NMR experiments.

  --------- ------ -- ------ ------ -- --
                                       
  Protein                              
  1ptq                  ****   ****    
  1lfb        ****             ****    
  1gpv        ****             ****    
  1f39        ****             ****    
  1ax8        ****             ****    
  1rgs        ****             ****    
  1kdh        ****             ****    
  1toa        ****             ****    
  1bpm        ****             ****    
  1mqq        ****             ****    
  --------- ------ -- ------ ------ -- --

  : Performance results on $50\%$ $\sigma=0.1$ instances. Best results in bold font.[]{data-label="tab:t50_0.1"}

  --------- ------ -- -- ------ -- --
                                   
  Protein                          
  1ptq        ****         ****    
  1lfb        ****         ****    
  1gpv        ****         ****    
  1f39        ****         ****    
  1ax8        ****         ****    
  1rgs        ****         ****    
  1toa        ****         ****    
  1kdh        ****         ****    
  1bpm        ****         ****    
  1mqq        ****         ****    
  --------- ------ -- -- ------ -- --

  : Performance results on $30\%$ $\sigma=0.1$ instances. Best results in bold font.[]{data-label="tab:t30_0.1"}

![Quality results for bonds-iDGP instances. The horizontal axis shows the amount of contact edges in addition to bond edges provided, the vertical axis varies the $\sigma$ of Gaussian noise.[]{data-label="heatmap_bonds"}](1ptq-eps-converted-to){width="\textwidth"}

![Quality results for bonds-iDGP instances. The horizontal axis shows the amount of contact edges in addition to bond edges provided, the vertical axis varies the $\sigma$ of Gaussian noise.[]{data-label="heatmap_bonds"}](1f39-eps-converted-to){width="\textwidth"}

![Quality results for bonds-iDGP instances. The horizontal axis shows the amount of contact edges in addition to bond edges provided, the vertical axis varies the $\sigma$ of Gaussian noise.[]{data-label="heatmap_bonds"}](1bpm-eps-converted-to){width="\textwidth"}

![Quality results for bonds-iDGP instances. The horizontal axis shows the amount of contact edges in addition to bond edges provided, the vertical axis varies the $\sigma$ of Gaussian noise.[]{data-label="heatmap_bonds"}](1mqq-eps-converted-to){width="\textwidth"}

Conclusions {#sec:concl}
===========

This paper provides a significant step towards nearly-interactive protein structure determination. To this end, we implemented the maxent-stress algorithm [@gansner2013] and incorporated first of all a faster Laplacian solver. Based on this implementation we extended the graph drawing algorithm to handle distance geometry problems where the distances are either exact or come in the form of intervals, optionally with some confidence. Comparing our algorithm with two publicly available competitors shows that we are able to significantly outperform both of them in terms of running time, while usually providing embeddings with higher quality. For the more realistic bonds-iDGP instances, our algorithm is able to compute high quality protein structures with limited and noisy information. Most errors can be found at the surface of the proteins, where only few edges can guide the optimization process.

While some related work can provide even higher solution quality ([*e.g.*]{} [@fang2013using]), it can only do so at the expense of an enormous increase in running time. The strength of our work is the combination of low running time, good and consistent solution quality, and genericity.

The evaluation of our algorithm on real-world instances whose distance matrices are derived from chemical bonds and real NMR experiments is ongoing and shows very promising results, too. In the future it also seems promising to use our algorithm for bootstrapping more sophisticated and thus more expensive algorithms for protein structure determination (such as refining the resulting structures in physics-based force fields similar to [@schug2009; @dago2012]). Moreover, further improvements of the resulting structures could be achieved by re-weighting edges by their density; such an approach would consider surfaces more strongly.

 \
**Acknowledgments.** The work by MW and HM was partially supported by grant ME 3619/3-1 within German Research Foundation (DFG) Priority Programme 1736. AS acknowledges support by the *Helmholtz Impuls- und Vernetzungsfonds* and a Google Research Award. HM and AS acknowledge support by KIT’s Young Investigator Network YIN. The authors thank Michael Kovermann (University of Konstanz) for fruitful discussions.

Appendix
========

Pseudocode of Simulated Annealing Algorithm {#sub:sa-alg}
-------------------------------------------

$x' \leftarrow x$ $\leftarrow 0.3$ $x'$

Pseudocode of Simple Local Optimizer {#sub:simple-local}
------------------------------------

$x' \leftarrow x$ $x'$

Additional Experimental Results for iMDGP {#sub:add-exp}
-----------------------------------------

  --------- ------ -- -- ------ -- --
                                   
  Protein                          
  1ptq        ****         ****    
  1bpm        ****         ****    
  1lfb        ****         ****    
  1toa        ****         ****    
  1gpv        ****         ****    
  1rgs        ****         ****    
  1f39        ****         ****    
  1ax8        ****         ****    
  1kdh        ****         ****    
  1mqq        ****         ****    
  --------- ------ -- -- ------ -- --

  : Performance results on $70\%$ $\sigma=0.1$ instances. Best results in bold font.[]{data-label="tab:t70_0.1"}

  --------- ------ -- ------ ------ -- --
                                       
  Protein                              
  1ptq                  ****   ****    
  1bpm        ****             ****    
  1lfb                  ****   ****    
  1toa                  ****   ****    
  1gpv        ****             ****    
  1rgs                  ****   ****    
  1f39                  ****   ****    
  1ax8                  ****   ****    
  1kdh                  ****   ****    
  1mqq        ****             ****    
  --------- ------ -- ------ ------ -- --

  : Performance results on $70\%$ $\sigma=0.01$ instances. Best results (before rounding) in bold font.[]{data-label="tab:t70_0.01"}

  --------- ------ -- ------ ------ -- --
                                       
  Protein                              
  1ptq                  ****   ****    
  1bpm        ****             ****    
  1lfb                  ****   ****    
  1toa        ****             ****    
  1gpv        ****             ****    
  1rgs        ****             ****    
  1f39        ****             ****    
  1ax8        ****             ****    
  1kdh                  ****   ****    
  1mqq        ****             ****    
  --------- ------ -- ------ ------ -- --

  : Performance results on $70\%$ $\sigma=0.001$ instances. Best results (before rounding) in bold font.[]{data-label="tab:t70_0.001"}

Experimental Results for wiMDGP with  {#sec:add-exp-wiMDGP}
-------------------------------------

In order to construct the instances, we perform the same procedure as for with $50\%$ contact edges. For these contact edges, however, weights and interval bounds are modified into three groups: $25\%$ randomly chosen are considered certain and assigned interval bound of $\pm 0.1$ Å and $c_{vw}=1$, $50\%$ randomly chosen are considered of intermediate confidence and assigned interval bounds of $\sigma=0.1$ and $c_{vw}=0.75$, and the last $25\%$ randomly chosen are considered uncertain and assigned $\sigma=0.5$ and $c_{vw}=0.5$.

  Protein     [RMSD]{} / Å   time  / s
  --------- -------------- -----------
  1ptq                     
  1lfb                     
  1ax8                     
  1f39                     
  1gpv                     
  1rgs                     
  1kdh                     
  1bpm                     
  1toa                     
  1mqq                     

  : Performance results on wiMPGP instance (bonds + re-weighted $50\%$ contact-edges: $25\%$ $c_{vw}=1$, $\Delta=0.1$Å , $50\%$ $c_{vw}=0.75$, $\sigma=0.1$ ,$25\%$ $c_{vw}=0.5$, $\sigma=0.5$) []{data-label="tab:wiMDGP-t50"}

[^1]: publicly available at <http://www.mcs.anl.gov/~more/dgsol/> (accessed on April 4, 2017)

[^2]: publicly available at <http://www.math.nus.edu.sg/~mattohkc/disco.html> (accessed on April 4, 2017)

[^3]: <https://algohub.iti.kit.edu/parco/NetworKit/NetworKit-MaxentStress>, main source folder `networkit/cpp/viz`. An updated standalone version is planned to be published in the future.
