[gmx-users] output format of gromacs utilities

Jochen Hub jhub at gwdg.de
Mon Sep 22 11:05:58 CEST 2008


Vitaly Chaban wrote:
> Hello,
> 
> In gromacs analysis tools, is it possible to output multiple data
> columns as several 'parallel' columns (not as pairs delimited by '&')?

I don't think so, but i once wrote a script that does the transformation
for you. Here it is.

Best, Jochen


#!/bin/bash

tmpdir=xxxxx.tmp
rm -fr $tmpdir
mkdir $tmpdir

echo Removing comments...
egrep -v '^@|^#' $1 > $tmpdir/xxx.tmp

here=`pwd`
cd $tmpdir
echo "Splitting $1 at &'s ..."
csplit -n 5 --silent xxx.tmp '/&/' '{*}'
grep '[0-9]' xx00000 | awk '{print $1}' > times.tmp

rm -f yy*[0-9]
for i in xx[0-9][0-9][0-9][0-9][0-9]; do
    nr=$(echo $i|tr -cd [:digit:])
    if grep -q '[0-9]' $i; then
        echo writing yy$nr ...
        grep '[0-9]' $i | awk '{print $2}' > yy$nr
    fi
done

out=${1%%.xvg}.dat
paste -d ' ' times.tmp yy[0-9][0-9][0-9][0-9][0-9] > $out
echo created ${1%%.xvg}.dat


> 
> I experience difficulties to read such (xvg) format by sigmaplot.
> 
> 


-- 
************************************************
Dr. Jochen Hub
Max Planck Institute for Biophysical Chemistry
Computational biomolecular dynamics group
Am Fassberg 11
D-37077 Goettingen, Germany
Email: jhub[at]gwdg.de
Tel.: +49 (0)551 201-2312
************************************************



More information about the gromacs.org_gmx-users mailing list