Creating mixed crystals with insert-molecules

GROMACS version: 2019.3
GROMACS modification: No

Hi I’m trying to create a mixed crystal but I’m not managing. I have the unit cell of a crystal of a small (highly linear) molecule (each unit cell is made up of 4 identical molecules with each having a different orientation in space), and I want to replace some of the molecules with a similar, slightly smaller molecule. I have the gro file of the second molecule as well, which I obtained from its unit cell file, so the conformation of the second molecule isn’t random, but follows the exact conformation of the other crystal.

What I want to do is remove some molecules from the original crystal box and replace them with molecules of the second molecule, in the exact same space and orientation, i.e. not with a random orientation, or the removal of more molecules from the original crystal to make space for the second molecule. Given that the second molecule is slightly smaller than the original molecule it should fit nicely (even leave a bit of space), but every time I try with insert-molecules I’m not managing to insert it in the position I want or without the removal of other extra molecules from the original crystal.

I’m guessing I need to use the -ip flag but I’m not really sure how to go about it (I’ve tried it already, but with little success).

Any ideas on how to do this please?



I’d do it via editing the text files then translations with VMD. Combine the required molecules into a coordinate file, load using VMD, then use the move molecule/residue option, get it aligned into the correct position, then export it.

Thanks Dr_DBW. In the end I think I managed as follows:

  1. centred the destination box by using editconf -c
  2. centred the single molecules to be inserted at 0 0 0 by using editconf -center 0 0 0
  3. got the geometric centre of the molecules I want to remove/replace in my box by taking the x y and z coordinates for those molecules from the box’s gro file and then averaging them
  4. pasted those coordinates in the positions.dat file
  5. then used the following command to insert/replace 10 molecules in the box gmx insert-molecules -f box.gro -o box2.gro -ci molecule.gro -rot none -ip -nmol 10 -replace
    5.1 -rot none keeps the rotation of the molecule to be inserted as it is in the original gro file
    5.2 -ip calls up the positions.dat file so that insert-molecules knows where to insert the single molecules, and not just try and place them randomly
    5.3 -replace will ask you which molecules you want to replace
  6. I then ran pdb2gmx (even if it was with an initial gro file, not pdb) to get the box’s topology

Great that you found a way to do it, and bonus points for returning here and answering your own question.

FYI you only need to run pdb2gmx for a single molecule, it doesn’t have to be a fully constructed system, and it can be any coordinate file. I actually only use .gro files. Plus I run it on single molecules i.e. a peptide, then convert that into .itp. Means I have a library of molecules and topologies, that pull out and add to my system as needed. Helps keep the .top more sane and readable too.