stk.TerminalAlkeneFactory

class stk.TerminalAlkeneFactory(bonders=(1,), deleters=(3, 4, 5), placers=None)[source]

Bases: FunctionalGroupFactory

Creates Alkene instances.

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

Examples

Creating Functional Groups with the Factory

You want to create a building block which has Alkene functional groups, but only if they are terminal. You want the non-terminal carbon atom in those functional groups to be the bonder atom, and the terminal CH2 group to be the deleter atoms.

import stk

building_block = stk.BuildingBlock(
    smiles='C=CCCCCC=C',
    functional_groups=(stk.TerminalAlkeneFactory(), ),
)

Changing the Bonder and Deleter Atoms

You want to create a building block which has Alkene functional groups, but only if they are terminal. You want the carbon atoms to be the bonder atoms and you don’t want any deleter atoms.

import stk

terminal_alkene_factory = stk.TerminalAlkeneFactory(
    # The indices of the carbon atoms in the functional
    # group string (see docstring) are 1 and 3.
    bonders=(1, 3),
    deleters=(),
)
building_block = stk.BuildingBlock(
    smiles='C=CCCCCC=C',
    functional_groups=(terminal_alkene_factory, ),
)

See also

GenericFunctionalGroup

Defines bonders and deleters.

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