Nonequilibrium Switching

The Nonequilibrium Switching (NES) method is a relatively novel method in the Binding Free context to calculate Relative Binding Affinities (RBFE) of a given target and its ligands. The theory was developed during the 1990s 1 2. However, due to its high computational demand, the approach has not been fully explored, and few pioneering works have been published so far 3

In general, the relative binding affinity \(\Delta\Delta G\) is defined as the free energy difference between the binding affinities of a ligand A \(\Delta G_{A}\) and B \(\Delta G_{B}\) related to their target: \(\Delta\Delta G=\Delta G_{B}-\Delta G_{A}\). Nevertheless, the direct computation of these affinities could be quite challenging because a direct binding process has to be simulated in-silico and often, other thermodynamics paths are used. During the last 30 years, Alchemical methods have been proved to be very effective to calculate the RBFE between two ligands (Egde) . In this approach, a starting ligand A is “mutated” into a final one B in different environments. For example, \(\Delta\Delta G\) can also be computed following the alternative paths shown in the figure below where \(\Delta G_{Bound}\) and \(\Delta G_{Unbound}\) are estimated by using alchemical methods: \(\Delta\Delta G=\Delta G_{Bound}-\Delta G_{Unbound}\).

RBFE and alternative thermodynamics paths

RBFE and alternative thermodynamics paths

In the Unbound path the starting ligand is mutated into the final one just in solution while, in the Bound path, the mutation happens in the complex binding site. In the NES approach, these mutations are done in a non-equilibrium regime many and many times starting from equilibrium snapshots and building the forward and reverse work probability distribution functions that can be used to estimate \(\Delta G_{Bound}\) and \(\Delta G_{Unbound}\). For this reason, the NES methodology requires prior to run to have the equilibrium ensembles for the Bound and the Unbound systems.

In addition, the implemented NES floe-protocol tries to estimate the binding affinities from the computed RBFEs by using the maximum likelihood estimator method 4 and, making possible to compare the predicted affinities values with experimental results derived, for example, from activities measurements, IC50 etc.


RBFE calculations via Alchemical methods must be carefully used. In particular, mutations should be carried out between similar ligands i.e. where a common ligand scaffold can be identified and small different functional groups are mutated.

The Equilibrium and Non-Equilibrium Switching floe

The Equilibrium and Non-Equilibrium Switching floe can be divided into four main sections shown here.

The Equilibrium and Non-Equilibrium Switching floe

The four main sections of the Equilibrium and Non-Equilibrium Switching floe

The first and second floe sections are designed to assemble and run the Bound and Unbound simulations. The protocol for the Bound simulations is similar to the tutorial on the Short Trajectory MD with Analysis and it is not repeated here. In the Unbound simulations, each ligand is charged, solvated in a box of solvent and parametrized accordingly to the selected force field and then is equilibrated in three different steps performing: restrained minimization, NVT and NPT md runs. At the end of the equilibration stages, both the Bound and Unbound prepared flasks are set into an equilibrium production stage where they run for a total of a default 6ns.

The third section of the floe carries out the NES calculations and is shown here

The Non-Equilibrium Switching floe section

The Non-Equilibrium Switching floe section

In this section, important cubes are the Gathering cube which selects the equilibrium runs involved in a RBFE calculation and handing them to the Chimera cube. In this cube, a chimeric molecule between the ligands participating in an edge is created (the ligand edge are topologically merged together with their force field parameters) and injected into selected equilibrium trajectory frames collected during the equilibrium runs. In the NES method, for each chimeric molecule (or edge) the following switching simulations are performed per each selected equilibrium frame:

  • A Bound forward (ligA is mutate to ligB in the complex binding site)

  • A Bound reverse (ligB is mutate to ligA in the complex binding site)

  • An Unbound forward (ligA is mutate to ligB just in solution)

  • An Unbound reverse (ligB is mutate to ligA just in solution)

By default, 80 equilibrium frames are selected for the Bound and Unbound runs therefore, for each edge a total of:

80 (Bound forward) + 80 (Bound reverse) + 80 (Unbound forward) + 80 (Unbound reverse) = 320

ne-switching mutations are completed. Each run is effectively made with a short NPT equilibration of 5ps to adapt the equilibrium frame system to the new chimeric molecule followed by a default 50ps NPT ensemble simulation where the chimeric molecule is switched between the starting and final ligand thermodynamic states. All the runs are done by using Gromacs as md engine at this stage.

The final NES-floe section analyzes the NES data to produce binding affinities and relative binding affinities results.

The NES Analysis floe section

The NES Analysis floe section

