openff.recharge.utilities.toolkits.match_smirks

openff.recharge.utilities.toolkits.match_smirks(smirks: str, molecule: Molecule, is_atom_aromatic: Dict[int, bool], is_bond_aromatic: Dict[Tuple[int, int], bool], unique: bool = False, kekulize: bool = False) List[Dict[int, int]][source]

Attempt to find the indices (optionally unique) of all atoms which match a particular SMIRKS pattern.

Parameters
  • smirks – The SMIRKS pattern to match.

  • molecule – The molecule to match against.

  • is_atom_aromatic – A dictionary of the form is_atom_aromatic[atom_index] = is_aromatic.

  • is_bond_aromatic – A dictionary of the form is_bond_aromatic[(atom_index_a, atom_index_b)] = is_aromatic.

  • unique – Whether to return only unique matches.

  • kekulize – Whether to kekulize the molecule before matching.

Returns

  • A list of all the matches where each match is stored as a dictionary of

  • the smirks indices and their corresponding matched atom indices.