chemaxon.reactor

Reactor-related native bindings and option types.

class Mode(enum.IntEnum):

Parallel reactor mode

SEQUENTIAL = <Mode.SEQUENTIAL: 0>

The sequential mode generates products by combining the first reactant from each list, then the second, and so on.

COMBINATORIAL = <Mode.COMBINATORIAL: 1>

The combinatorial mode generates products by combining all possible combinations of reactants from the provided lists.

class OutputReactionMappingStyle(enum.IntEnum):

Output reaction mapping style

No mapping

Only the changed elements of the reaction are mapped, i.e. the reaction center and its neighbors.

All element are mapped.

Only the maching elements of the reaction are mapped, i.e. the reaction center and its neighbors that match between reactants and products.

class ReactorOptions:

Reactor options passed across the native boundary; mirrors toolkit defaults where unset.

result_type: ResultType = <ResultType.PRODUCT: 0>

Output type for reactor results.

ratio: list[int] | None = None

Ratio of reactants to be used in the reaction.

output_reaction_mapping_style: OutputReactionMappingStyle = <OutputReactionMappingStyle.NONE: 0>

Mapping style for the output reaction.

search_options_string: str | None = None

Search options string for the reactor.

max_number_of_product_sets: int = 0

Maximum number of product sets to generate. 0 means unlimited.

ignore_reactivity_and_exclude: bool = False

If true, reactivity and exclude rules are ignored.

ignore_selectivity: bool = False

If true, selectivity rules are ignored.

ignore_tolerance: bool = False

If true, tolerance rules are ignored.

reverse: bool = False

If true, the reaction is processed in reverse mode.

show_unsuccessful_reactions: bool = False

The reactions without product is in the output with an empty product list if this option is true. Works only with REACTION and FUSED_REACTION result types.

class ReactionRules:

Reaction rules passed across the native boundary.

reactivity: str | None = None

Reactivity rules for the reaction.

exclude: str | None = None

Exclusion rules for the reaction.

selectivity: str | None = None

Selectivity rules for the reaction.

tolerances: list[float] | None = None

Tolerance values for the reaction.

class ResultType(enum.IntEnum):

Output type for reactor results

PRODUCT = <ResultType.PRODUCT: 0>

The result contains only the reaction product.

REACTION = <ResultType.REACTION: 1>

The result contains the reaction with mapped reactants and products.

FUSED_REACTION = <ResultType.FUSED_REACTION: 2>
def single_input( reaction: chemaxon.molecule.Molecule, reactants: list[chemaxon.molecule.Molecule], options: ReactorOptions = <ReactorOptions object>, rules: ReactionRules = <ReactionRules object>) -> ReactorResultReaction:

Single input reactor execution.

The single input reactor takes a reaction and a single list of reactant molecules, applying the reaction to each reactant molecule.

Parameters
  • reaction: Molecule - Reaction molecule
  • reactants: list[Molecule] - List of reactant molecules
  • options: ReactorOptions - Reactor options for configuration. Default is None.
  • rules: ReactionRules - Reaction rules for configuration. Default is None.
Returns

ReactorResult - The reactor execution results

def parallel( mode: Mode, reaction: chemaxon.molecule.Molecule, reactants: list[list[chemaxon.molecule.Molecule]], options: ReactorOptions = <ReactorOptions object>, rules: ReactionRules = <ReactionRules object>) -> list[ReactorResultReaction]:

Parallel reactor execution.

The parallel reactor takes a reaction and multiple lists of reactant molecules, combining them according to the specified mode (sequential or combinatorial).

Parameters
  • mode: Mode - Reactor mode (SEQUENTIAL or COMBINATORIAL)
  • reaction: Molecule - Reaction molecule
  • reactants: list[list[Molecule]] - List of reactant molecule lists
  • options: ReactorOptions - Reactor options for configuration. Default is None.
  • rules: ReactionRules - Reaction rules for configuration. Default is None.
Returns

ReactorResult - The reactor execution results

class ReactorResult:

ReactorResult contains the results of a reactor execution.

ReactorResult(c_result: chemaxon.reactor.reactor._CReactorResult)
reactions

List of reaction results

class ReactorResultReaction:

ReactorResultReaction represents a single reaction result with reactants and product sets.

ReactorResultReaction(c_reaction: chemaxon.reactor.reactor._CReactorResultReaction)
reactants

List of reactant molecules

product_sets

List of product sets

class ReactorResultProductSet:

ReactorResultProductSet represents a set of product molecules.

ReactorResultProductSet(c_product_set: chemaxon.reactor.reactor._CReactorResultProductSet)
products

List of product molecules in this product set