Giter Site home page Giter Site logo

krassowski / vmd-agr-parser Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 133 KB

Simple script for plotting .agr (Grace) files created with VMD (Visual Molecular Dynamics). Allows export to csv/svg/png.

License: MIT License

Python 100.00%
agr vmd grace visual-molecular-dynamics agr-files matplotlib plot

vmd-agr-parser's Introduction

VMD-generated .agr files parser

MIT License DOI

Simple script for plotting .agr (Grace) files created with VMD (Visual Molecular Dynamics). Allows export to csv/svg/png.

VMD allows generation of .agr files which are no longer properly interpreted by xmgrace software. This small tool allows to quickly plot data from an agr file (using matplotlib underneath) or to export the data to other formats.

Show off

./plot.py example.agr -t 'Energy of Topoisomerase I' -x 'Time (ns)' -y 'Energy (kcal/mol)' -l 1 0.6 -s 0.005 1 -e png

Preview

Installation

Python 3.5 is required. You can download the code from repository, for example with:

git clone https://github.com/krassowski/vmd-agr-parser
cd vmd-agr-parser

If you want to create plots matplotlib will be required:

pip3 install --user matplotlib

If it does not work, look at How to get pip? section.

Example usages:

Plot from file:

./plot.py example.agr

Export to csv (no matplotlib required):

./plot.py example.agr --export csv --do_not_plot

Plot and export to svg:

./plot.py example.agr --export svg

Restrict to only one variable and change legend position:

./plot.py example.agr --restrict_to 'Total Energy' --legend_position 1 0.12

Set title and axes names:

./plot.py example.agr --title 'Energy of Topoisomerase I in complex with SRSF6' -x 'Simulation frame' -y 'Energy (kcal/mol)'

Rescale plot axes so units can be shown:

./plot.py example.agr --scale 0.005 1 -x 'Time (ns)'

Use custom labels in legend:

./plot.py example.agr --restrict_to 'Total Energy' 'Bond Energies' --labels 'Total energy (includes vdW)' 'Bond energies'

Help summary:

./plot.py example.agr -h
usage: plot.py [-h] [--do_not_plot] [-t TITLE] [-x AXIS_X] [-y AXIS_Y]
               [-r RESTRICT_TO [RESTRICT_TO ...]] [-e {csv,svg,png,jpg}]
               [-s SCALE SCALE] [-l LEGEND_POSITION LEGEND_POSITION]
               [--labels LABELS [LABELS ...]]
               input_file

How to get pip?

If you do not have pip3, try python3 -m pip or just pip. Some Linux distributions have package named like python3-pip.

If everything fails, you can install pip with:

wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py --user

vmd-agr-parser's People

Contributors

krassowski avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

atilaac

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.