File size: 2,552 Bytes
64c992d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | {
"cells": [
{
"cell_type": "markdown",
"id": "99d967bc",
"metadata": {},
"source": [
"# SI Figure S7: DFT ¹³C explicit-solvent correction, Desmond vs OpenMM\n",
"\n",
"For the four OpenMM solvents, the DFT ¹³C explicit-solvent correction from Desmond MD vs from OpenMM\n",
"(y=x reference line)."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b506b1dc",
"metadata": {},
"outputs": [],
"source": [
"import os, sys\n",
"\n",
"# make the in-repo modules importable (not pip-installed)\n",
"REPO = os.path.abspath(\"../..\")\n",
"for _p in (\"data/delta22\", \"analysis/code\", \"analysis/code/shared\"):\n",
" sys.path.insert(0, os.path.join(REPO, _p))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "97266e80",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"import delta22\n",
"import delta22_plots\n",
"import paths"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "01aca94d",
"metadata": {},
"outputs": [],
"source": [
"DELTA22_HDF5 = paths.dataset_file(\"delta22\", root=REPO)\n",
"XLSX = os.path.join(REPO, \"data\", \"delta22\", \"delta22_experimental.xlsx\")\n",
"\n",
"def figure_path(name):\n",
" os.makedirs(\"figures\", exist_ok=True)\n",
" return os.path.join(\"figures\", name)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f78afb6a",
"metadata": {},
"outputs": [],
"source": [
"dft = delta22.load_query_df_dft(DELTA22_HDF5, XLSX, verbose=False)"
]
},
{
"cell_type": "markdown",
"id": "b83900b6",
"metadata": {},
"source": [
"## DFT explicit corrections: Desmond vs OpenMM"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "23f9e6f4",
"metadata": {},
"outputs": [],
"source": [
"SOLVENT_ORDER = [\"chloroform\", \"methanol\", \"TIP4P\", \"benzene\"]\n",
"dft_pairs = {sv: delta22.explicit_correction_pairs(dft, sv, \"C\") for sv in SOLVENT_ORDER}\n",
"for sv, p in dft_pairs.items():\n",
" print(f\"DFT {sv:12s} n={len(p):3d} r={np.corrcoef(p['desmond'], p['openMM'])[0,1]:.3f}\")\n",
"delta22_plots.plot_desmond_vs_openmm_grid(dft_pairs, save_path=figure_path(\"si_figure_s07.png\"))\n",
"plt.show()"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|