Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from mlipaudit.dihedral_scan import DihedralScanBenchmark
from mlipaudit.folding_stability import FoldingStabilityBenchmark
from mlipaudit.io import load_benchmark_results_from_disk
from mlipaudit.noncovalent_interactions import NoncovalentInteractionsBenchmark
from mlipaudit.ring_planarity import RingPlanarityBenchmark
from mlipaudit.small_molecule_minimization import (
SmallMoleculeMinimizationBenchmark,
Expand All @@ -34,6 +35,7 @@
conformer_selection_page,
dihedral_scan_page,
folding_stability_page,
noncovalent_interactions_page,
ring_planarity_page,
small_molecule_minimization_page,
tautomers_page,
Expand All @@ -42,6 +44,7 @@
BENCHMARKS: list[type[Benchmark]] = [
ConformerSelectionBenchmark,
DihedralScanBenchmark,
NoncovalentInteractionsBenchmark,
TautomersBenchmark,
RingPlanarityBenchmark,
SmallMoleculeMinimizationBenchmark,
Expand Down Expand Up @@ -93,7 +96,14 @@ def _func():
title="Tautomers",
url_path="tautomers",
)

noncovalent_interactions = st.Page(
functools.partial(
noncovalent_interactions_page,
data_func=_data_func_from_key("noncovalent_interactions", data),
),
title="Noncovalent Interactions",
url_path="noncovalent_interactions",
)
ring_planarity = st.Page(
functools.partial(
ring_planarity_page,
Expand Down Expand Up @@ -136,6 +146,7 @@ def _func():
conformer_selection,
dihedral_scan,
tautomers,
noncovalent_interactions,
ring_planarity,
small_molecule_minimization,
bond_length_distribution,
Expand Down
46 changes: 46 additions & 0 deletions app_data/noncovalent_interactions/n_systems_per_subset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"Dispersion: NobleGases": 140,
"Dispersion: PS": 103,
"Dispersion: HCNO": 79,
"Dispersion: Halogens": 94,
"Dispersion: Boron": 26,
"Hydrogen bonds: NH-O": 65,
"Hydrogen bonds: noHB": 113,
"Hydrogen bonds: CH-N": 20,
"Hydrogen bonds: OH-O": 60,
"Hydrogen bonds: NH-N": 53,
"Hydrogen bonds: OH-N": 45,
"Hydrogen bonds: CH-O": 19,
"Hydrogen bonds: XH-Cl": 32,
"Hydrogen bonds: XH-I": 19,
"Hydrogen bonds: XH-O": 51,
"Hydrogen bonds: XH-S": 54,
"Hydrogen bonds: XH-P": 52,
"Hydrogen bonds: XH-N": 34,
"Hydrogen bonds: XH-F": 41,
"Hydrogen bonds: XH-Br": 17,
"Ionic hydrogen bonds: NH(+)-O": 15,
"Ionic hydrogen bonds: OH-O(-)": 15,
"Ionic hydrogen bonds: OH-N(-)": 3,
"Ionic hydrogen bonds: CH-O(-)": 15,
"Ionic hydrogen bonds: NH(+)-N": 15,
"Ionic hydrogen bonds: NH-N(-)": 6,
"Ionic hydrogen bonds: CH-N(-)": 3,
"Ionic hydrogen bonds: NH-O(-)": 15,
"Ionic hydrogen bonds: NH-C(-)": 5,
"Ionic hydrogen bonds: NH(+)-C": 4,
"Ionic hydrogen bonds: OH-C(-)": 2,
"Ionic hydrogen bonds: OH(+)-O": 1,
"Ionic hydrogen bonds: CH-C(-)": 1,
"Repulsive contacts: NobleGases": 180,
"Repulsive contacts: Halogens": 235,
"Repulsive contacts: HCNO": 170,
"Repulsive contacts: PS": 154,
"Sigma hole: Cl": 29,
"Sigma hole: P": 33,
"Sigma hole: Br": 36,
"Sigma hole: S": 31,
"Sigma hole: Se": 44,
"Sigma hole: I": 42,
"Sigma hole: As": 35
}
1 change: 1 addition & 0 deletions docs/source/api_reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ API reference
benchmark
small_molecules/conformer_selection
small_molecules/dihedral_scan
small_molecules/noncovalent_interactions
small_molecules/tautomers
small_molecules/ring_planarity
small_molecules/minimization
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. _noncovalent_interactions_api:

Noncovalent Interactions
========================

.. module:: mlipaudit.noncovalent_interactions.noncovalent_interactions

.. autoclass:: NoncovalentInteractionsBenchmark

.. automethod:: __init__

.. automethod:: run_model

.. automethod:: analyze

.. autoclass:: NoncovalentInteractionsResult

.. autoclass:: NoncovalentInteractionsSystemResult

.. autoclass:: NoncovalentInteractionsModelOutput

.. autoclass:: NoncovalentInteractionsSystemModelOutput
Binary file modified docs/source/benchmarks/small_molecules/img/pes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/benchmarks/small_molecules/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ sampling, stability, and interactions with other molecules.

Conformer Selection <conformer_selection>
Dihedral scan <dihedral_scan>
Noncovalent Interactions <noncovalent_interactions>
Ring planarity <ring_planarity>
Tautomers <tautomers>
Minimization <minimization>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
.. _noncovalent_interactions:

Non-covalent interactions
=========================

Purpose
-------
This benchmark tests if the **MLIP** can reproduce interaction energies of molecular complexes driven by non-covalent interactions.
Non-covalent interactions are of highest importance for the structure and function of every biological molecule. This benchmark
assesses a broad range of interaction types: London dispersion, hydrogen bonds, ionic hydrogen bonds, repulsive contacts and sigma
hole interactions.


Description
-----------
The benchmark runs energy inference on all structures of the distance scans of bi-molecular complexes in the dataset. The key
metric is the **RMSE of the interaction energy**, which is the minimum of the energy well in the distance scan, relative to the
energy of the dissociated complex - compared to the reference data. For repulsive contacts, the maximum of the energy profile is
used instead. Some of the molecular complexes in the benchmark dataset contain exotic elements (see *dataset section*). In case that
the **MLIP** has never seen an element of a molecular complex, this complex will be skipped in the benchmark.

.. list-table::
:widths: 25 45
:header-rows: 0

* - .. figure:: img/butadiene_diazomethane.png
:width: 100%
:align: center
:figclass: align-center

- .. figure:: img/pes.png
:width: 100%
:align: center
:figclass: align-center

Dataset
-------
This benchmark uses the datasets from the `NCI Atlas <http://www.nciatlas.org/>`_, with dissociation energy profiles.
These datasets contain **QM** optimized geometries, along with **CCSD(T)/CBS** level interaction energies. The molecular complexes of
these datasets contain typical organic small molecules, but also more exotic species and elements. Here is a summary of the
datasets used in this benchmark:

.. list-table:: NCI Atlas Datasets
:widths: 20 30 50
:header-rows: 1

* - Dataset Name
- Type of interaction
- Subsets
* - D442x10
- London dispersion
- Noble Gases, Boron, HCNO, Halogens
* - HB375x10
- Hydrogen bonds
- OH-N, OH-O, OH-C, NH-N, NH-O, …
* - HB300SPXx10
- Hydrogen bonds extended to S, P and halogens
- XH-S, XH-P, XH-Cl, XH-Br
* - IHB100x10
- Ionic hydrogen bonds
- O, N, C with cationic donors and anionic acceptors
* - R739x5
- Repulsive contacts
- HCNO, halogens, PS
* - SH250x10
- Sigma hole interactions
- P, S, Br, Cl, I

Interpretation
--------------
The **RMSE** of the interaction energies should be **as low as possible**. This metric is likely to be very different for the different
interaction types and data subsets. The **RMSE** in interaction error **should be compared per interaction type** and then in a more
fine-grained visualization for the data subsets to identify areas of weakness for the **MLIP**. Within these areas of weakness,
individual dissociation energy profiles can be visually inspected to see how they compare to the reference.
2 changes: 2 additions & 0 deletions src/mlipaudit/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from mlipaudit.dihedral_scan import DihedralScanBenchmark
from mlipaudit.folding_stability import FoldingStabilityBenchmark
from mlipaudit.io import write_benchmark_results_to_disk
from mlipaudit.noncovalent_interactions import NoncovalentInteractionsBenchmark
from mlipaudit.ring_planarity import RingPlanarityBenchmark
from mlipaudit.small_molecule_minimization import SmallMoleculeMinimizationBenchmark
from mlipaudit.tautomers import TautomersBenchmark
Expand All @@ -35,6 +36,7 @@
BENCHMARKS = [
ConformerSelectionBenchmark,
TautomersBenchmark,
NoncovalentInteractionsBenchmark,
DihedralScanBenchmark,
RingPlanarityBenchmark,
SmallMoleculeMinimizationBenchmark,
Expand Down
18 changes: 18 additions & 0 deletions src/mlipaudit/noncovalent_interactions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2025 InstaDeep Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from mlipaudit.noncovalent_interactions.noncovalent_interactions import (
NoncovalentInteractionsBenchmark,
NoncovalentInteractionsResult,
)
Loading
Loading