[gmx-users] How to combine two gro files in one big file

Justin A. Lemkul jalemkul at vt.edu
Wed May 26 00:25:56 CEST 2010

> Hi Yan,
> You can do it by converting your both gro file into pdb files and 
> concatenating both  pdb files into one file . and you can convert pdb 
> into gro using editconf
> steps are as follows:
> 1. editconf -f 1.gro -o 1.pdb
> 2. editconf -f 2.gro -o 2.pdb
> 3. cat 1.pdb 2.pdb > both.pdb
> you need to delete unnecessary line i.e. CRYST1 or END from you both.pdb 
> file
> 4. editconf -f both.pdb -o both.gro 

Conversion back and forth between .pdb and .gro is not required (but it does 
work).  The main point of creating a concatenated file is that both molecules 
are placed correctly within the same box, so for each:

editconf -f 1.gro -o 1_newbox.gro -center x y z -box x y z
(and the same for molecule 2)

Getting the molecule positions and box vectors right is the real trick.

Then concatenate, remove unnecessary box and header lines in the middle of the 
file, correct the atom count and you're done.


> --
> Vandana Kumari
> ------------------------------------------------------------------------
> *From:* gmx-users-bounces at gromacs.org [gmx-users-bounces at gromacs.org] on 
> behalf of Yan Gao [y1gao at ucsd.edu]
> *Sent:* Tuesday, May 25, 2010 5:33 PM
> *To:* Discussion list for GROMACS users
> *Subject:* [gmx-users] How to combine two gro files in one big file
> Hi there,
> I want to simulate two molecules which are identical, and one is 
> rotated/translated from another. I have the gro file for one molecule.
> I tried editconf, which helped manipulate the molecule. Then I want to 
> combine it with the original gro file, so that the two identical 
> molecules are placed in one file. I searched the manual but could not 
> find a proper command. Could anyone help? Thanks.
> -- 
> Yan


Justin A. Lemkul
Ph.D. Candidate
ICTAS Doctoral Scholar
Department of Biochemistry
Virginia Tech
Blacksburg, VA
jalemkul[at]vt.edu | (540) 231-9080


More information about the gromacs.org_gmx-users mailing list