Metadata-Version: 2.2
Name: mdscribe
Version: 0.5.1
Summary: A Toolset For Molecular Dynamics
Author-email: Sung-Hun Bae <sunghun.bae@gmail.com>
Maintainer-email: Sung-Hun Bae <sunghun.bae@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/sunghunbae/mdscribe
Project-URL: Documentation, https://github.com/sunghunbae/mdscribe
Project-URL: Repository, https://github.com/sunghunbae/mdscribe.git
Project-URL: Issues, https://github.com/sunghunbae/mdscribe/issues
Project-URL: Changelog, https://github.com/sunghunbae/mdscribe/blob/master/CHANGELOG.md
Keywords: MD,Molecular Dynamics,OpenMM,Desmond,Amber
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: pyparsing>=3.0
Requires-Dist: dotmap>=1.3
Requires-Dist: openmm
Requires-Dist: mkdocstrings-python

Python Utilities for Molecular Dynamics
=======================================

Introduction
============

MDScribe is a set of command-line scripts and a library written to make 
setting up the molecular dynamics simulations easier for Desmond, OpenMM, and Amber.

Install
===============

```shell
$ pip install mdscribe
```

Usage for Desmond
=================

```python
from mdscribe.desmond import Multisim

# read template .msj and .cfg
md_msj = Multisim(template="desmond-md.msj")
md_cfg = Multisim(template="desmond-md.cfg")

with open(msj_file,"w") as msj:
    # modify desmond msj template
    md_msj.dot.simulate[-1].cfg_file = cfg_file_basename
    
    # Setting up restraints using the restraints keyword:
    # https://www.schrodinger.com/kb/332119
    if args.posres_force > 0.0:
        # print the restraints in the multisim log file
        md_msj.dot.simulate[-1].print_restraint = 'true'

        # add the new terms defined in "restraints.new" to existing restraints.
        # The default is restraints.existing = ignore which will 
        # delete existing terms before adding any new ones.
        # md_msj.dot.simulate[-1].restraints.existing = 'retain'

        md_msj.dot.simulate[-1].restraints.new = [
            {
                'name'              : 'posre_harm',
                'atoms'             : [ f'"{args.posres}"' ],
                'force_constants'   : [ args.posres_force, ] * 3,
            }
            ]
        # force constants in the x, y, and z direction

    md_msj.write(msj)

with open(cfg_file,"w") as cfg:
    # modify desmond cfg template
    md_cfg.dot.randomize_velocity.seed = random.randint(1000, 9999)
    md_cfg.dot.time = total_simulation_time
    md_cfg.dot.temperature = t_schedule
    md_cfg.dot.trajectory.interval = args.interval
    md_cfg.write(cfg)
```
