# Wrong numbers of atoms in groups obtained with make\_ndx

**URL:** https://gromacs.bioexcel.eu/t/wrong-numbers-of-atoms-in-groups-obtained-with-make-ndx/8817
**Category:** User discussions
**Tags:** analysis-tools
**Created:** [April 8, 2024, 7:29am UTC](https://gromacs.bioexcel.eu/t/wrong-numbers-of-atoms-in-groups-obtained-with-make-ndx/8817 "2024-04-08T07:29:16Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![TommasoChemEng](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@TommasoChemEng](https://gromacs.bioexcel.eu/u/TommasoChemEng)
#### Post date: [April 8, 2024, 7:29am UTC](https://gromacs.bioexcel.eu/t/wrong-numbers-of-atoms-in-groups-obtained-with-make-ndx/8817/1 "2024-04-08T07:29:16Z")

</div>

GROMACS version: 2022.5  
GROMACS modification: PLUMED 2.8.3 patch

Dear GROMACS users and developers,  
I would like to use make\_ndx to create groups of atoms to be subsequently used with gmx angle. I am interested in dihedrals.

In my system I have 256 identical molecules and of course the atoms have unique names. So, every group for dihedral angles must contain 256\*4 = 1024 atoms.

Some groups contain the correct number of atoms, while some other groups contains more or less atoms than expected.

I also tried to use mk\_angndx but it gives an empty file.

Do you know which may be the issue and how I can solve it?  
Moreover, has this issue an impact only on indeces or can it affect also the simulations themselves?

I thank you in advance for you suggestions.

Thanks and best regards,  
Tommaso

---

<div class="post-metadata">

### Author: ![askforarun](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@askforarun](https://gromacs.bioexcel.eu/u/askforarun)
#### Post date: [April 8, 2024, 8:46am UTC](https://gromacs.bioexcel.eu/t/wrong-numbers-of-atoms-in-groups-obtained-with-make-ndx/8817/2 "2024-04-08T08:46:23Z")

</div>

Make sure that your topology file has angles and dihedrals defined when you want to make use of mk\_angndx.  
You can check your apr file by using gmx dump.

Arun

---

<div class="post-metadata">

### Author: ![TommasoChemEng](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@TommasoChemEng](https://gromacs.bioexcel.eu/u/TommasoChemEng)
#### Post date: [April 8, 2024, 2:50pm UTC](https://gromacs.bioexcel.eu/t/wrong-numbers-of-atoms-in-groups-obtained-with-make-ndx/8817/3 "2024-04-08T14:50:59Z")

</div>

Hi,  
thanks a lot for your reply and for your suggestion - I was not aware of this gmx dump utility, so good to know.

I tried to run gmx dump, using the following command:

gmx dump -s Dyn.tpr -param -nonr \> Gmx\_dump.dat

The bonded interactions are equal to the ones listed in the topology.  
I ran again mk\_angndx, and I discovered that I made a mistake - I am interested in dihedral angles, but I needed to specify “-type ryckaert-bellemans” instead of “-type dihedrals”.  
In this case mk\_angndx worked since I obtained a non-empty index file, here called angle.ndx.

But when I run gmx angle:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/6/651530691fa687658a709a0f11ec96a572c18ea3.png)

I still obtain an inconsistent number of atoms in the groups in the index file.  
Are there some mistakes from my side?

Thanks and best regards,  
Tommaso

---

<div class="post-metadata">

### Author: ![askforarun](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@askforarun](https://gromacs.bioexcel.eu/u/askforarun)
#### Post date: [April 9, 2024, 1:04pm UTC](https://gromacs.bioexcel.eu/t/wrong-numbers-of-atoms-in-groups-obtained-with-make-ndx/8817/4 "2024-04-09T13:04:10Z")

</div>

Hi difficult to say what is the mistake you are making.  
Can you paste the error along with the input you provided.

---

<div class="post-metadata">

### Author: ![TommasoChemEng](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@TommasoChemEng](https://gromacs.bioexcel.eu/u/TommasoChemEng)
#### Post date: [April 10, 2024, 8:21am UTC](https://gromacs.bioexcel.eu/t/wrong-numbers-of-atoms-in-groups-obtained-with-make-ndx/8817/5 "2024-04-10T08:21:09Z")

</div>

Thanks for your reply.

The problem is that I do not receive any error message.

I try to build the index file that contains atom groups for dihedrals to further use it with gmx angle, but the number of atoms is wrong.

This is the sequence of operations:

gmx mk\_angndx -s Dyn10.tpr -type ryckaert-bellemans -o angle.ndx  
gmx angle -type ryckaert-bellemans -n angle.ndx -f Dyn10\_whole.xtc

You can see the output from gmx angle (in terms of groups) in the image in my previous post.

No errors, everything works smoothly. Some groups seem to be not correct, because the correct number of atoms for each group should be 256\*4 = 1024 since I have 256 identical molecules (= same compound) in the system.

---

<div class="post-metadata">

### Author: ![askforarun](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@askforarun](https://gromacs.bioexcel.eu/u/askforarun)
#### Post date: [April 10, 2024, 8:47am UTC](https://gromacs.bioexcel.eu/t/wrong-numbers-of-atoms-in-groups-obtained-with-make-ndx/8817/6 "2024-04-10T08:47:24Z")

</div>

Grouping is done based on dihedral/angle parameters. So if you have its/top you can look at the dihedral section and count the number of dihedrals that has parameters A1=3.26
