# Custom index for protein segment and ligand

**URL:** <https://gromacs.bioexcel.eu/t/custom-index-for-protein-segment-and-ligand/1222>\
**Category:** User discussions\
**Created:** [December 8, 2020, 10:32am UTC](https://gromacs.bioexcel.eu/t/custom-index-for-protein-segment-and-ligand/1222 "2020-12-08T10:32:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter.mawanga](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@peter.mawanga](https://gromacs.bioexcel.eu/u/peter.mawanga)\
**Post date:** [December 8, 2020, 10:32am UTC](https://gromacs.bioexcel.eu/t/custom-index-for-protein-segment-and-ligand/1222/1 "2020-12-08T10:32:09Z")

</div>

GROMACS version: 2019.5  
GROMACS modification: No

Greetings everyone,

I want to create the following two index files with:

1. Backbone atoms of a selected segment of the protein molecule.

2. Non-hydrogen atoms of a ligand molecule.

Please let me know how could I select these two groups for creating the index files. Thanks for reading.

---

<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:** [December 8, 2020, 1:30pm UTC](https://gromacs.bioexcel.eu/t/custom-index-for-protein-segment-and-ligand/1222/2 "2020-12-08T13:30:16Z")

</div>

Type `help` at the `make_ndx` prompt to see example syntax.

For a segment of protein residues, it is as simple as `r X-Y` where `X` and `Y` are the first and last residues. For the ligand without H, `X & ! a H*` where X is the group number of the ligand (which is a default group).
