stk.SmartsFunctionalGroupFactory
- class stk.SmartsFunctionalGroupFactory(smarts, bonders, deleters, placers=None)[source]
Bases:
FunctionalGroupFactory
Creates
GenericFunctionalGroup
instances.Examples
Using SMARTS to Define Functional Groups
You want to create a building block which has
GenericFunctionalGroup
functional groups based on the SMARTS string:[Br][C]
. You want theC
atom to be the bonder atom, and theBr
atom to be the deleter atom.import stk building_block = stk.BuildingBlock( smiles='BrCCCBr', functional_groups=( stk.SmartsFunctionalGroupFactory( smarts='[Br][C]', bonders=(1, ), deleters=(0, ), ), ), )
See also
GenericFunctionalGroup
Defines bonders and deleters.
Initialize a
SmartsFunctionalGroupFactory
instance.- Parameters:
smarts (
str
) – The SMARTS defining the functional group.bonders (
tuple
ofint
) – The indices of atoms in smarts, which are bonder atoms.deleters (
tuple
ofint
) – The indices of atoms in smarts, which are deleter atoms.placers (
tuple
ofint
, optional) – The indices of atoms in smarts, which are placer atoms. IfNone
, the bonder atoms 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