Chemical Synthesis
Chemical Synthesis
Out[]=
Starting with one molecule and running a reaction or series of reactions to generate a new molecule is known as chemical synthesis. It is the heart of chemistry and underpins modern human medical and technological endeavors.
The hydrobromination of alkenes, molecules containing a carbon-carbon double bond, is one of the first synthesis reactions taught in organic chemistry courses. In chemical synthesis a functional group is modified by the interaction with another molecular entity during one or more chemical reactions. A functional group is represented in the Wolfram Language by which is related to a as seen below.
A carbon-carbon double bond functional group:
patternAlkene=MoleculePattern[{"C","C"},{Bond[{1,2},"Double"]}]
Out[]=
MoleculePattern
A ethylene molecule. Note that the four hydrogen atoms are automatically added:
moleculeEthylene=Molecule[{"C","C"},{Bond[{1,2},"Double"]}]
Out[]=
Molecule
In order for hydrobromination to occur, an alkene molecule and a molecule of hydrogen bromide must be present as reactants. As these two reactants interact at room temperature, the valence electrons involved in bonding rearrange so that the hydrogen atom bonds to one of the carbon atoms in the double bond and the bromine atom bonds to the other carbon atom. The resulting alkane molecule contains a carbon-carbon single bond with a bromine atom bonded to one of the carbon atoms in the original carbon-carbon single bond.
A hydrogen bromide moiety:
patternHBr=MoleculePattern[{"H","Br"},{Bond[{1,2},"Single"]}]
Out[]=
MoleculePattern
A brominated alkane moiety:
patternBromoAlkane=MoleculePattern[{"C","C","Br","H"},{Bond[{1,2},"Single"],Bond[{1,3},"Single"],Bond[{2,4},"Single"]}]
Out[]=
MoleculePattern
Our three patterns can be combined together along with an atom mapping to form a . The atom mapping specifies which atoms in the reactant patterns become which atoms in the product pattern.
Build the reactant and product list of patterns:
bromoReactants={patternAlkene,patternHBr}bromoProducts={patternBromoAlkane}
Out[]=
MoleculePattern,MoleculePattern
Out[]=
MoleculePattern
Mouse over the atoms in the summary box to discover the atom indices:
Build the atom mapping. Note that the syntax for each mapping is {reactant index, atom index in that reactant} -> {product index, atom index in that product}:
atomMapping={{1,1}->{1,1},(*atomoneinthefirstreactant(C=C)becomesthefirstatomintheproduct*){1,2}->{1,2},(*atomtwointhefirstreactant(C=C)becomesthesecondatomintheproduct*){2,1}->{1,4},(*atomoneinthesecondreactant(HBr)becomesthefourthatomintheproduct*){2,2}->{1,3}(*atomtwointhesecondreactant(HBr)becomesthethirdatomintheproduct*)}
Out[]=
{{1,1}{1,1},{1,2}{1,2},{2,1}{1,4},{2,2}{1,3}}
Define the hydrobromination reaction:
hydrobromination=PatternReaction[bromoReactants->bromoProducts,atomMapping]
Out[]=
The atom mapping is easily checked by mousing over the output:
To run the hydrobromination reaction on an ethylene molecule, use .
Build a hydrogen bromide molecule using + =:
molHBr=Molecule
Out[]=
Molecule
Apply the to a list of ordered molecules requesting all possible products:
ApplyReaction[hydrobromination,{moleculeEthylene,molHBr},All]
Out[]=
Molecule
Since the alkene bond in ethylene is symmetric, there is only one possible product. With a bit of coding, our results can be combined with , and to generate a more traditional synthesis visualization with some dynamic enhancements not available in print text books.
Define the ReactionView function:
In[]:=
Options[ReactionView]=Join[{ChemicalFormula->True,MoleculePlot->True},Options[Graph]];ReactionView[rxn_PatternReaction,{limiting_Molecule,excess_Molecule},n_Integer:1,opts:OptionsPattern[]]:=Module[{mkArrow,button,edges,products,rxnGraph,rxnStep,tool},{button,tool}=If[OptionValue[MoleculePlot],{MoleculePlot,MoleculePlot3D},{MoleculePlot3D,MoleculePlot}];mkArrow=Function[e,Labeled[e,Tooltip[Button[excess["MolecularFormula"],CopyToClipboard[excess]],tool[excess]]],Listable];rxnStep=Function[reactant,Flatten[ApplyReaction[rxn,{reactant,excess},All]],Listable];edges=EdgeList[NestGraph[rxnStep[#]&,limiting,n]];If[MatchQ[edges,{}],Return[Missing["NoReaction"],Module]];rxnGraph=Graph[If[OptionValue[ChemicalFormula],mkArrow[edges],edges],VertexShape->Map[#->Tooltip[Button[button[#],CopyToClipboard[#]],tool[#]]&,DeleteDuplicates[Flatten[List@@@edges]]],GraphLayout->If[Length[edges]==1,{"LayeredDigraphEmbedding","Orientation"->Left},Automatic],VertexSize->Large];vl=Transpose[{Range[VertexCount[rxnGraph]],VertexList[rxnGraph]}];rxnGraph=IndexGraph[rxnGraph];products=Select[Gather[vl,MoleculeMatchQ[Last[#1],Last[#2]]&][[All,All,1]],Length[#]>1&];SimpleGraph[VertexContract[rxnGraph,products],FilterRules[{opts},Options[Graph]]]]
Use ReactionView to both run the reaction and visualize the results. Click on the molecule plot to copy the corresponding to the clipboard:
ReactionView[hydrobromination,{moleculeEthylene,molHBr}]
Out[]=
Hydrogen bromide is not the only hydrogen halide that can add across an alkene bond. Hydrogen chloride and hydrogen iodide also react to from halogenated alkane bonds. One could construct hydrochlorination and hydroiodination pattern reactions in the same manner as above. Using on the three halogen atoms, one can construct a single representing a general hydrohalogenation reaction.
Build the reactant and product list of patterns:
Define the hydrohalogenation reaction reusing the previous atom mapping:
For unsymmetric alkenes such as propylene, more than one product is possible as explained by Markovnikov's rule. Let’s see this in action using propylene and hydrogen chloride.
Run the hydrohalogenation reaction for propylene and hydrogen chloride viewing all possible products:
If a molecule contains two unsymmetric double bonds, such as 1,4-hexadiene, the variety of possible products get even more exciting!
Build 1,4-hexadiene and hydrogen iodide molecules using + = :
Run the hydrohalogenation reaction once possible products:
Run the hydrohalogenation reaction twice to see both intermediate alkenes and view all possible alkane products:
Reaction SMARTS
Reaction SMARTS
Define an acetylation reaction using the corresponding SMARTS string:
Build 2,2-bis(hydroxymethyl)propane-1,3-diol and acetyl chloride molecules using + = :
Use Manipulate to dynamically run the acetylation reaction on the three OH groups of glycerol: