# GMX\_order - Fatal error: grp 1 does not have same number of elements as grp 1

**URL:** <https://gromacs.bioexcel.eu/t/gmx-order-fatal-error-grp-1-does-not-have-same-number-of-elements-as-grp-1/7187>\
**Category:** User discussions\
**Tags:** analysis-tools\
**Created:** [September 14, 2023, 11:14am UTC](https://gromacs.bioexcel.eu/t/gmx-order-fatal-error-grp-1-does-not-have-same-number-of-elements-as-grp-1/7187 "2023-09-14T11:14:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@Joseph](https://gromacs.bioexcel.eu/u/Joseph)\
**Post date:** [September 14, 2023, 11:14am UTC](https://gromacs.bioexcel.eu/t/gmx-order-fatal-error-grp-1-does-not-have-same-number-of-elements-as-grp-1/7187/1 "2023-09-14T11:14:46Z")

</div>

GROMACS version: 2022  
GROMACS modification: No

I am trying to run deuterium order parameter analysis on SAPE lipids of a heterogenous membrane. I made the index file for the first acyl chain using the following:

gmx\_mpi make\_ndx -f prot\_eql.gro -o index\_sape.ndx

First Prompt Selection:  
r SAPE & a C36| r SAPE & a C37| r SAPE & a C38| r SAPE & a C39| r SAPE & a C40| r SAPE & a C41| r SAPE & a C42| r SAPE & a C43| r SAPE & a C44| r SAPE & a C45| r SAPE & a C46| r SAPE & a C47| r SAPE & a C48| r SAPE & a C49| r SAPE & a C50| r SAPE & a C51| r SAPE & a C52| r SAPE & a C53| r SAPE & a C54| r SAPE & a C55| r SAPE & a C56| r SAPE & a C57| r SAPE & a C58| r SAPE & a C59| r SAPE & a C60| r SAPE & a C61| r SAPE & a C62| r SAPE & a C63| r SAPE & a C64| r SAPE & a C65| r SAPE & a C66| r SAPE & a C67| r SAPE & a C68| r SAPE & a C69| r SAPE & a C70| r SAPE & a C71| r SAPE & a C72| r SAPE & a C73| r SAPE & a C74| r SAPE & a C75| r SAPE & a C76| r SAPE & a C77| r SAPE & a C78| r SAPE & a C79| r SAPE & a C80| r SAPE & a C81| r SAPE & a C82

I then try to run the command and select the chain1 group using:  
gmx order -s md.tpr -f md.xtc -n index\_sape.ndx -d z -od SAPE\_chain1.xvg

The error I receive is:  
Fatal error: grp 1 does not have same number of elements as grp 1

Can anyone verify if this is an indexing issue. If it is then what is the appropriate way to set up the index for gmx order?

---

<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:** [September 15, 2023, 3:01am UTC](https://gromacs.bioexcel.eu/t/gmx-order-fatal-error-grp-1-does-not-have-same-number-of-elements-as-grp-1/7187/2 "2023-09-15T03:01:24Z")

</div>

The index group is incorrect. There should be separate groups for C36, C37, etc.

See [http://www.mdtutorials.com/gmx/membrane\_protein/09\_analysis.html](http://www.mdtutorials.com/gmx/membrane_protein/09_analysis.html)

---

<div class="post-metadata">

**Author:** ![Joseph](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@Joseph](https://gromacs.bioexcel.eu/u/Joseph)\
**Post date:** [September 18, 2023, 10:54am UTC](https://gromacs.bioexcel.eu/t/gmx-order-fatal-error-grp-1-does-not-have-same-number-of-elements-as-grp-1/7187/3 "2023-09-18T10:54:02Z")

</div>

I made the index file with the following script. I tried both with and without renaming each index group for acyl chain carbons to see if it made a difference and it did not. I still receive the same error when running **echo 25 | gmx\_mpi order -s md.tpr -f md.xtc -n index\_sape.ndx -d z -od sape\_ch1.xvg** :

gmx\_mpi make\_ndx -f prot\_eql.gro -o index\_SAPE\_dop.ndx \<\<EOF

r SAPE & a C23  
name 25 C23  
r SAPE & a C24  
name 26 C24  
r SAPE & a C25  
name 27 C25  
r SAPE & a C26  
name 28 C26  
r SAPE & a C27  
name 29 C27  
r SAPE & a C28  
name 30 C28  
r SAPE & a C29  
name 31 C29  
r SAPE & a C210  
name 32 C30  
r SAPE & a C211  
name 33 C31  
r SAPE & a C212  
name 34 C32  
r SAPE & a C213  
name 35 C33  
r SAPE & a C214  
name 36 C34  
r SAPE & a C215  
name 37 C35  
r SAPE & a C216  
name 38 C36  
r SAPE & a C217  
name 39 C37  
r SAPE & a C218  
name 40 C38  
r SAPE & a C219  
name 41 C39  
r SAPE & a C220  
name 42 C40  
r SAPE & a C33  
name 43 C41  
r SAPE & a C34  
name 44 C42  
r SAPE & a C35  
name 45 C43  
r SAPE & a C36  
name 46 C44  
r SAPE & a C37  
name 47 C45  
r SAPE & a C38  
name 48 C46  
r SAPE & a C39  
name 49 C47  
r SAPE & a C310  
name 50 C48  
r SAPE & a C311  
name 51 C49  
r SAPE & a C312  
name 52 C50  
r SAPE & a C313  
name 53 C51  
r SAPE & a C314  
name 54 C52  
r SAPE & a C315  
name 55 C53  
r SAPE & a C316  
name 56 C54  
r SAPE & a C317  
name 57 C55  
r SAPE & a C318  
name 58 C56  
r SAPE & a C319  
name 59 C57  
r SAPE & a C320  
name 60 C58

q

EOF

---

<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:** [September 23, 2023, 6:45pm UTC](https://gromacs.bioexcel.eu/t/gmx-order-fatal-error-grp-1-does-not-have-same-number-of-elements-as-grp-1/7187/4 "2023-09-23T18:45:00Z")

</div>

What does `gmx check` tell you about the index file?

---

<div class="post-metadata">

**Author:** ![Joseph](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@Joseph](https://gromacs.bioexcel.eu/u/Joseph)\
**Post date:** [September 24, 2023, 10:08am UTC](https://gromacs.bioexcel.eu/t/gmx-order-fatal-error-grp-1-does-not-have-same-number-of-elements-as-grp-1/7187/5 "2023-09-24T10:08:27Z")

</div>

![image](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/f/f0ad871582b6a16a3f502316f9009ebf41b28899.jpeg)

Code:  
gmx\_mpi check -n index\_SAPE\_dop.ndx

## Contents of index file index\_SAPE\_dop.ndx

Nr. Group #Entries First Last  
0 System 632834 1 632834  
1 Protein 4017 1 4017  
2 Protein-H 2019 1 4017  
3 C-alpha 251 5 4008  
4 Backbone 753 1 4015  
5 MainChain 1003 1 4015  
6 MainChain+Cb 1239 1 4015  
7 MainChain+H 1234 1 4015  
8 SideChain 2783 2 4017  
9 SideChain-H 1016 7 4017  
10 Prot-Masses 4017 1 4017  
11 non-Protein 628817 4018 632834  
12 Other 628817 4018 632834  
13 POPE 4000 4018 8017  
14 PLPC 13464 8018 21481  
15 PLPE 6888 21482 28369  
16 SAPE 22008 28370 50377  
17 TLCL1 31571 50378 81948  
18 SAPC 23660 81949 105608  
19 SAPS 2926 105609 108534  
20 POPC 4824 108535 113358  
21 SAPI 5577 113359 118935  
22 SOD 515 118936 119450  
23 CLA 315 119451 119765  
24 TIP3 513069 119766 632834  
25 C23 168 28405 50282  
26 C24 168 28408 50285  
27 C25 168 28411 50288  
28 C26 168 28413 50290  
29 C27 168 28415 50292  
30 C28 168 28418 50295  
31 C29 168 28420 50297  
32 C30 168 28422 50299  
33 C31 168 28425 50302  
34 C32 168 28427 50304  
35 C33 168 28429 50306  
36 C34 168 28432 50309  
37 C35 168 28434 50311  
38 C36 168 28436 50313  
39 C37 168 28439 50316  
40 C38 168 28442 50319  
41 C39 168 28445 50322  
42 C40 168 28448 50325  
43 C41 168 28452 50329  
44 C42 168 28455 50332  
45 C43 168 28458 50335  
46 C44 168 28461 50338  
47 C45 168 28464 50341  
48 C46 168 28467 50344  
49 C47 168 28470 50347  
50 C48 168 28473 50350  
51 C49 168 28476 50353  
52 C50 168 28479 50356  
53 C51 168 28482 50359  
54 C52 168 28485 50362  
55 C53 168 28488 50365  
56 C54 168 28491 50368  
57 C55 168 28494 50371  
58 C56 168 28497 50374  
59 C57 22008 28370 50377  
60 C58 22008 28370 50377

---

<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:** [September 24, 2023, 4:26pm UTC](https://gromacs.bioexcel.eu/t/gmx-order-fatal-error-grp-1-does-not-have-same-number-of-elements-as-grp-1/7187/6 "2023-09-24T16:26:33Z")

</div>

You need to delete the unnecessary groups as noted in the tutorial link. Anything that isn’t an actor chain carbon needs to go. And your last two groups have a problem because they have far more atoms than all the others so you need to check how you created them.