For each edge, the forward and reverse works for the Bound and Unbound switching are evaluated by using the Bennet Acceptance ratio for Non-Equilibrium and these values are used to compute the \(\Delta G_{Bound}\) and \(\Delta G_{Unbound}\) free energies that are related to \(\Delta\Delta G\). The RBFE values for an edge are used to attempt estimates of the affinity values by using the maximum likelihood estimator. However, this approach succeeds if the provided ligand edge map is enough connected, otherwise no estimates will be done.

Protein, Ligand and Edge mapping file inputs

As for the Short Trajectory MD floe, the NES floe requires ligands to have reasonable 3D coordinates, all atoms, and correct chemistry. In particular, bond orders and formal charges should be correctly assigned. The floe can be directly input from docking programs like Posit but, bad clashes should have been relaxed prior to input the floe to resolve high gradients with the protein or other components like cofactors. In general, bad poses will evaluated and eventually rejected at floe running-time.

The NES floe requires correctly prepared proteins up to “MD ready” standards which requires chain capping, all atoms in protein residues (including hydrogens) and missing protein loops resolved or capped. Protein side chain formal charges and protonation at this point determine their tautomeric state. Additionally, cofactors and structured internal waters are also important to be included. We strongly recommend using Spruce for protein preparation.

In addition to the protein target ans its ligands the NES floe requires the ligand mapper dataset produced by the Edge Mapper for RBFE calculations floe introduced in the MD Affinity pkg starting from the v5.0.3. This dataset contains the edges information for the relative binding affinity calculations to be carried out.

For this tutorial the Tyk2 receptor and few ligands have been selected. The files can be download below with the ligand dataset file as well.

How to use the floe

After selecting the Equilibrium and Non-Equilibrium Switching floe in the Orion UI, you will be presented with a job form with inputs, outputs and parameters to select. In next the Figures you can see how we filled out the key fields for the Tyk2 receptor case.

The NES floe inputs

The NES floe inputs

The Equilibrium and Non-Equilibrium Switching floe requires two mandatory inputs and two optional inputs. The mandatory inputs are the ligand and the ligand edge mapping datasets. The two optional inputs are the protein input file and the experimental binding affinity text file. However, If the optional protein is not provided, the floe will check if the protein is present on the ligand datasets in form of Design Unit produced by Spruce. If this data cannot be found an error will be raised and the floe will fail. The OpenEye Posit floe is able to produce datasets in this form otherwise the user must provides a protein as input as well. In the case that the protein is provided as input and, also the protein is present on the ligand input datasets the protein input will supersede. The other optional input is the experimental affinity file which will be used to generate comparison plots and tables between experimental and predicted results for \(\Delta\Delta Gs\) and \(\Delta Gs\) in the floe reports.


The protein input is optional but, if it is not provided the protein must be present on the ligand input datasets as Spruce Design Unit.

In order to submit the floe to Orion output dataset names have to be input to the floe.

The NES floe outputs

The NES floe outputs

The Equilibrium Bound and Unbound dataset outputs are the datasets produced at the end of the Equilibrium runs. The Bound dataset can be further used as input in the Analysis floe for Short Trajectory MD to triage stable from unstable ligand poses. If the provided edge mapping file is well connected, the NES floe can predict Affinities, and these results are saved in the Affinity dataset output. The NES and Failure datasets are also produced as outputs. The first contains all the information produced along the

NES runs at edge and ligand level while, the latter gathers all the failures produce along the whole floe for debugging purposes. Finally, the user must provide a dataset name for the Recovery dataset. Indeed, occasionally, Orion and the AWS cloud infrastructures could have severe problems and the produced recovery dataset can be used to try to recover and generate partial results from the NES runs by using the designed recovery Non-Equilibrium Switching Recovery floe.

The final NES floe selection is related to the promoted parameters

The NES floe parameters

The NES floe parameters

Their meanings are explained below:

  • Total Number of NES Trajectory Frames (Default 80) This parameters controls how many snapshots are taken

    from the Bound and Unbound Equilibrium trajectories to run the NES switching. For example, suppose that in the Bound equilibrium run for 6ns production, we collected a total of 1000 frames. From these frames, 80 equally distanced frames are selected (~each 12 frames). The chimeric molecule is injected into these frames to run the forward and reverse Bound and Unbound runs.

  • NES Switching Time (Default 50ps) This parameter controls the time length of the NES switching. For difficult and large mutations, this parameter could be used to try to have better bound/unbound work convergence.

  • Protein Title Name (Default blanc) The protein name used to identify your flask. This name will be used for the produced output file names and other information.

  • Charge The Ligand (Default True) If True the ligand will be charged by using the ELF10 methods otherwise the ligand partial charged will be used (if any).

  • Ligand Force Field (Default OpenFF 2.0.0) The ligand force field to be used.

  • Protein Force Field (Default Amber14SB) The protein force field to be used.

  • Hydrogen Mass Repartitioning (Default True) If true the md time step used along the equilibrium runs will be set to 4fs otherwise to 2 fs.

  • Equilibrium Running Time (Default 6ns) The total equilibrium time for the Bound and Unbound simulations.

  • Ligand Affinity Experimental File (Default None) The experimental text file with the binding affinity in kcal/mol or kJ/mol. The syntax of this text file is strict. Each line entry must be in the syntax form:

    • ligA \(\Delta G\) \(\Delta G_{error}\) units

    where ligA is the molecule title name, \(\Delta G\) the binding affinity value, \(\Delta G_{error}\) the binding affinity valuer error and units in the syntax form of kcal/mol or kJ/mol. The \(\Delta G_{error}\) is optional and if not provided will not be used. An example of this file for the Tyk2 receptor can be downloaded here:

