openff.bespokefit.utilities.smirks.SMIRKSGenerator

model openff.bespokefit.utilities.smirks.SMIRKSGenerator[source]

Bases: SMIRKSettings

Generates a set of smirks that describe the requested force groups of the molecule, these can be bespoke or simply extract the current values from the target forcefield.

Fields
field initial_force_field: Union[str, ForceFieldEditor] = 'openff_unconstrained-1.3.0.offxml'

The base forcefield the smirks should be generated from.

field target_smirks: List[SMIRKSType] = [<SMIRKSType.ProperTorsions: 'ProperTorsions'>]

The list of parameters the new smirks patterns should be made for.

field smirks_layers: Union[Literal['all'], int] = 'all'

The number of layers that should be included into the generated patterns.

generate_smirks_from_molecule(molecule: Molecule, central_bond: Optional[Tuple[int, int]] = None)[source]

A convenience method for generating SMIRKS patterns that encompass an entire molecules.

generate_smirks_from_fragment(parent: Molecule, fragment: Molecule, fragment_map_indices: Optional[Tuple[int, int]]) List[ParameterType][source]

Generates a set of smirks patterns for the fragment corresponding to the types set in the target smirks list.

Parameters
  • parent – The parent molecule that was fragmented.

  • fragment – The fragment of the parent molecule. The map indices in the fragment must match the map indices of the parent.

  • fragment_map_indices – The map indices of the atoms that the fragment was generated around.

Returns

A dictionary of new bespoke smirks parameters for the molecule as well as an initial guess of their values.