stk.PrimaryAminoFactory
- class stk.PrimaryAminoFactory(bonders=(1,), deleters=(2, 3), placers=None)[source]
Bases:
FunctionalGroupFactory
Creates
PrimaryAmino
instances.Creates functional groups from substructures, which match the
[*][N]([H])[H]
functional group string.Examples
Creating Functional Groups with the Factory
You want to create a building block which has
PrimaryAmino
functional groups. You want the nitrogen atom to be the bonder atom, and the hydrogen atoms to be the deleter atoms.import stk building_block = stk.BuildingBlock( smiles='NCCCCN', functional_groups=(stk.PrimaryAminoFactory(), ), )
Changing the Bonder and Deleter Atoms
You want to create a building block which has
PrimaryAmino
functional groups. You want the non-hydrogen atom bonded to nitrogen to be the bonder atom and the nitrogen and hydrogen atoms to be deleter atoms.import stk primary_amino_factory = stk.PrimaryAminoFactory( # The index of the atom attached to the nitrogen is 0 in # the functional group string (see docstring). bonders=(0, ), # The indices of the nitrogen and hydrogen atoms in the # functional group string (see docstring) are 1, 2 and 3. deleters=(1, 2, 3), ) building_block = stk.BuildingBlock( smiles='NCCCCN', functional_groups=(primary_amino_factory, ), )
See also
GenericFunctionalGroup
Defines bonders and deleters.
Initialize a
PrimaryAminoFactory
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