Cookbook#
This section describes common tasks involving the OpenFE Python API.
The OpenFE CLI provides a simple way to perform the most common procedures for free energy calculations, but does not provide much flexibility for fine-tuning your approach or combining OpenFE with other tools. The Python API allows that flexibility, but using it is more complex. This cookbook breaks down common steps that would be implemented in Python to help navigate that complexity.
Note
This section is a work-in-progress.
The Basic Workflow#
The typical way to use the Python API is to load a number of molecules you want to calculate free energies of, construct a LigandNetwork
connecting them in an efficient way, and then combine that with information for how each ligand should be simulated to construct an AlchemicalNetwork
, which specifies the entire simulation campaign. This provides a lot of flexibility in how molecules are specified, mapped, connected, and simulated, without exposing a great deal of complexity. OpenFE recommends this workflow for most users.
- Setup
Protocol
Simulation procedure for an alchemic mutation.
- Chemical component definition
SDF, PDB, RDKit, OpenFF Molecule, solvent spec, etc.
SolventComponent
andProteinComponent
Other chemical components needed to simulate the ligand.
SmallMoleculeComponent
The ligands that will be mutated.
- Orion/FEP+
Network from another tool.
LigandNetwork
A network of ligand transformations.
AlchemicalNetwork
A complete simulation campaign.
- Run
- openfe quickrun
OpenFE recommends using the
openfe quickrun
CLI command to execute a transformation.
- Gather
- openfe gather
OpenFE recommends using the
openfe gather
CLI command to collect the results of a transformation.
List of Cookbooks#
- Loading Molecules and Chemical Systems
- Dumping a
Transformation
to JSON - Choose and Configure a Protocol
- Planning a Ligand Network
- Relative Free Energy Alchemical Network Planners
- Creating Ligand Networks Exported from Orion or FEP+
- Ligand Networks by Hand
- Visualizing Ligand Networks
- Create an Alchemical Network
- Under the Hood
- Assigning partial charges to an OpenFF Molecule