molsysmt.build.get_missing_bonds#
- molsysmt.build.get_missing_bonds(molecular_system, selection='all', structure_index=0, max_bond_length='2 angstroms', disulfide_bonds=False, disulfide_group_names=None, pbc=True, syntax='MolSysMT', engine='MolSysMT', sorted=True, skip_digestion=False)[source]#
Identifying candidate missing covalent bonds.
This function compares the bonds inferred from group templates and/or distance-based neighbor searches against the bonds already recorded in the topology of the molecular system and returns candidate missing pairs. Peptidic bonds are considered only between consecutive source groups in the same declared chain. Selecting separated groups does not make them consecutive. These criteria are heuristics and do not establish a complete or chemically validated molecular graph.
- Parameters:
molecular_system (molecular system) – Molecular system in any supported MolSysMT format.
selection (str, list, tuple, or numpy.ndarray, default='all') – Atom selection. Integer lists refer to source atom indices. Both atoms of each returned pair must belong to the selection. Defaults to ‘all’.
structure_index (int, default=0) – Source structure index used for distance-based candidates. Defaults to 0.
max_bond_length (quantity or str, default='2 angstroms') – Distance cutoff for geometric candidates, with explicit length units. Peptide candidates must also satisfy the element-pair threshold. Defaults to ‘2 angstroms’.
disulfide_bonds (bool, default=False) – Whether to include geometric disulfide candidates. Defaults to False.
disulfide_group_names (list of str or None, default=None) – Group names examined for disulfide candidates. None uses [‘CYS’].
pbc (bool, default=True) – Whether to take periodic boundary conditions into account.
syntax (str, default='MolSysMT') – Selection syntax used to evaluate selection (e.g., ‘MolSysMT’, ‘MDTraj’).
engine (str, default='MolSysMT') – Candidate engine: ‘MolSysMT’ or the optional ‘pytraj’ backend. Defaults to ‘MolSysMT’.
sorted (bool, default=True) – Whether to sort the returned bonded atom pairs.
skip_digestion (bool, default=False) – Whether to skip MolSysMT’s internal argument digestion mechanism.
- Returns:
List of
[atom_index_1, atom_index_2]pairs representing bonds that are inferred from templates or distance criteria but not yet recorded in the molecular system topology. Indices refer to the source atom axis. An empty result is an empty list; this function does not modify the source.- Return type:
list of [int, int]
- Raises:
NotImplementedMethodError – Raised if the requested
engineis not supported.ArgumentChoiceError – Raised if a terminal capping group cannot be classified as N- or C-terminal.
Notes
For groups with a known template (water, ion, amino acid, terminal capping, small molecule, saccharide), intra-group bonds are taken from the corresponding template. For groups without a template, bonds are inferred by a distance-based neighbor search using
max_bond_lengthand element-pair thresholds stored inmolsysmt.element.bond.Peptidic C–N candidates connect source group indices
gandg + 1only when both have one defined, identical chain index. Missing or ambiguous chain membership is not used to infer peptide bonds. Distances are evaluated only for these pairs, using the requested structure and PBC setting. Group IDs need not be consecutive. Chain membership alone cannot preserve file-specific segment breaks that a source adapter has not retained.Examples
>>> import molsysmt as msm >>> system = msm.convert(msm.systems['alanine dipeptide']['alanine_dipeptide.h5msm']) >>> msm.build.get_missing_bonds(system) []
User guide
See Get missing bonds for auditing missing connectivity.
Added in version 1.0.0.