molsysmt.topology.get_covalent_blocks#
- molsysmt.topology.get_covalent_blocks(molecular_system, selection='all', remove_bonds=None, output_type='sets', syntax='MolSysMT')[source]#
Identifying the sets of atoms that remain covalently connected when bonds are removed.
The purpose of this function is remove_bonds: it answers which atoms would still hold together if the given bonds were cut. That is how the groups of atoms rotating around a dihedral angle are obtained, for example.
Called without remove_bonds it returns the components of the system, since a component is by definition a set of atoms mutually connected through covalent bonds. In that case it adds nothing to get(molecular_system, element=’component’), which is the ordinary way of asking for them.
- Parameters:
molecular_system (molecular system) – Molecular system in any supported MolSysMT format.
selection (str, list, tuple, or numpy.ndarray, default='all') – Selection string or boolean/integer array specifying elements.
remove_bonds (list, tuple, numpy.ndarray, or None, default=None) – Zero-based atom-index pairs removed before finding covalent blocks.
output_type (str, default='sets') – Representation used for the returned result.
syntax (str, default='MolSysMT') – Selection syntax used to evaluate selection (e.g., ‘MolSysMT’, ‘MDTraj’).
- Returns:
Covalent blocks as sets of atom indices, or a 0-based block label per atom.
- Return type:
numpy.ndarray or list
- Raises:
NotImplementedMethodError – If output_type is unsupported.
Notes
Builds a bond graph with get_bondgraph and returns its connected components after removing the requested bonds.
The blocks are not the component attribute of the system unless remove_bonds is None and selection is ‘all’. With either of them the result describes a hypothetical connectivity, not the system’s own components.
See also
molsysmt.basic.get()Retrieving component_index and the rest of the system’s own attributes.
molsysmt.topology.get_covalent_paths()Finding paths of covalently bonded atoms matching an ordered pattern.
Added in version 1.0.0.