stk.ThiolFactory

class stk.ThiolFactory(bonders=(1,), deleters=(2,), placers=None)[source]

Bases: FunctionalGroupFactory

Creates Thiol instances.

Creates functional groups from substructures, which match the [*][S][H] functional group string.

Examples

Creating Functional Groups with the Factory

You want to create a building block which has Thiol functional groups. You want the sulfur atom in those functional groups to be the bonder atom, and the hydrogen atom to be the deleter atom.

import stk

building_block = stk.BuildingBlock(
    smiles='SCCCCS',
    functional_groups=(stk.ThiolFactory(), ),
)

Changing the Bonder and Deleter Atoms

You want to create a building block which has Thiol functional groups. You want the non-hydrogen atom bonded to the sulfur to be the bonder atom and the SH group to be deleter atoms.

import stk

thiol_factory = stk.ThiolFactory(
    # The index of the atom bonded to sulfur is 0 in the
    # functional group string (see docstring).
    bonders=(0, ),
    # The indices of the sulfur and hydrogen atoms in the
    # functional group string (see docstring) is 1 and 2,
    # respectively.
    deleters=(1, 2),
)
building_block = stk.BuildingBlock(
    smiles='SCCCCS',
    functional_groups=(thiol_factory, ),
)

See also

GenericFunctionalGroup

Defines bonders and deleters.

Initialize a ThiolFactory instance.

Parameters:
  • bonders (tuple of int) – The indices of atoms in the functional group string, which are bonder atoms.

  • deleters (tuple of int) – The indices of atoms in the functional group string, which are deleter atoms.

  • placers (tuple of int, optional) – The indices of atoms in the functional group string, which are placer atoms. If None, bonders will be used.

Methods

get_functional_groups

Yield functional groups in molecule.

get_functional_groups(molecule)[source]

Yield functional groups in molecule.

Parameters:

molecule (Molecule) – The molecule, whose functional groups are to be found.

Yields:

FunctionalGroup – A functional group in molecule.

Examples

See FunctionalGroupFactory.