molsysmt.build.add_missing_hydrogens#

molsysmt.build.add_missing_hydrogens(molecular_system, pH=7.4, engine='OpenMM', skip_digestion=False)[source]#

Adding missing hydrogen atoms to a molecular system.

This function adds hydrogen atoms that are missing from a molecular system, based on its topology, standard chemical templates, and a selected pH. The added atoms are positioned using predefined rules for protonation states and geometry constraints.

Parameters:
  • molecular_system (molecular system) – Molecular system in any of the supported forms to which hydrogens will be added.

  • pH (float, default 7.4) – Approximate pH used to determine the protonation state of ionizable groups.

  • engine ({'MolSysMT', 'OpenMM', 'PDBFixer'}, default 'OpenMM') – The engine used to perform hydrogen placement. The engine determines residue protonation states and adds atoms accordingly.

Returns:

A new molecular system with hydrogens added, returned in the same form as the input.

Return type:

molecular system

Raises:
  • NotSupportedFormError – Raised if the input molecular system is not in a supported form.

  • ArgumentError – Raised if an input argument does not meet the expected format or conditions.

  • EngineError – Raised if the selected engine fails to perform hydrogen addition.

Notes

Hydrogen atoms are added based on standard residue templates and general rules for protonation. Ionizable side chains (e.g., ASP, GLU, HIS) are adjusted according to the provided pH.

The list of supported molecular systems’ forms is available at: User Guide > Introduction > Molecular systems > Forms

See also

molsysmt.build.has_hydrogens()

Check whether a molecular system contains hydrogen atoms.

molsysmt.build.add_missing_heavy_atoms()

Add missing non-hydrogen atoms to a molecular system.

molsysmt.basic.contains()

Check for the presence of specific atoms or molecules.

Examples

The following example illustrates the use of the function:

>>> import molsysmt as msm
>>> molsys = msm.convert('181L', selection='molecule_type=="protein"')
>>> msm.build.has_hydrogens(molecular_system)
False
>>> molsys = msm.build.add_missing_hydrogens(molsys, pH=7.4)
>>> msm.build.has_hydrogens(molsys)
True

User guide

Follow this link for a tutorial on how to work with this function: User Guide > Tools > Build > Add missing hydrogens

Added in version 1.0.0.