openmm / pdbfixer

PDBFixer fixes problems in PDB files
Other
443 stars 112 forks source link

Do we have method to mutate the iCode-containing residue? #280

Open Loci-Tran opened 9 months ago

Loci-Tran commented 9 months ago

Do we have a method to mutate the iCode-containing residue? It seems applyMutations doesn't work.

For example, how can we mutate the residue GLY-9A-chainA of pdbID 1S9V?

peastman commented 9 months ago

This would be a useful feature to add to applyMutations(). A PR would be welcome!

If you know what residue you want to replace, it's pretty easy to do it yourself. applyMutations() is a very simple method. Here's the part that actually makes the change. It just changes the residue's name field and deletes any existing atoms that shouldn't be present.

https://github.com/openmm/pdbfixer/blob/6bf10e138f6475f6f1850dae78d7bf1b420a1612/pdbfixer/pdbfixer.py#L794-L810

Loci-Tran commented 9 months ago

Thank you @peastman I will give a try :-)