Interface between rdkit and ASE
Project description
molify - Interface between the rdkit and ASE package.
Installation via pip install molify. For more information please visit the
documentation.
A common use case is to create 3D structures from SMILES strings. This can be
achieved using the molify.rdkit2ase function.
import ase
from rdkit import Chem
from molify import rdkit2ase, ase2rdkit
mol = Chem.MolFromSmiles("O")
atoms: ase.Atoms = rdkit2ase(mol)
mol = ase2rdkit(atoms)
Because this is such a common use case, there is a convenience function
molify.smiles2atoms that combines the two steps.
import ase
from molify import smiles2atoms
atoms: ase.Atoms = smiles2atoms("O")
print(atoms)
>>> Atoms(symbols='OH2', pbc=False)
Packmol Interface
Given the molecular units, you can build periodic boxes with a given density
using the molify.pack function.
If you have packmol (at least v20.15.0) you
can use the molify interface as follows:
from molify 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])
Many additional features are described in the documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file molify-0.0.1a1.tar.gz.
File metadata
- Download URL: molify-0.0.1a1.tar.gz
- Upload date:
- Size: 497.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7eba8fea9a59cb5b12063e1fbfdb4be5a934b96ba0c04a50f89b2b6c0ab4fe8a
|
|
| MD5 |
627faaef0519abc07dc3b9910aec226a
|
|
| BLAKE2b-256 |
936543b34a90c77ad48aca2715b0459475a06a3bd22d8b0c375191c46f3e735e
|
File details
Details for the file molify-0.0.1a1-py3-none-any.whl.
File metadata
- Download URL: molify-0.0.1a1-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6aa81efb669fa9a59a8403bcac30823aa7a1bf5bbaac029b4165dd3d1a28612
|
|
| MD5 |
5a428a8a18b90fb6d148a026aa12f57b
|
|
| BLAKE2b-256 |
108ce1994e2a087faf69b3b7ca7d76cffc512750e9cffd3fe2432f6cdcf7d9a4
|