stk.SmartsFunctionalGroupFactory
- class stk.SmartsFunctionalGroupFactory(smarts, bonders, deleters, placers=None)[source]
Bases:
FunctionalGroupFactoryCreates
GenericFunctionalGroupinstances.Examples
Using SMARTS to Define Functional Groups
You want to create a building block which has
GenericFunctionalGroupfunctional groups based on the SMARTS string:[Br][C]. You want theCatom to be the bonder atom, and theBratom 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
GenericFunctionalGroupDefines bonders and deleters.
Initialize a
SmartsFunctionalGroupFactoryinstance.- Parameters:
smarts (
str) – The SMARTS defining the functional group.bonders (
tupleofint) – The indices of atoms in smarts, which are bonder atoms.deleters (
tupleofint) – The indices of atoms in smarts, which are deleter atoms.placers (
tupleofint, 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