Make the molecules that matter with accurate, efficient, and easy-to-run FEP calculations
In this article, we take a deep dive into the unique technical features of Cresset’s accessible Free Energy Perturbation solution, ...
The Flare Python Cookbook provides a fast-track and user-friendly path for novice and non-expert Python users to familiarize themselves with writing scripts, and take advantage of extended Flare functionality. It is accessible through the Flare Python API which enables medicinal and computational chemists to gain full access to all the scientific capabilities and functionality in Flare, including key elements in the main GUI interface, and connects Flare to the RDKit™ cheminformatics toolkit.
Use the Flare Python Cookbook to work more efficiently by automating common tasks, creating customized workflows, and even by developing or incorporating exciting new science into Flare. However, if you are not familiar with writing code, getting started may be intimidating, and you may arrive at the conclusion that creating scripts is for more expert Python coders. This is not the case as we have developed the Flare Python API to be intuitive and easy to learn and use for all users, novice and expert.
To help you get started, we created the Flare Python Cookbook – a compilation of ready-to-use recipes, which can be run directly from the Flare GUI. Novice Python users will use the simpler recipes to understand how the Flare Python API works, and to start customizing and automating their Flare experiments, while more experienced Python users will find practical examples of applications to familiarize with the straightforward functionality of the Flare Python API.
The Flare Python Cookbook explains how to use the Flare Python API to run tasks such as:
The Flare Python Cookbook provides a series of Python ready-to-use recipes. Each recipe, or snippet, performs a specific task which can be used ‘as-is’ from the Flare GUI.
Each snippet has an identifier with the CressetFlareCB_number format, e.g., CressetFlareCB_8, to facilitate retrieval of snippets and Cookbook housekeeping.
As an example, the CressetFlareCB_8 snippet shown in Figure 1 checks whether the ligands in the Flare Ligands table have any conformations (previously created by a conformation hunt and alignment experiment). If they do, the snippet finds the lowest energy conformation for each ligand, and puts it into a newly created role called ‘Lowest Energy Conformation’. If they don’t, it gives you a message: 'No conformers found for ligand X', and moves to the next ligand.
Figure 1. Example of description and code for snippet CressetFlareCB_8.
The Flare Python Cookbook is created as a Jupyter Notebook which can be downloaded from GitLab. The easiest way to run recipes is to load the ‘Flare_Python_Cookbook.ipynb’ file (the Jupyter notebook you just downloaded) into the Python Notebook extension in Flare (Figure 2).
Instructions for setting input and output directories are provided at the beginning of the Flare Python Cookbook, alongside indications to test it has been successfully set up.
Figure 2. The Jupyter Notebook, ‘Flare_Python_Cookbook.ipynb’ file, loaded into the Flare Python Notebook extension in Flare.
More confident Python users might prefer to run Flare experiments in batch mode and use the Flare Python API from the command line. Additional information about alternative ways to run the recipes can be found in the Flare Python Cookbook.
To facilitate recipe search and location, the snippets in the Flare Python Cookbook have been grouped in four main topic areas (Figure 3):
Figure 3. Overview of recipes included in the first release of the Flare Python Cookbook. Getting started: checking Flare Python Cookbook settings and file handling, grey boxes. Proteins: importing/exporting protein files and manipulation protein chains, orange boxes. Ligands: importing/exporting ligand files and interacting with ligands and the ligands table, blue boxes. Docking: running a ‘Normal’ Flare docking experiment and manipulation docking data, green boxes.
These simple, but fully functional, recipes can be used on their own or as building blocks for creating more advance customized workflows (Figure 4).
Figure 4. An example of a potential workflow with tasks automated via snippets in the Flare Python Cookbook.
New recipes featuring additional functionality will be available in future releases of the Flare Python Cookbook. In the meantime, if you would like a new recipe please contact Cresset support.
See how you can work more efficiently by requesting an evaluation of Flare to try the Flare Python Cookbook scripts on your project.