[gmx-users] merge .gro, .top files

Erik Marklund erikm at xray.bmc.uu.se
Tue Dec 18 09:38:41 CET 2012


18 dec 2012 kl. 09.30 skrev Tsjerk Wassenaar:

> Hi KT,
> 
> If you mean concatenating frames in .gro files, you can use trjcat or just
> cat. If you mean merging the coordinates, it's a wee bit more complicated.
> Since you also ask for top files, I guess that's the case. Here's a snippet
> of python code that will do the trick:
> 
> #!/usr/bin/env python
> 
> import sys
> 
> f = [open(i).readlines() for i in sys.argv[1:]]
> print "Merged gro file\n%5d" % (sum([len(i) for i in f]) - 3*len(f))
> print "".join(["".join(i[2:-1]) for i in f]),
> print f[0][-1]
> 
> 
> For the top files, it is necessary to ensure all the moleculetypes are
> #included, and that the [ molecules ] listing under [ system ] has the
> right number and order of the molecules in the merged gro file. There's no
> tool for that that I know of.

In principle you could use grompp for checking that. It would print out a heap of warinngs/notes/errors if structure file and topology don't match.

Erik

> 
> Cheers,
> 
> Tsjerk
> 
> 
> On Tue, Dec 18, 2012 at 6:18 AM, Kieu Thu Nguyen <kieuthu2212 at gmail.com>wrote:
> 
>> Dear All,
>> 
>> I don't know which tools used to merge 2 files .gro, 2 files .top ?
>> Can i use trjcat ?
>> 
>> Thanks !
>> KT
>> --
>> 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/Support/Mailing_Lists/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/Support/Mailing_Lists
>> 
> 
> 
> 
> -- 
> Tsjerk A. Wassenaar, Ph.D.
> 
> post-doctoral researcher
> Biocomputing Group
> Department of Biological Sciences
> 2500 University Drive NW
> Calgary, AB T2N 1N4
> Canada
> -- 
> 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/Support/Mailing_Lists/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/Support/Mailing_Lists

-----------------------------------------------
Erik Marklund, PhD
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596,    75124 Uppsala, Sweden
phone:    +46 18 471 6688        fax: +46 18 511 755
erikm at xray.bmc.uu.se
http://www2.icm.uu.se/molbio/elflab/index.html




More information about the gromacs.org_gmx-users mailing list