# Can I give an arbitrary name for an index?

**URL:** <https://gromacs.bioexcel.eu/t/can-i-give-an-arbitrary-name-for-an-index/3776>\
**Category:** User discussions\
**Created:** [March 3, 2022, 5:01pm UTC](https://gromacs.bioexcel.eu/t/can-i-give-an-arbitrary-name-for-an-index/3776 "2022-03-03T17:01:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lanselibai](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@lanselibai](https://gromacs.bioexcel.eu/u/lanselibai)\
**Post date:** [March 3, 2022, 5:01pm UTC](https://gromacs.bioexcel.eu/t/can-i-give-an-arbitrary-name-for-an-index/3776/1 "2022-03-03T17:01:18Z")

</div>

GROMACS version: 2021  
GROMACS modification: No  
Here post your question

`gmx make_ndx` can create a customised index. For example, `r 100-200` will create a new index for the atoms from residue 100 to 200, which is named as `r_100-200` in the `ndx` file. But can I give it an arbitrary name, e.g. “Domain\_A”, instead of “r\_100-200”?

---

<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:** [March 3, 2022, 5:24pm UTC](https://gromacs.bioexcel.eu/t/can-i-give-an-arbitrary-name-for-an-index/3776/2 "2022-03-03T17:24:28Z")

</div>

Yes, either edit the index file after the fact (it’s just plain text) or use the `name` command within `make_ndx`.

---

<div class="post-metadata">

**Author:** ![lanselibai](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@lanselibai](https://gromacs.bioexcel.eu/u/lanselibai)\
**Post date:** [March 3, 2022, 9:38pm UTC](https://gromacs.bioexcel.eu/t/can-i-give-an-arbitrary-name-for-an-index/3776/3 "2022-03-03T21:38:37Z")

</div>

> [@jalemkul](#):
>
> make\_ndx

Thank you. I can edit the index file after `make_ndx` using a text editor.

But can I ask the syntax for “use the `name` command within `make_ndx`”? It seems that no information is [here](https://manual.gromacs.org/current/onlinehelp/gmx-make_ndx.html).

---

<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:** [March 4, 2022, 2:44am UTC](https://gromacs.bioexcel.eu/t/can-i-give-an-arbitrary-name-for-an-index/3776/4 "2022-03-04T02:44:10Z")

</div>

The documentation tells you to type ‘h’ at the prompt for examples, which returns (among other things):

```auto
'name' nr name : rename group nr to name.

```

So if I want to change the name of group X to “mygroup” I would type:

```auto
name X mygroup

```

---

<div class="post-metadata">

**Author:** ![lanselibai](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@lanselibai](https://gromacs.bioexcel.eu/u/lanselibai)\
**Post date:** [March 4, 2022, 10:23am UTC](https://gromacs.bioexcel.eu/t/can-i-give-an-arbitrary-name-for-an-index/3776/5 "2022-03-04T10:23:10Z")

</div>

> [@lanselibai](#):
>
> make\_ndx

thank you, I got it!
