New Flare™ Python Cookbook makes coding accessible to all users for increased design workflow efficiency

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:

  • Remove and/or split proteins, protein chains, and biomolecules
  • Prepare a large number of proteins and extract ligands from proteins
  • Export proteins and ligands into .pdb and .sdf files
  • Modify and add property columns to the Ligands table
  • Organize ligands and conformations into customized roles
  • Run docking experiments on multiple proteins and their associated ligands

Ready-to-use recipes

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.

Run the recipes from the Flare GUI

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.

Create your own workflows

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).

Flare_Python_Cookbook-workflow-exampleFigure 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.

Request an evaluation to see how you can work more efficiently

See how you can work more efficiently by requesting an evaluation of Flare to try the Flare Python Cookbook scripts on your project.

Request a software evaluation, Torx® demo or Discovery CRO discussion

Contact us today