# Programmatically adding hydrogen and remove water to multiple PDB files

I'm trying to dock a ligand to several hundred PDB files (receptors). I thus need to prepare the those PDB files like removing water and adding hydrogen.

I can do that manually using Autodock or Pymol. But it's too troublesome. Is there a way to do it programmatically with Python or R or any command line procedure?

• If you did it manually in PyMOL, it can also be scripted. But note that adding hydrogens is not that simple. There is more than one way of deciding which hydrogens are present (you may consider pH) and what are their coordinates. So I'd first think what method of adding hydrogens to use. Jun 17 at 9:52
• @marcin In pymol I use h_add command. That is not enough? How would you go about scripting it? Jun 17 at 10:24
• chemistry.stackexchange.com/questions/129157/… here they use openbabel, not scripting but in batch Jun 17 at 13:17
• I can't tell if that's enough for what you're doing. h_add in Python script would become pymol.cmd.h_add('all') Jun 17 at 13:21
• Michael Word's reduce is an established method to do that Jun 22 at 3:06

You can also try looking into tutorials on how to setup proteins for dynamics on GROMACS, AMBER or OpenMM and stumble on their own tools for protonating stuff (respectively pdb2gmx (CLI), protonate (CLI), and modeller.addHydrogen (python API)), but as far as I know propka computes residues pKi in a knowledge-based manner and out-performs physics-based (if not just totally automatic, without guess) approaches like these.