[gmx-users] how to strip velocities out of a .gro file

Tsjerk Wassenaar tsjerkw at gmail.com
Tue Jul 6 08:28:19 CEST 2010


Hi Chris,

That was indeed what happened with the first version. The '$q' bails out at
the last line without editing.
Of course it's also easy to write a python script doing it, combined with
find -exec.

Cheers,

Tsjerk

On Jul 5, 2010 11:57 PM, "Chris Neale" <chris.neale at utoronto.ca> wrote:

Shay: that's a better idea than I had, thanks.

Tsjerk: that's likely as fast as its ever going to get. this is great. I was
initially worried that it would mangle the last line of the .gro in a
triclinic box definition, but it seems to be ok.

Thanks all,
Chris.


-- original message --

What about:

find . -name "*.gro" -exec sed -i -e '$q' -e '3,$s/^\(.\{44\}.\).*$/\1/' {}
\;

Assuming using a format %8.3f for coordinates and a single frame in
the .gro file. Otherwise things will get more complicated.

Cheers,

Tsjerk

On Sun, Jul 4, 2010 at 12:45 AM,  <shayamra at post.tau.ac.il <
http://lists.gromacs.org/mailman/listinfo/gmx-users>> wrote:

> / How about:
>
/>/ 1. editconf -f file1.gro -o file1.pdb
/>/ 2. editconf -f file1.pdb -o file1_no_vel.gro
/>/ :-)
/>/ PDB contains just coordinates of atoms, so when you convert pdb to gro
/>/ again, you won't have the velocities.
/>/
/>/ Regards,
/>/ -Shay
/>/
/>/
/>/ Quoting chris.neale at utoronto.ca <
http://lists.gromacs.org/mailman/listinfo/gmx-users>:
/>/
/>>/ If you have a directory full of .gro files that contain velocities, and
if
/>>/ you don't need those velocities, then you're taking up too much space
on
/>>/ your drive.
/>>/
/>>/ It's too bad, but trjconv -novel -f in.gro -o out.gro will still write
the
/>>/ velocities to out.gro.
/>>/
/>>/ Here's a small script to strip the velocities out of a directory of
.gro
/>>/ files. If anybody has a better idea of how to do this, then please post
;)
/>>/
/>>/ #!/bin/bash
/>>/ for i in $(ls *.gro); do
/>>/  echo 0|trjconv -f $i -o a.xtc -novel -s $i;
/>>/  echo 0|trjconv -f a.xtc -novel -s $i -o a.gro;
/>>/  mv a.gro $i;
/>>/  rm a.xtc;
/>>/ done
/>>/
/>>/ --
/>>/ gmx-users mailing list    gmx-users at gromacs.org <
http://lists.gromacs.org/mailman/listinfo/gmx-users>
/>>/ 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 thewww
interface
/>>/ or send it to gmx-users-request at gromacs.org. <
http://lists.gromacs.org/mailman/listinfo/gmx-users>
/>>/ Can't post? Read http://www.gromacs.org/mailing_lists/users.php
/>>/
/

-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20100706/7fe76cfe/attachment.html>


More information about the gromacs.org_gmx-users mailing list