Skip to main content

Interface between rdkit and ASE

Project description

zincware codecov PyPI version DOI Docs status

rdkit2ase - Interface between the rdkit and ASE package.

Installation via pip install rdkit2ase. 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 rdkit2ase.rdkit2ase function.

import ase
from rdkit import Chem
from rdkit2ase 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 rdkit2ase.smiles2atoms that combines the two steps.

import ase
from rdkit2ase 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 rdkit2ase.pack function.

If you have packmol (at least v20.15.0) you can use the rdkit2ase interface as follows:

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])

Many additional features are described in the documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

molify-0.0.1a0.tar.gz (393.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

molify-0.0.1a0-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file molify-0.0.1a0.tar.gz.

File metadata

  • Download URL: molify-0.0.1a0.tar.gz
  • Upload date:
  • Size: 393.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for molify-0.0.1a0.tar.gz
Algorithm Hash digest
SHA256 712da724ef4f7888093790c8123678b524c6f7f5c6107a677e0d51637b8278a8
MD5 35ac7df1b0a2ac3805fd77bf74e4c87e
BLAKE2b-256 64c09e1544ac28ba64d0cb5aa0e33941812fbac52c8bd1dbdb73c1b640d8554d

See more details on using hashes here.

File details

Details for the file molify-0.0.1a0-py3-none-any.whl.

File metadata

  • Download URL: molify-0.0.1a0-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for molify-0.0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 78649074c91bf7dfa4ce6c83323e2fc181845327b358246efb38a926c5a300a8
MD5 1504f7f8e0b4121e5748f9af8a9fd975
BLAKE2b-256 e34861b51c3ecf14f4afa2f18eaa637ea1189d1092387b5460a8e927935abec9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page