I have a structure (.gro) file of a PolyEthylene Glycol (PEG) molecule as shown below. How do I get the corresponding structure file for PEG-20 i.e., a molecule with a degree of polymerization=20, containing only PEG molecules)

    1PEG      H    1   2.032   1.593   1.545  0.6568  2.5734  1.2192
    1PEG      C    2   1.929   1.614   1.508  0.1558 -0.2184  0.8547
    1PEG     H1    3   1.902   1.721   1.523 -3.6848 -0.3932 -3.0658
    1PEG     H2    4   1.921   1.588   1.400 -1.5891  1.4960  0.5057
    1PEG      O    5   1.831   1.544   1.576  0.0564 -0.5300 -0.6094
    1PEG     H3    6   1.676   1.665   1.494 -2.6585 -0.5997  0.3128
    1PEG     C1    7   1.699   1.559   1.519  0.6996  0.0066  0.2900
    1PEG     H4    8   1.699   1.500   1.425  4.2893  1.6837 -0.9462
    1PEG     H5    9   1.598   1.510   1.623  1.3303  1.7486 -1.1622
   3.00000   3.00000   3.00000
  • $\begingroup$ I came across this github.com/simongravelle/PEGgenerator today, check whether it is gonna be helpful for your case. $\endgroup$ Feb 27 at 13:17
  • $\begingroup$ @JaafarMehrez what do I do if I want a more generalized solution? $\endgroup$
    – Pranoy Ray
    Feb 27 at 21:18
  • $\begingroup$ I am not sure and I am not that familiar with .gro format but I think the approach in PEGgenerator shall give you a hint. At first, I was thinking of repeating this building unit to have 180 PEG with simple python script, I did try but it turned out to be not that simple. $\endgroup$ Feb 28 at 2:43
  • $\begingroup$ you can use gmx trjconv command. First make index file of 20 PEG using gmx make_ndx command and then use gmx trjconv to print gro file of perticular index. $\endgroup$
    – Shivnandi
    Mar 6 at 11:27
  • $\begingroup$ what are the last three columns in the gro file? $\endgroup$ Mar 6 at 17:20

2 Answers 2


I would like to suggest any easy tools for this if you don't want to code. You can use CHARMM Polymer builder for this purpose. In CHARMM Polymer builder, under a single chain, look for Polyethylene oxide, and specify the degree of polymerization you want. If you want to take the initial structure for the monomer, you need to code, which I think is trivial.


Regardless of whether you just want to build a 3D structure of PEG20 (which requires only the .gro file), or actually simulate it (which requires both, a .gro file and a topology), I wouldn't start building a polymer by hand - chances are you'll end up wasting a lot of time. There are a number of tools available for generating polymer chains of various lengths. I'd start by trying either one of these two:

  1. CHARMM-GUI Polymer builder: Easy as can be, just create an account and start building.
  2. PolyPly (https://pypi.org/project/polyply/): A powerful piece of software that has a lot of capabilities, including building linear/branched polymers. Usage is not as easy as CHARMM-GUI, but that's what the tutorials are there for.

The key things you need are 1) A sensible starting structure, and 2) A [forcefield] compatible topology (assuming you want to run a simulation). CHARMM-GUI produces, as the name suggests, CHARMM compatible files. PolyPly prepackaged with a number of force fields, so you can take your pick.

  • $\begingroup$ +1 and welcome to our community! I see that you've been around for a couple years but this is your first answer. Thank you for contributing to the site, and we hope to see much more of you in the future !!! $\endgroup$ Mar 8 at 15:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .