My Motivation for this Project

I’m particularly interested in chemistry

Wolfram Chemistry has a lot of potential

Synthesis Design is difficult and complicated

First Steps

Molecule Modify

Substructure Rules

MoleculeModify[Molecule[],{"ReplaceSubstructure",MoleculePattern[]->Molecule[]}]

Molecule Canonization

What is Canonization?

Why do we need to Canonize molecules?

Replace Substructure doesn’t Canonize molecules

Wolfram has a roundabout way to Canonize molecules

Convert to SMILES string and back

CanonizedMolecule = Molecule[MoleculeValue[InputMolecule, "CanonicalSMILES"]]

Alkane Network Mapping

Using MoleculeModify with NestGraph

ReplaceSubstructureList

Replace each unique hydrogen with methyl group

Canonize the molecule each step

Explicit vs. Implicit Hydrogen

NestGraph[
MoleculeModify[Molecule[MoleculeValue[#,"CanonicalSMILES"]],"MakeHydrogensExplicit"]&/@MoleculeModify[#,{"ReplaceSubstructureList",Molecule[{"H"},{}]->Molecule["Methane"]}]&,Molecule["Methane"],6,VertexLabels->Placed["Name",Tooltip]]

Chemical Reactions with MoleculeModify

Reactions can be generalized as replacement rules, to an extent

Still can give mostly accurate reaction map

reactions = ;
applyReactions[mol_Molecule]:=
	Select[Map[MoleculeModify[Molecule[MoleculeValue[
		Fold[MoleculeModify[MoleculeModify[#1,#2],"MakeHydrogensExplicit"]&,mol,#],
		"CanonicalSMILES"]],"MakeHydrogensExplicit"]&,
	Select[reactions[[All,2]],AnyTrue[#,MoleculeContainsQ[mol,#[[2]][[1]]]&]&]],UnsameQ[#,mol]&]

NestGraph[applyReactions,Molecule["1-Butyne"],2,VertexLabels->Placed["Name",Tooltip],ImageSize->Large]

reactionNetwork=

Data Visualization

With[{shift=(Quantity[50, "u", unified atomic mass units, "AtomicMassUnit"]),scheme=ColorData[{"Pastel","Reverse"}][1-#2/#1]&},Row[{Graph[reactionNetwork,,VertexShapeFunction->({scheme[MoleculeValue[#2,"MolecularMass"],shift],Disk[#1,#3]}&)],}]]

Graph[reactionNetwork,,VertexShapeFunction->(Disk[#1,#3*Sqrt[1+Length[VertexOutComponent[reactionNetwork,#2]]]/5]&)]

Graph[reactionNetwork,,GraphLayout->{"LayeredDigraphEmbedding","RootVertex"->First[VertexList[reactionNetwork]]}]

ListPlot[Map[Tooltip[MoleculeValue[#,"ElementMassFraction"]/@{(Entity["carbon", Entity["Element","Carbon"], "Entity[\"Element\", \"Carbon\"]", "element"]),(Entity["hydrogen", Entity["Element","Hydrogen"], "Entity[\"Element\", \"Hydrogen\"]", "element"])},#]&,VertexList[reactionNetwork]],]

Limitations of MoleculeModify and
Reaction Networks

Reactions with Chiral Molecules

Steric Hinderance & Reaction Favorability

Reaction Rates

Exceptions to common reactions

Reactions with multiple organic molecules

Finding Novel Reactions