[gmx-users] output format of gromacs utilities

Vitaly Chaban chaban at univer.kharkov.ua
Mon Sep 22 12:10:16 CEST 2008


Jochen,

Thank you very much! I will just try it.

Vitaly


JH> 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 '&')?

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

JH> Best, Jochen


JH> #!/bin/bash

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

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

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

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

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


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

-- 
Vitaly V. Chaban
School of Chemistry
National University of Kharkiv
Svoboda sq.,4, Kharkiv 61077, Ukraine
email: chaban at univer.kharkov.ua
skype: vvchaban
tel.: +38-097-8259698




More information about the gromacs.org_gmx-users mailing list