Functional Group Factory
- Alcohol Factory
- Aldehyde Factory
- Amide Factory
- Boronic Acid Factory
- Bromo Factory
- Carboxylic Acid Factory
- Dibromo Factory
- Difluoro Factory
- Diol Factory
- Fluoro Factory
- Iodo Factory
- Primary Amino Factory
- Ring Amine Factory
- Secondary Amino Factory
- SMARTS Functional Group Factory
- Terminal Alkene Factory
- Terminal Alkyne Factory
- Thioacid Factory
- Thiol Factory
- class FunctionalGroupFactory
An abstract base class for functional group factories.
The purpose of a functional group factory is to create
FunctionalGroupinstances. It allows the user to avoid creating
FunctionalGroupinstances manually. The user will use
get_functional_groups()to achieve this. Subclasses of this class are made to customize the automatic creation process.
Using a Single Functional Group From a Factory
You have a building block with two functional groups, but you want to use just one.
import stk amino_factory = stk.PrimaryAminoFactory() building_block = stk.BuildingBlock('NCCN') amino_group1, *rest = amino_factory.get_functional_groups( molecule=building_block, ) building_block = building_block.with_functional_groups( functional_groups=(amino_group1, ), )
Using a Subset of Functional Groups From a Factory
You have multiple functional groups, but you want the building block to use a specific subset.
import stk bromo_factory = stk.BromoFactory() building_block = stk.BuildingBlock('BrCC(Br)CC(Br)CC(Br)CCBr') bromo_groups = tuple(bromo_factory.get_functional_groups( molecule=building_block, )) building_block = building_block.with_functional_groups( functional_groups=( bromo_groups, bromo_groups, bromo_groups, ), )
More usage examples can be found in the docstrings of the various subclasses.
The source of the subclasses, listed in
functional_group_factory, can serve as good examples.
Yield functional groups in molecule.