Creating ndx files


I would like to know is there a gromacs method to create index files (ndx) files showing the atoms of sulfonated carbons and non-sulfonated carbons in the sulfonated polystyrene polymer system.



Have you tried? gmx make_ndx
To my knowledge that the only way to create an index file in gromacs atoms in your system.

On a second thought, are you asking how to define the atoms of your interest for creating groups in index file?

There is also gmx select, which can write index files with the -on option, though I’ve never used it myself.

The selection syntax is explained here.

Selecting the sulfonated carbons should work analogous to the first example (selecting oxygen in water):

resname SOL and name OW

Just replace SOL with the residue name of the polystyrene and OW with the atomname of the sultanated carbon.

For the other group you can list the atom names for the other carbons.

Maybe even something like this works:

resname STYR and type C and not name CS

(assuming the residue name is STYR and type C selects by element and not by atomtype of the forcefield; as I said, I’ve never tried gmx select)