Make_ndx interface

GROMACS version: 2020.1
GROMACS modification: No
I need to automate calls to make_ndx to create index_files. Are any/some/all of the group-options presented when calling make_ndx from the terminal constant?

For example, how many of the following option numbers are based on the input file, and which can you assume will remain for any file?

0 System : 16630 atoms
1 Protein : 22 atoms
2 Protein-H : 10 atoms
3 C-alpha : 1 atoms
4 Backbone : 5 atoms
5 MainChain : 7 atoms
6 MainChain+Cb : 8 atoms
7 MainChain+H : 9 atoms
8 SideChain : 13 atoms
9 SideChain-H : 3 atoms
10 Prot-Masses : 22 atoms
11 non-Protein : 16608 atoms
12 Water : 16608 atoms
13 SOL : 16608 atoms
14 non-Water : 22 atoms

Default groups depend on the contents of the system.

Is there perhaps a way to get make_ndx include all groups? I currently need Protein and no-Protein, the first regardless of the system and the second if the system is solvated.
Can the groups be selected by name rather than number?
Can the selections be given to make_ndx by either a parameter-file or as command line options?
As my program is already able to add on to an existing index file, perhaps it’s easier for me to generate the entire index file. Is there some documentation of the algorithms for finding the protein and non protin atoms in a .gro file?

for make_ndx, i believe you can only use number to access the group. But if you use select option, you can select with name. see example below

gmx select -f mdrun1.gro -s mdrun1.tpr -on output.ndx -select “(group protein) or (resname ATP) or (resname PBU)”

For more info, see this link:

I might be misunderstanding something or select is not up to the task I need performed. I try:
.>gmx select -f pre_mdrun.gro -on index2.ndx -select “group Protein”
.>gmx select -f pre_mdrun.gro -on index2.ndx -select “group SOL”
And I get an error message like
.>Cannot match ‘group “SOL”’, because no such index group can be found.

make_ndx finds/generates these groups in/from the .gro file but I’m unable to tell make_ndx which to include before it has determined which it can generate because what number a group gets depends on what ither groups are present in that particular .gro file.

Can select find/generate these groups on it’s own or does it need help?

If it needs help, one of my previous questions would stil be valid in if I can get make_ndx to produce an index file with all groups it could find, I would be able to use select or own scripting to get the indexes I need in my index file.

For clarity, my project is to automate a longer process in which this is an intermediary step any solution needs to be void of human interaction during the run.

So, I never realised make_ndx already includes all the groups it finds as standard. And by the time you read this I will probably be past figuring out how to bypass the make_ndx starting a user interface, being content with just the standard groups. But thank you both for offering assistance.