stk.DifluoroFactory
- class stk.DifluoroFactory(bonders=(1, 2), deleters=(0, 3), placers=None)[source]
Bases:
FunctionalGroupFactory
Creates
Difluoro
instances.Creates functional groups from substructures, which match the
[F][#6]~[#6][F]
functional group string.Examples
Creating Functional Groups with the Factory
You want to create a building block which has
Difluoro
functional groups. You want the non-fluorine atoms in those functional groups to be the bonder atoms, and the fluorine atoms to be the deleter atoms.import stk building_block = stk.BuildingBlock( smiles='FCC(F)CCC', functional_groups=(stk.DifluoroFactory(), ), )
Changing the Bonder and Deleter Atoms
You want to create a building block which has
Difluoro
functional groups, You want only one of non-fluorine atoms to be a bonder atom and its neighboring fluorine atom to be a deleter atom.import stk difluoro_factory = stk.DifluoroFactory( # The index of one of the non-fluorine atoms in the # functional group string (see docstring) is 1. bonders=(1, ), # The neighboring fluorine atom has an index of 0. deleters=(0, ), ) building_block = stk.BuildingBlock( smiles='FCC(F)CCC', functional_groups=(difluoro_factory, ), )
See also
GenericFunctionalGroup
Defines bonders and deleters.
Initialize a
DifluoroFactory
instance.- Parameters:
bonders (
tuple
ofint
) – The indices of atoms in the functional group string, which are bonder atoms.deleters (
tuple
ofint
) – The indices of atoms in the functional group string, which are deleter atoms.placers (
tuple
ofint
, optional) – The indices of atoms in the functional group string, which are placer atoms. IfNone
, bonders will be used.
Methods
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