stk.GenericReactionFactory
- class stk.GenericReactionFactory(bond_orders=None)[source]
Bases:
ReactionFactory
Create reactions for
GenericFunctionalGroup
instances.This reaction factory assumes that the functional groups, which belong to the
EdgeGroup
passed to it, areGenericFunctionalGroup
instances. It returns aReaction
suitable for two such instances.Initialize a
GenericReactionFactory
.- Parameters:
bond_orders (
dict
, optional) –Maps a
frozenset
ofGenericFunctionalGroup
subclasses to the bond orders for their respective reactions, if a pair of functional groups is missing, a default bond order of 1 will be used for their reactions. If bond_orders isNone
, the followingdict
will be usedimport stk bond_orders = { frozenset({stk.PrimaryAmino, stk.Aldehyde}): 2, frozenset({stk.PrimaryAmino, stk.Aldehyde}): 2, frozenset({stk.Amide, stk.PrimaryAmino}): 2, frozenset({stk.Alkene}): 2, frozenset({stk.Alkyne}): 2, }
This means that if you want to get a reaction for an amine and an aldehyde functional group, the reaction will create bonds with a bond order of 2.
Methods
Get a reaction to use on the edge_group.
- get_reaction(construction_state, edge_group)[source]
Get a reaction to use on the edge_group.
- Parameters:
construction_state (
ConstructionState
) – The state of the current construction.edge_group (
EdgeGroup
) – The edge group for which a reaction should be found.
- Returns:
The reaction to use on the edge_group.
- Return type: