# Error using mutate.py with charmm FF

**URL:** <https://ask.bioexcel.eu/t/error-using-mutate-py-with-charmm-ff/4663>\
**Category:** pmx\
**Created:** [November 10, 2023, 7:41am UTC](https://ask.bioexcel.eu/t/error-using-mutate-py-with-charmm-ff/4663 "2023-11-10T07:41:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mstieffe](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@mstieffe](https://ask.bioexcel.eu/u/mstieffe)\
**Post date:** [November 10, 2023, 7:41am UTC](https://ask.bioexcel.eu/t/error-using-mutate-py-with-charmm-ff/4663/1 "2023-11-10T07:41:24Z")

</div>

Hello,  
I experience some issues while going through your tutorial for mutation free energies. When I run the mutate.py command with the amber or opls FF everything works fine. However, when i select one of the charmm FFs i get an error:

```auto
Traceback (most recent call last):
  File "/home/appuser/pmx/src/pmx/scripts/mutate.py", line 583, in <module>
    entry_point()
  File "/home/appuser/pmx/src/pmx/scripts/mutate.py", line 579, in entry_point
    main(args)
  File "/home/appuser/pmx/src/pmx/scripts/mutate.py", line 558, in main
    mutate(m=m,
  File "/opt/conda/envs/myenv/lib/python3.8/site-packages/pmx/alchemy.py", line 81, in mutate
    apply_aa_mutation(m=m2, residue=residue, new_aa_name=new_aa_name,
  File "/opt/conda/envs/myenv/lib/python3.8/site-packages/pmx/alchemy.py", line 121, in apply_aa_mutation
    _set_conformation(residue, hybrid_res, rotdic)
  File "/opt/conda/envs/myenv/lib/python3.8/site-packages/pmx/alchemy.py", line 546, in _set_conformation
    atom.x = old_res[atom.name].x
  File "/opt/conda/envs/myenv/lib/python3.8/site-packages/pmx/molecule.py", line 120, in __getitem__
    return self.fetch(item)[0]
IndexError: list index out of range

```

When i use the webinterface I can successfully generate a hybrid structure and topology file with the charmm FF. Any idea why this is not working locally?

Best,  
Marc

---

<div class="post-metadata">

**Author:** ![vgapsys](https://avatars.discourse-cdn.com/v4/letter/v/7993a0/32.png) [@vgapsys](https://ask.bioexcel.eu/u/vgapsys)\
**Post date:** [November 10, 2023, 8:49am UTC](https://ask.bioexcel.eu/t/error-using-mutate-py-with-charmm-ff/4663/2 "2023-11-10T08:49:44Z")

</div>

It seems that atom names in the structure file do not match those in the charmm force field. pmx webserver runs several scripts to rename atoms/residues, so mutation functions properly later on. You could run your structure file through “gmx pdb2gmx” with charmm ff and use the output structure as an input for pmx

---

<div class="post-metadata">

**Author:** ![mstieffe](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@mstieffe](https://ask.bioexcel.eu/u/mstieffe)\
**Post date:** [November 10, 2023, 9:14am UTC](https://ask.bioexcel.eu/t/error-using-mutate-py-with-charmm-ff/4663/3 "2023-11-10T09:14:14Z")

</div>

Thanks for the reply, this makes sense. However, pdb2gmx is also not able to convert the peptide.pdb file from the tutorial using the charmm FF (`Residue type 'NASN' not found in residue topology database`).  
Are the scripts that the webserver is using for the renaming available for offline usage?  
Best,  
Marc

---

<div class="post-metadata">

**Author:** ![vgapsys](https://avatars.discourse-cdn.com/v4/letter/v/7993a0/32.png) [@vgapsys](https://ask.bioexcel.eu/u/vgapsys)\
**Post date:** [December 1, 2023, 4:40pm UTC](https://ask.bioexcel.eu/t/error-using-mutate-py-with-charmm-ff/4663/4 "2023-12-01T16:40:42Z")

</div>

Several scripts were now added to the pmx ‘develop’ branch, they might help with preparing the structures
