stk.BoronicAcidFactory
- class stk.BoronicAcidFactory(bonders=(1,), deleters=(2, 3, 4, 5), placers=None)[source]
Bases:
FunctionalGroupFactory
Creates
BoronicAcid
instances.Creates functional groups from substructures, which match the
[*][B]([O][H])[O][H]
functional group string.Examples
Creating Functional Groups with the Factory
You want to create a building block which has
BoronicAcid
functional groups. You want the boron atom in those functional groups to be the bonder atom and the OH groups to be deleter atoms.import stk building_block = stk.BuildingBlock( smiles='OB(O)CCCB(O)O', functional_groups=(stk.BoronicAcidFactory(), ), )
Changing the Bonder and Deleter Atoms
You want to create a building block which has
BoronicAcid
functional groups. You want the oxygen atoms to be treated as bonder atoms, and the hydrogen atoms to be treated as deleter atoms.import stk boronic_acid_factory = stk.BoronicAcidFactory( # The indices of the oxygen atoms in the functional # group string (see docstring) are 2 and 4. bonders=(2, 4), # The indices of the hydrogen atoms in the # functional group string (see docstring) are 3 and 5. deleters=(3, 5), ) building_block = stk.BuildingBlock( smiles='OB(O)CCCB(O)O', functional_groups=(boronic_acid_factory, ), )
See also
GenericFunctionalGroup
Defines bonders and deleters.
Initialize a
BoronicAcidFactory
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