From 2d6886a7006f34633fe3d95450feaec31c5ffdc9 Mon Sep 17 00:00:00 2001 From: Fabian Zills Date: Fri, 16 Aug 2024 12:48:03 +0200 Subject: [PATCH] add `pack` docs --- README.md | 14 ++++++++++++++ rdkit2ase/utils/solvate.py | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 92e164d..9676c19 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,20 @@ print(atoms) >>> Atoms(symbols='OH2', pbc=False) ``` +## Packmol Interface +If you have [packmol](https://github.com/m3g/packmol) (at least `v20.15.0`) you can use the rdkit2ase interface. + +```py +from rdkit2ase import pack, smiles2conformers + +water = smiles2conformers("O", 2) +ethanol = smiles2conformers("CCO", 5) +density = 1000 # kg/m^3 +box = pack([water, ethanol], [7, 5], density) +print(box) +>>> Atoms(symbols='C10H44O12', pbc=True, cell=[8.4, 8.4, 8.4]) +``` + ### Limitations - `rdkit2ase.ase2rdkit` won't be able to detect higher order bonds. diff --git a/rdkit2ase/utils/solvate.py b/rdkit2ase/utils/solvate.py index 41eb76f..da43fe6 100644 --- a/rdkit2ase/utils/solvate.py +++ b/rdkit2ase/utils/solvate.py @@ -69,7 +69,7 @@ def pack( >>> water = smiles2conformers("O", 1) >>> ethanol = smiles2conformers("CCO", 1) >>> density = 1000 # kg/m^3 - >>> packed_system = pack([water, ethanol], [10, 5], density) + >>> packed_system = pack([water, ethanol], [7, 5], density) >>> print(packed_system) Atoms(symbols='C10H44O12', pbc=True, cell=[8.4, 8.4, 8.4]) """