Simple Gromacs python wrapper
Project description
GroMorG
A python tool to automate the calculation of MD simulations of small organic molecules using gromacs.
Online documentation is available at https://gromorg.readthedocs.io/
Features
- Link first principles & molecular mechanics calculations using PyQchem
- Get parameters from SwissParam (https://www.swissparam.ch) automatically from molecular structure
- Clean run without intermediate files
- Add solvent molecules to the system
- Extract structures from the trajectory (including surrounding solvent molecules)
Requirements
- PyQchem (https://github.com/abelcarreras/PyQchem)
- Gromacs 2025+ (gmxapi) (http://www.gromacs.org)
- Openbabel v3.x (python API) (http://openbabel.org)
- MDtraj (https://www.mdtraj.org)
Basic example
from gromorg import GromOrg
import matplotlib.pyplot as plt
from pyqchem.structure import Structure
# Define moleule as PyQchem Structure
structure = Structure(coordinates=[[ 0.6695, 0.0000, 0.0000],
[-0.6695, 0.0000, 0.0000],
[ 1.2321, 0.9289, 0.0000],
[ 1.2321,-0.9289, 0.0000],
[-1.2321, 0.9289, 0.0000],
[-1.2321,-0.9289, 0.0000]],
symbols=['C', 'C', 'H', 'H', 'H', 'H'])
# Define Gromacs parameters
gmx_params = {
'integrator': 'md-vv', # Verlet integrator
'nsteps': 5000, # 0.001 * 5000 = 50 ps
'dt': 0.001, # time step, in ps
# Temperature coupling is on
'tcoupl': 'nose-hoover', # Nose-Hoover thermostat
'tau_t': 0.3, # time constant, in ps
'ref_t': 300, # reference temperature, one for each group, in K
# Bond parameters
'gen_vel': 'yes', # assign velocities from Maxwell distributio
'gen_temp': 300, # temperature for Maxwell distribution
'gen_seed': -1, # generate a random seed
}
# Define simulation
calc = GromOrg(structure,
params=gmx_params, # MDP parms
box=[10, 10, 10], # a, b, c in angstrom
angles=[90, 90, 90], # alpha, beta, gamma in degree
supercell=[3, 3, 3],
delete_scratch=True, # delete temp files when finished
silent=False) # print MD log info in screen
# Run simulation and get trajectory (MDTraj) and energy
trajectory, energy = calc.run_md(whole=True)
# plot energies
plt.plot(energy['potential'], label='potential')
plt.plot(energy['kinetic'], label='kinetic')
plt.plot(energy['total'], label='total')
plt.legend()
plt.show()
# Store trajectory
trajectory.save('trajectory.gro')
Contact info
Abel Carreras
abelcarreras83@gmail.com
Donostia International Physics Center (DIPC)
Donostia-San Sebastian, Euskadi (Spain)
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
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 gromorg-0.3.2.tar.gz.
File metadata
- Download URL: gromorg-0.3.2.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ab8125f1a3f190135edac882476e1a5ae4887bf451b2fafb412b36541820802
|
|
| MD5 |
f4357d51a7beb498dd2bc5964024112a
|
|
| BLAKE2b-256 |
e53421f13486ccff15ff6e44453492958aa2133c8f869b883794b1a23d2cbe4c
|
Provenance
The following attestation bundles were made for gromorg-0.3.2.tar.gz:
Publisher:
python-publish.yml on abelcarreras/gromorg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gromorg-0.3.2.tar.gz -
Subject digest:
5ab8125f1a3f190135edac882476e1a5ae4887bf451b2fafb412b36541820802 - Sigstore transparency entry: 1319499358
- Sigstore integration time:
-
Permalink:
abelcarreras/gromorg@e1de62aa8cc40080000bbf465e2ec0f5e59a13fe -
Branch / Tag:
refs/heads/master - Owner: https://github.com/abelcarreras
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e1de62aa8cc40080000bbf465e2ec0f5e59a13fe -
Trigger Event:
push
-
Statement type:
File details
Details for the file gromorg-0.3.2-py3-none-any.whl.
File metadata
- Download URL: gromorg-0.3.2-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfa1368f589d281dbf13be3fb192a17cd0640d18e769f33a8727d92cdcef2afd
|
|
| MD5 |
87dcfd66053b86abaa16eb1b4a1614b5
|
|
| BLAKE2b-256 |
86dbd61a6dc238b770e736ea5d914eebfe82e3768f06e0d6d01f192ba73358d9
|
Provenance
The following attestation bundles were made for gromorg-0.3.2-py3-none-any.whl:
Publisher:
python-publish.yml on abelcarreras/gromorg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gromorg-0.3.2-py3-none-any.whl -
Subject digest:
bfa1368f589d281dbf13be3fb192a17cd0640d18e769f33a8727d92cdcef2afd - Sigstore transparency entry: 1319499437
- Sigstore integration time:
-
Permalink:
abelcarreras/gromorg@e1de62aa8cc40080000bbf465e2ec0f5e59a13fe -
Branch / Tag:
refs/heads/master - Owner: https://github.com/abelcarreras
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e1de62aa8cc40080000bbf465e2ec0f5e59a13fe -
Trigger Event:
push
-
Statement type: