Add missing bonds#
Inferring and adding missing covalent bonds based on interatomic distances and chemical element types.
The function molsysmt.build.add_missing_bonds() adds the candidates returned by molsysmt.build.get_missing_bonds() using group templates and distance criteria. It does not certify valence or complete chemistry and does not assign bond orders. Review candidates before reconstructing connectivity in a coordinate-only input.
Peptide candidates require consecutive source group indices in one defined chain. Selecting separated groups does not create adjacency. Integer selections refer to source atom indices; both endpoints of an added pair must be selected. Existing declared edges are preserved, including edges outside these inference criteria. Use in_place=False to prepare a copy while leaving the source unchanged.
Added in version 1.0.0.
API documentation
Follow this link for a detailed description of the input arguments, raised errors, and returned objects of this function: molsysmt.build.add_missing_bonds().
Basic usage#
Let’s show how this function works using an alanine dipeptide system:
import molsysmt as msm
molsys = msm.systems['alanine dipeptide']['alanine_dipeptide.h5msm']
molsys = msm.convert(molsys)
Note
Demo Systems Catalog
This tutorial uses demonstration datasets provided by MolSysMT. To explore the full catalog of bundled systems, forms, and file paths, visit the Demo Systems guide.
To demonstrate molsysmt.build.add_missing_bonds(), we first save the original list of bonded_atom_pairs and remove all existing covalent bonds from the molecular system to simulate a topology lacking bond definitions:
bonded_atom_pairs = msm.get(molsys, bonded_atom_pairs=True)
molsys.topology.remove_bonds()
Let’s verify that the system currently has zero covalent bonds:
msm.get(molsys, n_bonds=True)
0
We now call molsysmt.build.add_missing_bonds() to automatically infer covalent bonds based on interatomic distances and element types:
msm.build.add_missing_bonds(molsys)
Finally, let’s verify that the total number of bonds was restored and check if the newly inferred bonded atom pairs match the original topology:
msm.get(molsys, n_bonds=True)
21
new_bonded_atom_pairs = msm.get(molsys, bonded_atom_pairs=True)
new_bonded_atom_pairs == bonded_atom_pairs
True
See also
Related Tools & References
Demo Systems Catalog: Explore demonstration datasets used for testing and tutorials.
Convert: Convert molecular systems between different forms with
molsysmt.basic.convert().Get: Retrieve attribute values from a molecular system with
molsysmt.basic.get().Add missing bonds: Infer and add missing covalent bonds with
molsysmt.build.add_missing_bonds().Add bonds: Manually define new covalent bonds between specific atom pairs.