2
$\begingroup$

I need to programmatically add Hydrogen atoms to a PDB file (say, 16PK.pdb) using BioPython.

What algorithm should I use for this?

$\endgroup$

2 Answers 2

4
$\begingroup$

Not actually and answer as you cannot do it with biopython.PDB. But there are may other tools.

Several are online, for example: https://zhanggroup.org/HAAD/ by the folk who wrote I-Tasser. Nearly every MD pipeline has their own protonation algorithm. The only hydrogens that are an issue are histidine protonation —HIE vs. HID— and protonation states of catalytic residues (CYZ vs. CYS etc).

The PyMOL python module is really good and can do a lot. Only issue is that the easiest way to install is via conda.

conda install -c conda-forge -c schrodinger pymol-bundle

with which one can:

import pymol2
pymol2.PyMOL() as pymol:
    pymol.cmd.load('👾👾👾.pdb', 'myprotein') # file
    # pymol.cmd.fetch('👾👾👾👾', 'myprotein') # PDB code
    pymol.cmd.h_add()
    pymol.cmd.save('👻👻👻.pdb')

One can find neighbours to a given atom too (see this Q&A), select by secondary structure, define secondary structure (pymol.cmd.dss()) etc. A caveat is that, bar for some commands like pymol.cmd.get_model(selection).atom, one does not interact directly with the atoms and everything is done via selections.

However, as this Q follows on from this unanswerable one and in turn from several others about SS. I am guessing it is to determine the hydrogen bond distances between different sheets. These have a backbone amide nitrogen (name N) donating a hydrogen (H, not HA etc.) to an accepting backbone amide oxygen of another sheet (O). Unless you want an exact distance, you could simply use the distance between these heavy atoms, which would be slightly larger than the H-N bond plus the H•O hydrogen bond and the oxygen may not be coplanar with the planar amide.

$\endgroup$
5
  • $\begingroup$ thanks a lot... $\endgroup$
    – user366312
    Commented Oct 23, 2021 at 20:40
  • $\begingroup$ Would it be a realistic goal to implement HAAD protonation algorithm with BioPython? $\endgroup$
    – user366312
    Commented Oct 23, 2021 at 22:10
  • $\begingroup$ Doable totally, worth doing something that is implemented in many places elsewhere on a module that's a swiss-army knife, but limited in advanced functionality, definitely no... $\endgroup$ Commented Oct 24, 2021 at 10:19
  • $\begingroup$ The incorrect syntax pymol2.PyMOL() as pymol: should throw an error. $\endgroup$ Commented Oct 3, 2022 at 20:21
  • $\begingroup$ Not on python 3. In this case it's not the module pymol but an instance of multisession pymol2.PyMOL which behaves like the module but is way better $\endgroup$ Commented Oct 4, 2022 at 20:24
0
$\begingroup$

conda install -c conda-forge openbabel

from openbabel import pybel as pb
babel_mol = pb.readfile(format="pdb", filename=path_to_pdb).__next__()
babel_mol.addh()
babel_mol.write(format='pdb', filename=path_to_babel_pdbh, overwrite=True)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.