Add missing hydrogens#

Adding missing hydrogen atoms to a molecular system.

Many molecular systems lack hydrogen atoms or require protonation adjustments to reflect a specific chemical or physical environment. The function molsysmt.build.add_missing_hydrogens() adds missing hydrogen atoms to any molecular system based on standard protonation rules and residue templates at a specified pH.

Added in version 1.0.0.

Basic usage#

Let’s show how this function works using a protein structure loaded from T4 lysozyme (PDB ID: 181L):

import molsysmt as msm
molsys = msm.convert('181L', selection='molecule_type=="protein"')
msm.info(molsys)
form n_atoms n_groups n_components n_chains n_molecules n_entities n_proteins n_structures
molsysmt.MolSys 1289 162 1 1 1 1 1 1

This protein system was obtained from a PDB X-ray structure and does not contain hydrogen atoms. Let’s verify this using molsysmt.build.has_hydrogens():

msm.build.has_hydrogens(molsys)
False

Now we add the missing hydrogen atoms using standard protonation patterns at pH 7.4:

molsys = msm.build.add_missing_hydrogens(molsys, pH=7.4)

Let’s confirm the addition of hydrogen atoms by counting how many atoms of type 'H' are now present:

msm.get(molsys, element='atom', selection='atom_type=="H"', n_atoms=True)
1313