Coder Social home page Coder Social logo

pdb2lmp's Introduction

pdb2lmp

Python 3 script to create a LAMMPS topology from a PDB file, or from any other file format supported by OpenBabel.

The highlight of this implementation in comparison with others is that it detects bonds across periodic boundary conditions. This may be important in models for solids, surfaces or nanostructures that include bonded terms and are periodic in one or more directions.

You are free to use whatever you want to generate the initial structure (PDB file). For example, packmol is a very powerful tool.

Installing dependencies

The dependencies can be easy installed using Anaconda:

conda install -c conda-forge ase
conda install -c conda-forge openbabel

Usage

You can check the command line options with:

python /path/to/pdb2lmp.py -h

The basic usage (with default parameters) is just:

python /path/to/pdb2lmp.py structure.pdb > my_topology.lmp

The simulation box size is determined by the CRYST1 line in the PDB file, or the --box-size option, or by automatic detection. You can use the --buffer-length-axis and --buffer-length-orthogonal options to set an extra buffer to be added in the axial and perpendicular directions, respectively.

The --axis option can be used when the structure has some kind of axial symmetry, such as in nanotubes. You can run the script with the -h option to see a help with all the available options.

A simple example of the usage for a box full of water molecules can be seen here.

Contributing

Feel free to create issues reporting bugs and/or suggesting enhancements, I'll address them as soon as possible. Pull requests are also encouraged.

pdb2lmp's People

Contributors

hmcezar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.