Thioacid Factory

class ThioacidFactory(bonders=(1,), deleters=(3, 4), placers=None)[source]

Bases: stk.molecular.functional_groups.factories.functional_group_factory.FunctionalGroupFactory

Creates Thioacid instances.

Creates functional groups from substructures, which match the [*][C](=[O])[S][H] functional group string.

Examples

Creating Functional Groups with the Factory

You want to create a building block which has Thioacid functional groups. You want the carbon atom in those functional groups to be the bonder atom, and SH group to be the deleter atoms.

import stk

building_block = stk.BuildingBlock(
    smiles='SC(=O)CC(=O)S',
    functional_groups=(stk.ThioacidFactory(), ),
)

Changing the Bonder and Deleter Atoms

You want to create a building block which has Thioacid functional groups. You want the carbon atom to be the bonder atom and the oxygen atom to be the deleter atom.

import stk

thioacid_factory = stk.ThioacidFactory(
    # The index of the carbon atom in the functional
    # group string (see docstring) is 1.
    bonders=(1, ),
    # The index of the oxygen atom in the functional
    # group string (see docstring) is 2.
    deleters=(2, ),
)
building_block = stk.BuildingBlock(
    smiles='SC(=O)CC(=O)S',
    functional_groups=(thioacid_factory, ),
)

See also

GenericFunctionalGroup

Defines bonders and deleters.

Methods

get_functional_groups(molecule)

Yield functional groups in molecule.

__init__(bonders=(1,), deleters=(3, 4), placers=None)[source]

Initialize a ThioacidFactory 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.

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.