Understanding the Results from NES

The results from the floe are accessed via two main floe reports at the end of the running NES job and selectable in the Jobs tab in the Orion Floe page. For this tutorial we will focus on the results produced by running the Tyk2 receptor and ten selected relative binding affinity calculations.

The NES floe finished Job

The NES floe finished job

From the NES run job page, the NES Report is accessible by clicking on the tab. Here, many pieces of information are shown, but the most relevant are the edges related to the submitted RBFE calculations in form of tiles. Each tile shows the edge and the predicted RBFE by using the Bennet Acceptance Ratio method for Non-Equilibrium. In addition, other relevant pieces of information are shown, like the total floe running time and its cost. Clicking on each tile will show important information related to the RBFE calculation. For example, in the below figure, the detailed calculation information are shown for the edge involving the ligand ejm_46 to ejm_54

A good RBFE calculation

A good RBFE calculation

We have two main plots and a table. The upper and lower plots are respectively related to the Bound and Unbound NES simulations. We are going to focus on the Bound NES simulations but, the same considerations are true for the Unbound one. The blue and red graphs are plotting the calculated Forward and Reverse NES switching works for each selected starting equilibrium frames. The important message to take is that if the the graphs overlap well then this is a good indicator that the computed free energy change is trustable and accurate. The probability distribution plots are made by binning the work values for the forward and reverse works and again if the two probability distributions overlap it is a good sign that the calculation was successfully. Analog considerations are valid for the Unbound graph. By using the work values recorded along the switching it is possible to estimate the free energy changes \(\Delta G_{Bound}\) and \(\Delta G_{Unbound}\) shown in figure_RBFE and indirectly estimates \(\Delta\Delta G = \Delta G_{Bound} - \Delta G_{UnBound}\). These computed values are reported in a table as well.

The figure below reports the RBFE calculation involving the ligand ejm_43 to ejm_54

A bad RBFE calculation

A bad RBFE calculation

In this case, both the Bound and Unbound graphs and work probability distributions do not overlap well and the results should not be trustable.

From the NES job page, another report, the Affinity Report, is selectable from the tabs. The affinity report shows two main sections. In the first section, experimental and predicted affinities are compared. Here, a graph between \(\Delta G_{Experimental}\) vs \(\Delta G_{Predicted}\) is shown. This graph is available if the experimental affinity file has been provided and the ligand edge map is connected enough to be able to make affinity predictions.

Experimental vs predicted affinities

Experimental vs predicted affinities

In addition, the graph data are tabulated, and different statistical metrics are shown, such as correlation metrics and linear models. The second section of the Affinity Report shows a comparison between the experimental and predicted relative binding affinities \(\Delta\Delta G_{Experimental}\) vs \(\Delta\Delta G_{Predicted}\) in a graph and tables with the statistical metrics as well.

Experimental vs predicted relative binding affinities

Experimental vs predicted relative binding affinities

In addition to the NES and the Affinity floe reports, the results themselves are also uploaded to Orion S3 in .tar.gz file format ready to be locally downloaded. These files, contain all the nes and affinity data provided in .csv file formats that can be used for a more close analysis and the .html reports. Below are attached the result files generated along the run:



Jarzynski, C. (1997), “Non-Equilibrium equality for free energy differences”, Phys. Rev. Lett., 78 (14): 2690


Jarzynski, C. (1997), “Equilibrium free-energy differences from non-equilibrium measurements: A master-equation approach”, Phys. Rev. E, 56 (5): 5018


Vytautas Gapsys, et al., “Large scale relative protein ligand binding affinities using non-equilibrium alchemy”, Chem. Sci. (2020) 11, 1140-1152


Huafeng Xu “Optimal Measurement Network of Pairwise Differences”, J Chem Inf Model. 2019 Nov 25;59(11):4720-4728