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

Vedat Durmaz durmaz at zib.de
Tue Dec 18 10:12:41 CET 2012


there's also an executable topology merger available written in python 
called "gromacs_topology_merger.py" as part of a the software package 
"ZIBMolPy" designed for conformational analysis at

https://github.com/CMD-at-ZIB/ZIBMolPy

given (in the same directory) a topology file "topol.top" (argument 1) 
and two (or more) itp files "mol1.itp" and "mol2.itp" included in the 
top file, the tool writes out a new topology file (argument 2) merging 
the first two molecules from the include sequence of which itp files are 
given.

note: the number of molecules to be merged should be 1 in the [ 
molecules ] section. if one of them is meant to appear multiple times in 
the merged topology, the process needs to be repeated accordingly.

vedat


Am 18.12.2012 09:38, schrieb Erik Marklund:
> 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