text: user12433: 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?
  
  user12054: I believe PDB2PQR CLI will do the work wonderfully. Don't let the name trick you: PQR files are organized like PDB ones. Under the hood it runs propka, which is state-of-the-art for predicting a protein residues protonation state. The best part is that you can use PDB2PQR web server and they will give you the corresponding CLI arguments for each option you choose. It also automatically removes water (and other non-protein molecules).
  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.
  For some context: acidic or basic amino-acids in proteins may have different pKi depending on their local environment (i.e. if they are in contact with solvent or not, and residues surrounding them), which is why "adding hydrogen to proteins crystallographic structures at a constant pH" is not as easy as it sounds.
  
original_text: 12433: <p>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.</p>
  <p>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?</p>
   12054: <p>I believe <a href="https://pdb2pqr.readthedocs.io/en/latest/" rel="nofollow noreferrer">PDB2PQR</a> CLI will do the work wonderfully. Don't let the name trick you: PQR files are organized like PDB ones. Under the hood it runs <a href="https://propka.readthedocs.io/en/latest/quickstart.html" rel="nofollow noreferrer">propka</a>, which is state-of-the-art for predicting a protein residues protonation state. The best part is that you can use <a href="https://server.poissonboltzmann.org/pdb2pqr" rel="nofollow noreferrer">PDB2PQR web server</a> and they will give you the corresponding CLI arguments for each option you choose. It also automatically removes water (and other non-protein molecules).</p>
  <p>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 <code>pdb2gmx</code> (CLI), <code>protonate</code> (CLI), and <code>modeller.addHydrogen</code> (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.</p>
  <p>For some context: acidic or basic amino-acids in proteins may have different pKi depending on their local environment (i.e. if they are in contact with solvent or not, and residues surrounding them), which is why &quot;adding hydrogen to proteins crystallographic structures at a constant pH&quot; is not as easy as it sounds.</p>
  