Create simulation boxes for LAMMPS.
Project description
molbox
Molbox is a simple Python package that extends rdkit with spatial transformations of 3D molecules and semantics for multiple molecules in a rectangular box. It allows you to quickly create simulation boxes and write them to data files that can be read by LAMMPS.
Installation
pip install molbox
Usage
from molbox import Box, MolBox
from molbox.lammps_data import write_lammps_data
from molbox.rdkit_3d_ops import create_3d_mol_from_smiles, rotate_mol
from rdkit import Chem
from scipy.spatial.transform import Rotation
def main():
box = Box([0, 0, 0], [175, 175, 175])
o2_box = MolBox(box=box)
o2_mol = create_3d_mol_from_smiles("O=O")
num_mols = 128
for _ in range(num_mols):
rotation = Rotation.random()
new_mol = rotate_mol(o2_mol, rotation, "COM")
o2_box.add_mol_randomly(new_mol)
Chem.MolToMolFile(o2_box.mol, "examples/o2_box.mol")
write_lammps_data(o2_box, "examples/o2_box.lmpdat")
if __name__ == "__main__":
main()
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
molbox-0.1.4.tar.gz
(3.6 kB
view details)
Built Distribution
File details
Details for the file molbox-0.1.4.tar.gz
.
File metadata
- Download URL: molbox-0.1.4.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.9.7-200.fc40.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5d950cf987a9eb19a9f056a911a32bb67a572b98ca815e12c7d245804862ef4 |
|
MD5 | d592b54b527768d63ec22f2f054efde7 |
|
BLAKE2b-256 | e96ddce924b4078e2f045a0b4bdaaf7fef30ae82a8b398f4d77920677f8eca41 |
File details
Details for the file molbox-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: molbox-0.1.4-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.9.7-200.fc40.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d95f4211b703abe07e65d22a5e35f0482be91979fe25cb158a72842c599edaad |
|
MD5 | 2ceaf12e586de9c8a7ced75266b5a33b |
|
BLAKE2b-256 | 2e8061476378ed2d1bf1de3381d107ce18fdf406704bb3e63a1ffa180396a8d4 |