openforcefield / openff-benchmark

Comparison benchmarks between public force fields and Open Force Field Initiative force fields
MIT License
11 stars 2 forks source link

[season 1] Schrodinger optimizations #84

Closed j-wags closed 3 years ago

j-wags commented 3 years ago

Description

This PR introduces the building of custom OPLS3e/OPLS4 parameters and optimization of conformers using the OPLS force fields with Schrodinger tools This PR replaces #63 so that the Schrodinger command tree can be built alongside the season 1 infrastructure, which uses openforcefield version 0.8.4

Installation of schrodinger command group in a dev environment

First, follow the installation procedures for the openff-benchmark-optimization environment described in Deployment Procedure document

Once this is done, you can clone the environment into a development environment:

conda create -n openff-benchmark-dev --clone openff-benchmark-optimization
conda activate openff-benchmark-dev

Install the schrodinger branch from github:

git clone https://github.com/openforcefield/openff-benchmark
cd openff-benchmark
git checkout --track origin/schrodinger
pip install -e .

Docs

General help about new command group: openff-benchmark schrodinger --help

General comments

The schrodinger command group needs access to Schrodinger binaries. They will try to use the SCHRODINGER environment variable. If it is not set, the path to the Schrodinger binaries can be set in the --schrodinger-path command line option of the following commands.

Additionally, the OPLS force field makes use of custom parameters. The custom parameter directory can be set with the --opls-dir command line option.

The commands ffbuilder and optimize have the additional options to set --host and --max-jobs. With the --host option, you can specify the host (queue) on which the ffbuilder or optimization should be run. The name of the host has to be specified in your schrodinger.hosts configuration file. With --max-jobs, you can set the maximal number of parallel subjobs run on the host. If these options are not specified, default settings will be used.

OPLS3e vs OPLS4

Whether OPLS3e or OPLS4 is used, is automatically specified by the Schrodinger version you are using. If you use Schrodinger versions 2020-4 or below, the force field will be OPLS3e, if you use Schrodinger versions 2021-1 or above, the force field will be OPLS4. If you ran the ffbuilder command for OPLS3e already, you can use the ffbuilder output to fit OPLS4 (not included in the openff-benchmark commands).

Step 1: Build custom parameters

Start up a ffbuilder custom parameter calculation using default arguments and the QM optimized molecules:

openff-benchmark schrodinger ffbuilder [--opls-dir ~/.schrodinger/opls_dir] 4-compute-qm/b3lyp-d3bj/dzvp/

It takes into account already available custom parameters in the path given as the option --opls-dir. If --opls-dir is not given or the specified path is not available (i.e. if you are a new user), all parameters will be calculated from scratch. If you run the ffbuilder for the first time and don't have custom parameters yet, do not specify the --opls-dir as this will lead to an error. The same counts if you used OPLS3e before and run the ffbuilder for the first time with OPLS4. The command will create a ffbuilder job ffb_openff_benchmark in the directory 7-schrodinger-ffb. If there are already output files in the output directory, they will be moved to a backup directory 7-schrodinger-ffb/ffb_openff_benchmark.bk[.x] and previously build custom parameters will be automatically merged with the custom parameter path. The output directory can be changed with the -o/--output-path option.

Now you have to wait until the ffbuilder job has finished. You can check the progress of the calculations in the file 7-schrodinger-ffb/ffb_openff_benchmark.log.

Note: You might realize that the ffbuilder input file ffb_input.sdf includes less conformers than you gave as an input. That is correct as the ffbuilder needs only one conformer per molecule.

Step 2: Merge parameters in custom parameter path

This command merges the newly built parameters to your custom parameter path.

openff-benchmark schrodinger ffmerge 7-schrodinger-ffb

The input path must be the output path of step 1. The custom parameters path can be specified with the option --opls-dir, which defaults to ~/.schrodinger/opls_dir/. If the specified or the default --opls-dir does not exist, the directory will be created and initialized. This could be the case if you are a new user or you want to create a separate custom parameter directory.

Step 3a: Run optimization without custom parameters

Optimization using OPLS3e using NO custom parameters:

openff-benchmark schrodinger optimize 4-compute-qm/b3lyp-d3bj/dzvp/

This will create a Schrodinger macromodel optimization run in the directory 8-schrodinger-mm-default. The latter directory can be changed with the -o/--output-path option. If the directory already exists and you want to replace the data, you need to run the command with the option --delete-existing.

Step 3b: Run optimization with custom parameters

By adding a custom parameter path to the optimize command, the optimization will use OPLS3e with custom parameters. Warning: If you have not built the custom parameters correctly and merged them to your custom parameter path, (steps 1 and 2), the command will use the available custom parameters, but the newly built parameters will be missing.

openff-benchmark schrodinger optimize --opls-dir ${HOME}/.schrodinger/opls_dir 4-compute-qm/b3lyp-d3bj/dzvp/

This will create a Schrodinger macromodel optimization run in the directory 9-schrodinger-mm-custom. The latter directory can be changed with the -o/--output-path option. If the directory already exists and you want to replace the data, you need to run the command with the option --delete-existing.

Step 4: Postprocessing

The output files mmod_output.maegz in the respective directories will be postprocessed with the commands:

openff-benchmark schrodinger postprocess -o 4-compute-mm 8-schrodinger-mm-default/mmod_output.maegz

and

openff-benchmark schrodinger postprocess -o 4-compute-mm 9-schrodinger-mm-custom/mmod_output.maegz

This will save the postprocessed SDF files in 4-compute-mm/opls3e_default/4-compute-mm/opls3e_custom (if you used Schrodinger versions 2020-4 or below) or in 4-compute-mm/opls4_default/4-compute-mm/opls4_custom (if you used Schrodinger versions 2021-1 or above). If these directories exist already and you want to replace the data, you need to run the commands with the option --delete-existing.

Hint: The last two commands can be run together: openff-benchmark schrodinger postprocess -o 4-compute-mm 8-schrodinger-mm-default/mmod_output.maegz 9-schrodinger-mm-custom/mmod_output.maegz )

The respective output directories can be included in the final analysis steps.

Todos

Questions

Status

codecov-commenter commented 3 years ago

Codecov Report

Merging #84 (5b26466) into season-1 (06ff926) will not change coverage. The diff coverage is 96.00%.

:exclamation: Current head 5b26466 differs from pull request most recent head f37b907. Consider uploading reports for the commit f37b907 to get more accurate results

j-wags commented 3 years ago

(This PR was erroneously closed as the result of a cleanup that temporarily deleted the season-1 branch)