rdtools.reaction.ts#
Functions for analyzing transition states of reactions.
- rdtools.reaction.ts.examine_normal_mode(rmol: Mol, pmol: Mol, ts_xyz: ndarray[tuple[int, ...], dtype[float64]], disp: ndarray[tuple[int, ...], dtype[float64]], amplitude: float | list[float] = 0.25, weights: bool | ndarray[tuple[int, ...], dtype[float64]] = True, verbose: bool = True, as_factors: bool = True) bool | tuple[float, float, float] #
Examine a TS’s imaginary frequency given known reactant and product complexes.
The function checks if the bond changes are corresponding to the most significant change in the normal mode. The reactant and product complex need to be atom mapped.
- Parameters:
rmol (Chem.Mol) – the reactant complex.
pmol (Chem.Mol) – the product complex.
ts_xyz (npt.NDArray[np.float64]) – The xyz coordinates of the transition state. It should have a size of N x 3.
disp (npt.NDArray[np.float64]) – The displacement of the normal mode. It should have a size of N x 3.
amplitude (Union[float, list[float]]) – The amplitude of the motion. Defaults to
0.25
.weights (Union[bool, npt.NDArray[np.float64]], optional) – If
True
, use the sqrt(atom mass) as a scaling factor to the displacement. IfFalse
, use the identity weights. If a N x 1npt.NDArray[np.float64]
is provided, then The concern is that light atoms (e.g., H) tend to have larger motions than heavier atoms.verbose (bool, optional) – If print detailed information. Defaults to
True
.as_factors (bool, optional) – If return the value of factors instead of a judgment. Defaults to
False
- Returns:
Union[bool, tuple[float, float, float]] – The return value depends on the value of as_factors. If as_factors is
True
, return the factors of the bond distance change. Otherwise, return a boolean value.
- rdtools.reaction.ts.guess_rxn_from_normal_mode(xyz: ndarray[tuple[int, ...], dtype[float64]], symbols: Sequence[str], disp: ndarray[tuple[int, ...], dtype[float64]], amplitude: int | float | list[float] = 0.25, weights: bool | ndarray[tuple[int, ...], dtype[float64]] = True, backend: Literal['openbabel', 'xyz2mol'] = 'openbabel', multiplicity: int = 1) tuple[list[Mol], list[Mol]] #
Guess reaction according to the normal mode analysis for a transition state.
- Parameters:
xyz (npt.NDArray[np.float64]) – The xyz coordinates of the transition state. It should have a size of \(N \\times 3\). You can get it from mol.GetConformer().GetPositions().
symbols (Sequence[str]) – The symbols of each atoms. It should have a size of \(N\). You can get the symbols by rdmc.rdtools.mol.get_element_symbols.
disp (npt.NDArray[np.float64]) – The displacement of the normal mode. It should have a size of \(N \\times 3\). You can get it from cclib.vib
amplitude (Union[int, float, list[float]], optional) – The amplitude of the motion. If a single value is provided then the guess will be unique (if available).
0.25
will be the default. Otherwise, a list can be provided, and all possible results will be returned.weights (Union[bool, npt.NDArray[np.float64]]) – If
True
, use the \(\\sqrt(atom mass)\) as a scaling factor to the displacement. IfFalse
, use the identity weights. If a \(N \\times 1\)np.ndarray
is provided, then use the provided weights. The concern is that light atoms (e.g., H) tend to have larger motions than heavier atoms.backend (Literal["openbabel", "xyz2mol"], optional) – The backend used to perceive xyz. Defaults to
'openbabel'
.multiplicity (int, optional) – The spin multiplicity of the transition states. Defaults to
1
.
- Returns:
tuple[list[Chem.Mol], list[Chem.Mol]] – Potential reactants and products.
- rdtools.reaction.ts.is_valid_habs_ts(rmol: Mol, pmol: Mol, ts_xyz: ndarray[tuple[int, ...], dtype[float64]], disp: ndarray[tuple[int, ...], dtype[float64]], single_score: bool = True, **kwargs: Any) bool | tuple[bool, bool] #
Check if the TS belonging to a H atom abstraction reactions.
This function assumes the TS, rmol, and pmol have the same atom order. This may be extended to general substitution reaction.
- Parameters:
rmol (Chem.Mol) – the reactant complex.
pmol (Chem.Mol) – the product complex.
ts_xyz (npt.NDArray[np.float64]) – The xyz coordinates of the transition state. It should have a size of N x 3.
disp (npt.NDArray[np.float64]) – The displacement of the normal mode. It should have a size of N x 3.
single_score (bool, optional) – If return a single score (True or False). Defaults to
True
. Otherwise, return the check results (True or False) for both side of the reaction**kwargs (Any) – Additional arguments for the molecule generation.
- Returns:
Union[bool, tuple[bool, bool]] – The return value depends on the value of single_score. If single_score is
True
, return a single score (True
orFalse
). Otherwise, return the check results (True
orFalse
) for both side of the reaction.