# Make\_ndx interface

**URL:** <https://gromacs.bioexcel.eu/t/make-ndx-interface/142>\
**Category:** User discussions\
**Created:** [May 15, 2020, 2:09pm UTC](https://gromacs.bioexcel.eu/t/make-ndx-interface/142 "2020-05-15T14:09:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpaceDucK](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@SpaceDucK](https://gromacs.bioexcel.eu/u/SpaceDucK)\
**Post date:** [May 15, 2020, 2:09pm UTC](https://gromacs.bioexcel.eu/t/make-ndx-interface/142/1 "2020-05-15T14:09:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [May 15, 2020, 2:22pm UTC](https://gromacs.bioexcel.eu/t/make-ndx-interface/142/2 "2020-05-15T14:22:07Z")

</div>

Default groups depend on the contents of the system.

[http://manual.gromacs.org/documentation/current/reference-manual/analysis/using-groups.html#default-groups](http://manual.gromacs.org/documentation/current/reference-manual/analysis/using-groups.html#default-groups)

---

<div class="post-metadata">

**Author:** ![SpaceDucK](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@SpaceDucK](https://gromacs.bioexcel.eu/u/SpaceDucK)\
**Post date:** [May 15, 2020, 2:29pm UTC](https://gromacs.bioexcel.eu/t/make-ndx-interface/142/3 "2020-05-15T14:29:16Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Teslim](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@Teslim](https://gromacs.bioexcel.eu/u/Teslim)\
**Post date:** [May 16, 2020, 3:44pm UTC](https://gromacs.bioexcel.eu/t/make-ndx-interface/142/4 "2020-05-16T15:44:27Z")

</div>

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: [http://biophysics.med.jhmi.edu/~yliu120/tutorials.html](http://biophysics.med.jhmi.edu/~yliu120/tutorials.html)

---

<div class="post-metadata">

**Author:** ![SpaceDucK](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@SpaceDucK](https://gromacs.bioexcel.eu/u/SpaceDucK)\
**Post date:** [May 17, 2020, 8:16am UTC](https://gromacs.bioexcel.eu/t/make-ndx-interface/142/5 "2020-05-17T08:16:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![SpaceDucK](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@SpaceDucK](https://gromacs.bioexcel.eu/u/SpaceDucK)\
**Post date:** [May 17, 2020, 8:33am UTC](https://gromacs.bioexcel.eu/t/make-ndx-interface/142/6 "2020-05-17T08:33:39Z")

</div>

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.
