Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abelcarreras/gromorg
A python GROMACS interface for MD simulations of organic molecular crystals
https://github.com/abelcarreras/gromorg
gromacs molecular-dynamics molecular-mechanics python simulation
Last synced: 2 months ago
JSON representation
A python GROMACS interface for MD simulations of organic molecular crystals
- Host: GitHub
- URL: https://github.com/abelcarreras/gromorg
- Owner: abelcarreras
- License: mit
- Created: 2021-06-10T16:46:28.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-15T14:46:38.000Z (about 2 years ago)
- Last Synced: 2024-10-12T06:28:39.613Z (3 months ago)
- Topics: gromacs, molecular-dynamics, molecular-mechanics, python, simulation
- Language: Python
- Homepage: https://gromorg.readthedocs.io
- Size: 267 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Documentation Status](https://readthedocs.org/projects/gromorg/badge/?version=latest)](https://gromorg.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/gromorg.svg)](https://badge.fury.io/py/gromorg)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 (gmxapi) (http://www.gromacs.org)
- Openbabel v2.x (python API) (http://openbabel.org)
- MDtraj (https://www.mdtraj.org)Basic example
-------------
```python
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
[email protected]Donostia International Physics Center (DIPC)
Donostia-San Sebastian, Euskadi (Spain)