Skip to content

Instantly share code, notes, and snippets.

@johnmay
Created July 8, 2016 18:37
Show Gist options
  • Save johnmay/6175225f745d090d10f458d1ebcfc99e to your computer and use it in GitHub Desktop.
Save johnmay/6175225f745d090d10f458d1ebcfc99e to your computer and use it in GitHub Desktop.
String smi = "[CH3:9][CH:8]([CH3:10])[c:7]1[cH:11][cH:12][cH:13][cH:14][cH:15]1.[CH2:3]([CH2:4][C:5](=[O:6])Cl)[CH2:2][Cl:1]>[Al+3].[Cl-].[Cl-].[Cl-].C(Cl)Cl>[CH3:9][CH:8]([CH3:10])[c:7]1[cH:11][cH:12][c:13]([cH:14][cH:15]1)[C:5](=[O:6])[CH2:4][CH2:3][CH2:2][Cl:1] |f:2.3.4.5| Friedel-Crafts acylation [3.10.1]";
IChemObjectBuilder bldr = SilentChemObjectBuilder.getInstance();
SmilesParser smipar = new SmilesParser(bldr);
IReaction rxn = smipar.parseReactionSmiles(smi);
new DepictionGenerator().withAtomMapHighlight(new Color[]{new Color(0xAAC0FF),
new Color(0x8BFFB9)})
.withOuterGlowHighlight()
.depict(rxn)
.writeTo("~/rxn.svg");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment