Defining the Ligand Network#
A LigandNetwork
is a set of small molecules connected by mappings of two small molecules.
One example for such a network could be a set of drug candidates, that should be ranked using alchemical transformations.
The LigandNetwork
is a tool that is used to orchestrate the free energy calculations to efficiently
compute a ligand ranking.
It is of course possible to calculate all possible Transformation
defined by all possible AtomMappings
connecting all SmallMoleculeComponent
with a ‘’maximal network’’ (using generate_maximal_network()
),
but it is much more efficient to use a network with less transformations like a ‘’radial network’’ (also known as a star map, using generate_radial_network()
)
or a ‘’minimimal spanning network’’ (using generate_minimal_spanning_network()
).
Any LigandNetwork`
generation can be generally conceptualized into three steps:
Generate the Atom Mappings of all pairwise combinations of ligands
Build a
LigandNetwork
with all possible mappings directed by their scores.

Generating Ligand Networks#
The ‘’LigandNetwork’’ can be generated with OpenFE employing a LigandAtomMapper
and a atom mapping scorer,
like the default_lomap_score()
together with a LigandNetworkPlanner
, like e.g. the generate_radial_network()
.
In the following code, we will show how a LigandNetwork
can be planned:
import openfe
from openfe import setup
# as previously detailed, load a set of ligands
mols = [SmallMoleculeComponent.from_rdkit(x) for x in rdmols]
# first let's generate the required objs
mapper = setup.KartografAtomMapper()
scorer = setup.lomap_scorers.default_lomap_score
network_planner = setup.ligand_network_planning.generate_minimal_spanning_network
# Now let's plan the Network
ligand_network = network_planner(ligands=mols, mappers=[mapper], scorer=scorer)
Practical information on generating ligand networks can be found in our cookbook for ligand network generation .
Note
Like the Component objects, a LigandNetwork
object is immutable once created!