Adding hydrogens in a PDB file

Dear users and developers,
OS: Microsoft
Version: 1.9.3
I have been facing problems while adding hydrogens in my PDB file. The procedure I followed is to import the coordinates of the ligand in Avogadro PDB format and then used Open Babel extension to add hydrogens for pH which does a very bad job i.e. adds hydrogens haphazardly and in unwanted positions. Whereas while importing the coordinates of the ligand as a OpenBabel PDB format everything works fine but while writing the mol2 file it messes up with the atom naming in the mol2 file which aggravates my problem in further calculations and analyses I intend to do.
Kindly provide your insights and suggestions,
Pallav Sengupta,
IIT Guwahati,

If you’re just trying to add hydrogens to a PDB file and convert to mol2, you can use Open Babel directly, either through the command-line or GUI.

obabel file.pdb -O file.mol2 -p 7 # add hydrogens based on pH 7 transforms

1 Like

This is the problem one will encounter when directly converting PDB files to mol2 file using obabel.

@ghutchis is this issue entirely contained in Open Babel, or does it affect Avogadro code? It seems to affects biochemistry workflows, so in the latter case I’m placing it in my checklist.

I’d need to see an example of the issue (e.g., what atom names).

The Avogadro conversion to mol2 is complicated, because it will be saved internally as CML for Open Babel to convert to mol2.

That’s why I suggested the direct Open Babel usage - it will go directly from PDB to Mol2.

If there’s an issue with Open Babel’s Mol2 format, that’s something OB needs to fix … and for that, we’d need some example file, and an illustration of the problems with the atom naming.

@aerkiaga - if you want to add native support for mol2 to Avogadro, maybe? Right now, that’ll be tricky since mol2 requires aromaticity assignment and partial charges, neither of which are part of Avo2 yet.

1 Like

Is that new partial charge code of yours applicable here? Maybe by performing integration on volumes or something? Honestly, adding aromaticity support looks intimidating in comparison…

@pallavsen007, would you kindly please tell us an example of a molecule that is not working for you? That would allow us to perform tests on it and eventually get the issues fixed.

Hi there, I could convert FAD molecule to a proper mol2 file using Open Babel with hydrogens in proper positions, but the problem is that it messes up with the atom naming which it originally had in the PDB file which causes a lot of problems in further analyses I have to do for simulations. I have installed Avogadro 2.0 in Linux using package manager(apt-get) and Open Babel using package manager(apt-get).

Say for example in the PDB file the 5th Carbon of deoxyribose sugar was named as C5’ but while converting the PDB file to mol2 file and in the processes this carbon gets renamed to something else say C11 or C10 etc.

I think your main complaint is that adding / removing hydrogens clears the atom names?

That would be an Open Babel issue… I’d have to think of the best way to handle it. As it stands, any operation that adds/removes atoms or bonds invalidates residues (and thus atom names).

Clearly adding / removing hydrogens shouldn’t be a big problem, but I’ll have to think of the safest way to separate that from adding / removing other atoms.

1 Like

Yes, right, that’s the problem.

@ghutchis also, each hydrogen gets its own undo/redo operation, so a rewrite to add them at a lower level, at once, would help with that too.