To simplify the process of creating an Alchemical Network for Relative Free Energy calculations, openfe offers two convenience Alchemical Network Planner
classes; RBFEAlchemicalNetworkPlanner and RHFEAlchemicalNetworkPlanner.
To create an AlchemicalNetwork
using the Alchemical Planners, the following steps must be followed:
ChemicalComponents
Alchemical Planner
AlchemicalNetwork
Here we demonstrate how to use the RBFEAlchemicalNetworkPlanner to create an RBFE AlchemicalNetwork
ChemicalComponents
¶First we define the ChemicalComponents
which we want to represent in our AlchemicalNetwork
.
from rdkit import Chem
from openfe import SmallMoleculeComponent, SolventComponent, ProteinComponent
# Some SmallMoleculeComponents defining the ligands we want to transform between
ligands = [
SmallMoleculeComponent(m)
for m in Chem.SDMolSupplier("assets/somebenzenes.sdf", removeHs=False)
]
# The ProteinComponent which will be present in our complex simulations
protein = ProteinComponent.from_pdb_file("assets/t4_lysozyme.pdb")
# The SolventComponent defining our system's solvation
solvent = SolventComponent()
Here we choose to use the KartografAtomMapper alongside the Lomap scorer.
For our network we choose to create a minimum spanning network using generate_minimal_spanning_network.
from openfe.setup.atom_mapping import KartografAtomMapper
from openfe.setup.atom_mapping.lomap_scorers import default_lomap_score
from openfe.setup.ligand_network_planning import generate_minimal_spanning_network
Finally we can use the RBFEAlchemicalNetworkPlanner
to create an AlchemicalNetwork
.
Internally the Network Planner will:
LigandNetwork
(accessible under the ._ligand_network
attribute).Transformation
per edge of the LigandNetwork
, one for each of the complex and solvent legs of the RBFE alchemical cycle.Transformation
s to a single AlchemicalNetwork
.from openfe.setup.alchemical_network_planner import RBFEAlchemicalNetworkPlanner
# Build the planner
alchem_planner = RBFEAlchemicalNetworkPlanner(
name="project",
mappers=[KartografAtomMapper()],
mapping_scorer=default_lomap_score,
ligand_network_planner=generate_minimal_spanning_network,
)
# Create the AlchemicalNetwork
alchemical_network = alchem_planner(
ligands=ligands,
solvent=solvent,
protein=protein
)
Similarly, an RHFE AlchemicalNetwork
can be created using the RHFEAlchemicalNetworkPlanner.
Here we use the same ChemicalComponents, atom mapper, scorer, and network planner as used in the RBFE section above.
The RHFEAlchemicalNetworkPlanner
will:
LigandNetwork
.Transformation
per LigandNetwork
edge, one for the solvent and vacuum legs of the transformation, setting appropriate nonbonded methods and cutoffs for the periodic and nonperiodic simulations.Transformation
s into an AlchemicalNetwork
.from openfe.setup.alchemical_network_planner import RHFEAlchemicalNetworkPlanner
# Build the planner
alchem_planner = RHFEAlchemicalNetworkPlanner(
name="project",
mappers=[KartografAtomMapper()],
mapping_scorer=default_lomap_score,
ligand_network_planner=generate_minimal_spanning_network,
)
# Create the AlchemicalNetwork
alchemical_network = alchem_planner(
ligands=ligands,
solvent=solvent,
)