ApplyReaction
ApplyReaction[rxn,mols]
applies the pattern reaction rxn to the list of molecules mols, returning a single list of products.
ApplyReaction[rxn,mols,n]
returns up to n lists of products.
ApplyReaction[rxn,mols,{map1,…}]
returns a single set of products, using mapi to map the atoms in the i molecule to the i
reactant.
ApplyReaction[rxn]
represents an operator form of ApplyReaction that can be applied to a list of molecules.
Details

- ApplyReaction works by finding occurrences of the reactant patterns present in the PatternReaction in the list of molecules and applying the transformation.
- Pattern matching is performed in order; the first MoleculePattern in the pattern reaction is searched for in the first input Molecule.
- ApplyReaction has the following option:
-
IncludeHydrogens Automatic whether hydrogens should be included in the pattern matching - When supplied, the mapi should be an association of atom indices between the given reactant pattern and molecule.
Examples
open allclose allBasic Examples (3)
Apply an autoionization reaction to water:
Apply a reaction between an organic acid and base:
Apply the same reaction with the reactants reversed, treating histidine as the acid and alanine as the base:
Apply a reaction to convert an alkene to an alcohol:
Find matching "Chemical" entities for the products:
Scope (4)
Create a pattern reaction for the Diels–Alder reaction from a reaction SMARTS string:
Apply the pattern reaction to a diene and a dienophile:
React a radical chlorine atom with methane:
Define a reaction for an intermolecular esterification:
Apply the pattern reaction to a carboxylic acid and an alcohol:
Apply the pattern reaction to a carboxylic acid and an isotopically labeled alcohol:
Define a pattern reaction for an intramolecular esterification:
Form a lactone (cyclic ester) from a hydroxylated carboxylic acid:
Find all possible lactones from a carboxylic acid with multiple hydroxyl groups:
Options (1)
IncludeHydrogens (1)
By default, hydrogen atoms are only included in the pattern matching when the pattern includes an explicit hydrogen:
Use IncludeHydrogensAll to ensure that Atom[_] will match hydrogen atoms:
Applications (3)
Define a pattern reaction for acetylation:
Acetylate salicylic acid to form aspirin:
Exhaustively acetylate the sugar sucrose:
Synthesize phthalide from o-phthalaldehyde by applying a sequence of reactions:
A pattern reaction representing amide formation for peptides:
Generate molecules corresponding to the standard amino acids:
Generate a peptide from its amino acid sequence:
The result is equivalent to the one obtained from BioSequence:
Properties & Relations (1)
The result of ApplyReaction depends on the order in which the reactant molecules are supplied:
Neat Examples (2)
The benzidine rearrangement is a rearrangement reaction for making biaryl amines:
Use the benzidine rearrangement to make benzidine from hydrazobenzene:
The Ugi reaction is a typical example of a multicomponent reaction. Here is a three-component version:
Various local anesthetics can be synthesized using the Ugi reaction, depending on the starting materials used:
These correspond to the anesthetics lidocaine and prilocaine:
Text
Wolfram Research (2022), ApplyReaction, Wolfram Language function, https://reference.wolfram.com/language/ref/ApplyReaction.html.
CMS
Wolfram Language. 2022. "ApplyReaction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ApplyReaction.html.
APA
Wolfram Language. (2022). ApplyReaction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ApplyReaction.html