shnitsel.geo.geomatch_exact

Functions

flag_exact(mol, l_smarts)

Compute and flag bonds, angles, and dihedrals in a single call,

get_bats_matching(atXYZ, l_smarts[, signed, ang])

Get bond lengths, angles and torsions according to a list of SMARTS searches.

Module Contents

flag_exact(mol, l_smarts)

Compute and flag bonds, angles, and dihedrals in a single call, for multiple structural features

Parameters:
  • mol (rdkit.Chem.rdchem.Mol) – Molecule under study.

  • l_smarts (list[str], optional) – SMARTS patterns for filtering interactions.

Returns:

  • dict

    {

    ‘bonds’: […], ‘angles’: […], ‘dihedrals’: […]

    }

  • Note that even if no BATs of a certain type (e.g. no bonds) are

  • requested, the returned dictionary will still contain the corresponding

  • key, associated with an empty list.

Return type:

dict

get_bats_matching(atXYZ, l_smarts, signed=None, ang=False)

Get bond lengths, angles and torsions according to a list of SMARTS searches.

Parameters:
  • atXYZ (xarray.DataArray) – The coordinates to use.

  • l_smarts (list[str], optional) – SMARTS patterns to search for.

  • signed (bool | None) – Whether to distinguish between clockwise and anticlockwise rotation, when returning angles as opposed to cosine & sine values; by default, do not distinguish. NB. This applies only to the dihedrals, not to the three-center angles. The latter are always unsigned.

  • optional – Whether to distinguish between clockwise and anticlockwise rotation, when returning angles as opposed to cosine & sine values; by default, do not distinguish. NB. This applies only to the dihedrals, not to the three-center angles. The latter are always unsigned.

  • ang (Literal[False, 'deg', 'rad']) – If False (the default), returns sines and cosines; if set to ‘deg’, returns angles in degrees if set to ‘rad’, returns angles in radians

  • optional – If False (the default), returns sines and cosines; if set to ‘deg’, returns angles in degrees if set to ‘rad’, returns angles in radians

Return type:

An xarray.DataArray containing bond lengths, angles and tensions as specified.

Examples

>>> geom.get_bats_matching(frames['atXYZ'], ['C~C=C~C', '[#7]~[#6]'])
# Finds and calculates all-carbon torsions with a central double bond
# and bond-lengths between carbon and nitrogen.