[gmx-users] A simple XVG viewer

Tsjerk Wassenaar tsjerkw at gmail.com
Thu Nov 5 19:30:41 CET 2009


Thnx. I'll change that part  to make it more portable.

Cheers,

Tsjerk

On Thu, Nov 5, 2009 at 5:40 PM, Michael Lerner
<mglerner+gromacs at gmail.com> wrote:
> Very nice!
>
> Your termsize function doesn't seem to work on my Mac, but the one from here
> (http://www.finalcog.com/terminal-size-python) does.
>
> On Thu, Nov 5, 2009 at 11:19 AM, Tsjerk Wassenaar <tsjerkw at gmail.com> wrote:
>>
>> Hi,
>>
>> Well, if we're exchanging xvg viewers... This one I wrote for quickly
>> viewing xvg files in a terminal. It converts the graph to ascii,
>> fitting automatically to the terminal size. It can also be used to
>> generate (ramachandran) density plots. Should still add proper help
>> info, but the options are:
>>
>> -f xvg file
>> -g [optional] second xvg file to plot one against the other
>> -c column to plot
>> -d [optional] column to plot, will plot one column against the other,
>> or use this column from second xvg file if given
>> -x minimum x value
>> -X maximum X value
>> -y minimum y value
>> -Y maximum y value
>> --square force square display
>> --angles set x=-180, X=180, y=-180, Y=180
>>
>> Hope it's of some use to some one :)
>>
>> Tsjerk
>>
>> On Thu, Nov 5, 2009 at 4:29 PM, Michael Lerner
>> <mglerner+gromacs at gmail.com> wrote:
>> >
>> >
>> > On Thu, Nov 5, 2009 at 10:23 AM, Erik Marklund <erikm at xray.bmc.uu.se>
>> > wrote:
>> >>
>> >> Hi,
>> >>
>> >> So, what's the advantage over using e.g. (xm)grace?
>> >
>> > I'm not sure. The last time I tried, xmgrace refused to install on my
>> > Mac.
>> >
>> > This certainly isn't a big analysis/plotting package. It's just a quick
>> > way
>> > to step through XVG files.
>> >
>> >>
>> >> /Erik
>> >>
>> >> Michael Lerner skrev:
>> >>>
>> >>> Hi,
>> >>>
>> >>> (My apologies if this shows up several times. I sent it yesterday, but
>> >>> it
>> >>> appears that it won't go through to the list if I include a
>> >>> screenshot.)
>> >>>
>> >>> I wanted a quick way to plot the data in XVG files, so I wrote a quick
>> >>> little GUI viewer in Python this morning. You point it at an XVG file
>> >>> and it
>> >>> pops up a GUI where you can click buttons to step through the columns
>> >>> of
>> >>> data, plot individual columns from the XVG file, or make a plot of
>> >>> everything in the XVG file.
>> >>>
>> >>> This makes it easy to dump all the information from an
>> >>> .edr/trr/xtc/etc
>> >>> file and step through it visually in 30 seconds. That, in turn, makes
>> >>> me way
>> >>> more likely to look at as much information as possible as part of my
>> >>> normal
>> >>> workflow.
>> >>>
>> >>> I've only tested this on a few of my own XVG files, so it's possible
>> >>> that
>> >>> my simple XVG parser doesn't cover everything.
>> >>>
>> >>> Here's the help output. Let me know if anyone finds it useful.
>> >>>
>> >>>
>> >>> Michael-Lerners-MacBook-Pro-2: ~ mglerner$ ./xvgviewer.py --help
>> >>> Usage: Just a simple XVG viewer.
>> >>>
>> >>> For each column in the XVG file, we plot
>> >>>
>> >>>  - the raw data (light blue)
>> >>>  - a running average (black)
>> >>>  - block averages (green)
>> >>>
>> >>> We also print out
>> >>>
>> >>>  - the average over the simulation
>> >>>  - standard error over the blocks
>> >>>  - average of the standard deviations within each block
>> >>>
>> >>> Block length is reported in number of frames, and its meaning will
>> >>> therefore depend on the settings in your .mdp file as well as the
>> >>> arguments you used when making the .xvg file.
>> >>>
>> >>> We attempt to get units out of the XVG file, and we convert times to
>> >>> nanoseconds before plotting.
>> >>>
>> >>> This program requires
>> >>>
>> >>>  - Python 2.5 or 2.6
>> >>>  - wxPython 2.8.7.1+ (http://www.wxpython.org/)
>> >>>  - numpy 1.3.0+ (http://numpy.scipy.org/)
>> >>>  - matplotlib 0.99.0+ (http://matplotlib.sourceforge.net/)
>> >>>  - traits 3.2.0+ (http://code.enthought.com/projects/traits/)
>> >>>
>> >>> All of which will be installed for you if you use the Enthought Python
>> >>> Distribution (http://enthought.com/).
>> >>>
>> >>> I mostly wrote this as a quick way to figure out how to use the Traits
>> >>> GUI, but feel free to email me (m g lerner atsign gmail dot com) if
>> >>> you have any questions.
>> >>>
>> >>>
>> >>> Options:
>> >>>  -h, --help            show this help message and exit
>> >>>  -f FILE, --file=FILE  The XVG file [default energy.xvg]
>> >>>
>> >>>
>> >>> Cheers,
>> >>>
>> >>> -Michael
>> >>>
>> >>> --
>> >>> Michael Lerner, Ph.D.
>> >>> IRTA Postdoctoral Fellow
>> >>> Laboratory of Computational Biology NIH/NHLBI
>> >>> 5635 Fishers Lane, Room T909, MSC 9314
>> >>> Rockville, MD 20852 (UPS/FedEx/Reality)
>> >>> Bethesda MD 20892-9314 (USPS)
>> >>>
>> >>> ------------------------------------------------------------------------
>> >>>
>> >>> _______________________________________________
>> >>> gmx-users mailing list    gmx-users at gromacs.org
>> >>> http://lists.gromacs.org/mailman/listinfo/gmx-users
>> >>> Please search the archive at http://www.gromacs.org/search before
>> >>> posting!
>> >>> Please don't post (un)subscribe requests to the list. Use the www
>> >>> interface or send it to gmx-users-request at gromacs.org.
>> >>> Can't post? Read http://www.gromacs.org/mailing_lists/users.php
>> >>
>> >>
>> >> --
>> >> -----------------------------------------------
>> >> Erik Marklund, PhD student
>> >> Laboratory of Molecular Biophysics,
>> >> Dept. of Cell and Molecular Biology, Uppsala University.
>> >> Husargatan 3, Box 596,    75124 Uppsala, Sweden
>> >> phone:    +46 18 471 4537        fax: +46 18 511 755
>> >> erikm at xray.bmc.uu.se    http://xray.bmc.uu.se/molbiophys
>> >>
>> >> _______________________________________________
>> >> gmx-users mailing list    gmx-users at gromacs.org
>> >> http://lists.gromacs.org/mailman/listinfo/gmx-users
>> >> Please search the archive at http://www.gromacs.org/search before
>> >> posting!
>> >> Please don't post (un)subscribe requests to the list. Use the www
>> >> interface or send it to gmx-users-request at gromacs.org.
>> >> Can't post? Read http://www.gromacs.org/mailing_lists/users.php
>> >
>> >
>> >
>> > --
>> > Michael Lerner, Ph.D.
>> > IRTA Postdoctoral Fellow
>> > Laboratory of Computational Biology NIH/NHLBI
>> > 5635 Fishers Lane, Room T909, MSC 9314
>> > Rockville, MD 20852 (UPS/FedEx/Reality)
>> > Bethesda MD 20892-9314 (USPS)
>> >
>> > _______________________________________________
>> > gmx-users mailing list    gmx-users at gromacs.org
>> > http://lists.gromacs.org/mailman/listinfo/gmx-users
>> > Please search the archive at http://www.gromacs.org/search before
>> > posting!
>> > Please don't post (un)subscribe requests to the list. Use the
>> > www interface or send it to gmx-users-request at gromacs.org.
>> > Can't post? Read http://www.gromacs.org/mailing_lists/users.php
>> >
>>
>>
>>
>> --
>> Tsjerk A. Wassenaar, Ph.D.
>> Junior UD (post-doc)
>> Biomolecular NMR, Bijvoet Center
>> Utrecht University
>> Padualaan 8
>> 3584 CH Utrecht
>> The Netherlands
>> P: +31-30-2539931
>> F: +31-30-2537623
>>
>> _______________________________________________
>> gmx-users mailing list    gmx-users at gromacs.org
>> http://lists.gromacs.org/mailman/listinfo/gmx-users
>> Please search the archive at http://www.gromacs.org/search before posting!
>> Please don't post (un)subscribe requests to the list. Use the
>> www interface or send it to gmx-users-request at gromacs.org.
>> Can't post? Read http://www.gromacs.org/mailing_lists/users.php
>
>
>
> --
> Michael Lerner, Ph.D.
> IRTA Postdoctoral Fellow
> Laboratory of Computational Biology NIH/NHLBI
> 5635 Fishers Lane, Room T909, MSC 9314
> Rockville, MD 20852 (UPS/FedEx/Reality)
> Bethesda MD 20892-9314 (USPS)
>
> _______________________________________________
> gmx-users mailing list    gmx-users at gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-users
> Please search the archive at http://www.gromacs.org/search before posting!
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-users-request at gromacs.org.
> Can't post? Read http://www.gromacs.org/mailing_lists/users.php
>



-- 
Tsjerk A. Wassenaar, Ph.D.
Junior UD (post-doc)
Biomolecular NMR, Bijvoet Center
Utrecht University
Padualaan 8
3584 CH Utrecht
The Netherlands
P: +31-30-2539931
F: +31-30-2537623



More information about the gromacs.org_gmx-users mailing list