Creating Ligand Networks Exported from Orion or FEP+#

OpenFE provides functions to load a ligand network from an OpenEye Orion NES .dat file or Schrödinger FEP+ .edge file. With this, we can create a network of transformations using their tools and then run the actual simulations with OpenFE.


%matplotlib inline

from rdkit import Chem

import openfe
from openfe.setup import ligand_network_planning

Load the ligands#

Both FEP+ .edge and Orion .dat files identify molecules by name, so to load the network OpenFE requires a list of named ligands. Load the ligands used by the network into instances of SmallMoleculeComponent. For more information, see Loading Small Molecules:

ligands = [
    for mol in Chem.SDMolSupplier(

Select an atom mapper#

Both formats encode only the network itself, leaving mappings between atoms in each edge undefined. OpenFE needs an atom mapper to produce atom mappings; for more information, see Choose an Atom Mapper:

mapper = openfe.setup.LomapAtomMapper(
    threed=True, # Use atom positions to prune symmetric mappings
    max3d=1.0, # Forbid mapping between atoms more than 1.0 Å apart
    element_change=False, # Forbid mappings that change an atoms element

Create the network#

Then, create the LigandNetwork from the edges in the network file:

ligand_network = ligand_network_planning.load_orion_network(

# ligand_network = ligand_network_planning.load_fepplus_network(
#     ligands=ligands,
#     mapper=mapper,
#     network_file="assets/somebenzenes_fepp.edge",
# )

Visualise the network#

For more ways to visualize a LigandNetwork, see Visualizing Ligand Networks.

from openfe.utils.atommapping_network_plotting import plot_atommapping_network