OpenMOL
OpenMOL is a Python package to convert between popular molecular dynamics data file formats. It exposes a pythonic way to easily manipulate MOL2 and LAMMPS data files.
Features
- Convert AMBER PARM7 and restart files into LAMMPS data files.
- Read, manipulate and write MOL2 files.
- Save data files into portable openmol json format without losing any properties.
- Build complex mol2 systems using Discovery Studio and import into tleap.
- Extensible.
Installation
You can install openmol directly from PyPI using pip.
pip install openmol
Usage Examples
AMBER to LAMMPS
Convert AMBER prmtop and restart files to a LAMMPS data file.
from openmol import amber_parm7 as amber
from openmol import lammps_full as lammps
# read amber parm files
p = amber.read('system.prmtop', 'system.rst7')
# calculate necessary lammps items and write
p = lammps.build(p)
lmp = lammps.Writer(p, 'system.data')
lmp.write()
Fix VMD MOL2
The SUBSTRUCTURE section of the MOL2 files created by VMD are not always properly formated. Use the following to fix the format.
from openmol import tripos_mol2 as mol2
# read vmd output mol2 file
p = mol2.read('vmd_saved.mol2')
# calculate necessary mol2 residue info
p = mol2.build(p)
# write the fixed mol2 file
mol2.Writer(p, 'fixed_vmd_saved.mol2').write()
Fix DSV mol2 residue names
Discovery Studio Visualizer generated MOL2 files can contain digits as suffixes in the residue names. Update the residue names for all atoms as below.
from openmol import tripos_mol2 as mol2
p = mol2.read('dsv_output.mol2')
# set all atom's resname to FeO
for i, atom in enumerate(p.atom_name):
p.atom_resname[i] = 'FeO'
p = mol2.build(p)
# write the fixed mol2 file
mol2.Writer(p, 'fixed_dsv_output.mol2').write()
Current Implementations
| Parser | Reader | Writer |
|---|---|---|
| Amber | Yes | x |
| LAMMPS | x | Yes |
| MOL2 | Yes | Yes |
Contributions welcome!
For the latest development version you can clone the Git repository.
git clone https://github.com/akhlakm/OpenMOL
cd OpenMOL
pip install -e .
License
GNU General Public License v3.0 (GPLv3.0)
Metadata
Release files for openmol 1.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| openmol-1.2.2.tar.gz | 34.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openmol-1.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.6 kB
Release files / openmol-1.2.2.tar.gz
| Download URL | openmol-1.2.2.tar.gz |
|---|---|
| Size | 34.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
928fb92b85b68a0eb8c9383e10b14f66f1cd76fa795db83cbc0a3ec2e0609726
|
|
BLAKE2b-256 checksum How to use checksums |
602b7ef262e0c4bd7daec7dc859dda80d5cbba683c06dd50b627a8e436934155
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Release files / openmol-1.2.2-py3-none-any.whl
| Download URL | openmol-1.2.2-py3-none-any.whl |
|---|---|
| Size | 37.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e64693b80493103b841194da37816b10d5fc9e094958e5f5843dc3a0080c26e
|
|
BLAKE2b-256 checksum How to use checksums |
c173401b92dd017926cac6192be6dfb6a93035a3b63a4d165fea4fbf49a42b40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Security for openmol 1.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.