stk.DibromoFactory
- class stk.DibromoFactory(bonders=(1, 2), deleters=(0, 3), placers=None)[source]
Bases:
FunctionalGroupFactoryCreates
Dibromoinstances.Creates functional groups from substructures, which match the
[Br][#6]~[#6][Br]functional group string.Examples
Creating Functional Groups with the Factory
You want to create a building block which has
Dibromofunctional groups. You want the non-bromine atoms of the functional group to be the bonder atoms and the bromine atoms to be the deleter atoms.import stk building_block = stk.BuildingBlock( smiles='BrCC(Br)CCCC', functional_groups=(stk.DibromoFactory(), ), )
Changing the Bonder and Deleter Atoms
You want to create a building block which has
Dibromofunctional groups, You want only one of non-bromine atoms to be a bonder atom and its neighboring bromine atom to be a deleter atom.import stk dibromo_factory = stk.DibromoFactory( # The index of one of the non-bromine atoms in the # functional group string (see docstring) is 1. bonders=(1, ), # The neighboring bromine atom has an index of 0. deleters=(0, ), ) building_block = stk.BuildingBlock( smiles='BrCC(Br)CCC', functional_groups=(dibromo_factory, ), )
See also
GenericFunctionalGroupDefines bonders and deleters.
Initialize a
DibromoFactoryinstance.- Parameters:
bonders (
tupleofint) – The indices of atoms in the functional group string, which are bonder atoms.deleters (
tupleofint) – The indices of atoms in the functional group string, which are deleter atoms.placers (
tupleofint, 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