# Convert protein & ligand .xtc to same PDB file

**URL:** <https://gromacs.bioexcel.eu/t/convert-protein-ligand-xtc-to-same-pdb-file/1173>\
**Category:** User discussions\
**Created:** [November 30, 2020, 10:01pm UTC](https://gromacs.bioexcel.eu/t/convert-protein-ligand-xtc-to-same-pdb-file/1173 "2020-11-30T22:01:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FuelledByCoffee](https://avatars.discourse-cdn.com/v4/letter/f/e9a140/32.png) [@FuelledByCoffee](https://gromacs.bioexcel.eu/u/FuelledByCoffee)\
**Post date:** [November 30, 2020, 10:01pm UTC](https://gromacs.bioexcel.eu/t/convert-protein-ligand-xtc-to-same-pdb-file/1173/1 "2020-11-30T22:01:06Z")

</div>

GROMACS version: 2020.4  
GROMACS modification: No

Hi, when I want to convert my .xtc trajectories to PDB I use “gmx trjconv -s .tpr -f .xtc -dt -o .pdb”.  
Is there any way to do this to include both protein and ligand rather than one or the other?  
Thanks

---

<div class="post-metadata">

**Author:** ![Dr\_DBW](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/dr_dbw/32/42_2.png) [@Dr\_DBW](https://gromacs.bioexcel.eu/u/Dr_DBW)\
**Post date:** [November 30, 2020, 10:49pm UTC](https://gromacs.bioexcel.eu/t/convert-protein-ligand-xtc-to-same-pdb-file/1173/2 "2020-11-30T22:49:18Z")

</div>

This is done via either the default groups generated when you run the script (a list of options appears when you run the command, asking what you want to include in the output). If the combination you want isn’t in that default then, then you make your own index file (`gmx make_ndx -f .tpr -o index.ndx`) and pass that to the command (`gmx trjconv -s .tpr -f .xtc -n index.ndx -o .pdb`) and select the appropriate group you generated.

---

<div class="post-metadata">

**Author:** ![shivam1](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@shivam1](https://gromacs.bioexcel.eu/u/shivam1)\
**Post date:** [February 27, 2024, 5:24am UTC](https://gromacs.bioexcel.eu/t/convert-protein-ligand-xtc-to-same-pdb-file/1173/3 "2024-02-27T05:24:56Z")

</div>

Hi @Dr_DBW @jalemkul @hess @alevilla

The command `gmx trjconv -s .tpr -f .xtc -n index.ndx -o .pdb` gives a PDB without chain names, in contrast to the original PDB used for molecular dynamics (MD) simulation, which included chain information. Is there anyway to retain the original chain names in the PDB file extracted from the `xtc` and `tpr` files?

Thanks
