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. For instance, X-ray crystal structures deposited in the Protein Data Bank often exclude hydrogens, and histidine residues can adopt different protonation states depending on the pH.

In the build module of MolSysMT, the function molsysmt.build.add_missing_hydrogens() allows you to add missing hydrogens to any molecular system supported by the library. Let’s demonstrate how it works with the following example:

Added in version 1.0.0.

How this function works#

API documentation

Follow this link for a detailed description of the input arguments, raised errors, and returned objects: molsysmt.build.add_missing_hydrogens().

This function identifies atoms that are missing from the selected residues or molecules and restores them based on predefined topological templates and standard protonation patterns. It applies chemical rules and structural constraints to determine plausible positions for the new hydrogen atoms, integrating them consistently into the molecular system.

We start by loading a protein structure from the Protein Data Bank. This system lacks hydrogen atoms, as is typical for X-ray crystallography models.

import molsysmt as msm
molecular_system = msm.convert('181L', selection='molecule_type=="protein"')
msm.info(molecular_system)
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 molecular system was obtained from a PDB structure and, as expected, it does not contain hydrogen atoms.

msm.build.has_hydrogens(molecular_system)
False

We now add the missing hydrogen atoms, using standard protonation patterns at pH 7.4:

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

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

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

See also

User guide > Tools > Build > Get missing hydrogens:
Identify which hydrogen atoms are missing in a molecular system.

User guide > Tools > Build > Add missing heavy atoms:
Restore non-hydrogen atoms using structural templates.

User guide > Tools > Build > Build peptide:
Generate capped peptide structures from sequence.

User guide > Tools > Basic > Contains:
Check whether specific elements are present in a molecular system.