# MoleculePlot draws sucrose benzoate with overlapping bonds

Recently I learned that in Mathematica it is possible to create chemical structures here: Chemical formulas with Mathematica

I am having a problem with a structure called "Sucrose benzoate" (here's the reference: https://www.sigmaaldrich.com/catalog/product/aldrich/458333?lang=en&region=US). Since the simple MoleculePlot@Molecule["Sucrose benzoate"] doesn't work, I am trying the following:

MoleculePlot@
Molecule["O=C(OC[C@H]1O[C@H](O[C@]3(COC(=O)c2ccccc2)O[C@H](COC(=O)\
c4ccccc4)[C@@H](OC(=O)c5ccccc5)[C@@H]3OC(=O)c6ccccc6)[C@H](OC(=O)\
c7ccccc7)[C@@H](OC(=O)c8ccccc8)[C@@H]1OC(=O)c9ccccc9)c%10ccccc%10"]\
(*Sucrose benzoate*)


which gives (with no red circle):

The problem is that there are two rings colliding with each other (as shown with the red circle). How can I fix that so that they look separated (at least not colliding)?.

• This is a bug; please report it. Jan 9, 2021 at 6:53
• @J.M. thanks.... How do I report it?
– John
Jan 9, 2021 at 15:05
• Through this contact form. Jan 9, 2021 at 15:42

## 1 Answer

Mathematica uses a number of libraries for generating 2D structure diagram coordinates. The automatic method produces a suboptimal result for this molecule. Probably the system should try to check for overlapping bonds after getting coordinates and try another method, but it doesn't do this right now.

There is an undocumented method to specify which library to use when generating coordinates:

m = Molecule @ "O=C(OC[C@H]1O[C@H](O[C@]3(COC(=O)c2ccccc2)O[C@H](COC(=O)c4ccccc4)[C@@H](OC(=O)c5ccccc5)[C@@H]3OC(=O)c6ccccc6)[C@H](OC(=O)c7ccccc7)[C@@H](OC(=O)c8ccccc8)[C@@H]1OC(=O)c9ccccc9)c%10ccccc%10";
Map[MoleculePlot[m, AtomDiagramCoordinates -> #, PlotLabel -> #] &,
{Automatic, "CoordGen", "OpenBabel", "Avalon", "PubChem"}
]


Be aware that the "PubChem" method requires an internet connection, and can hang if the service is unavailable. All the usual caveats about undocumented features apply here. The above works in version 12.2, in version 12.1 the "Avalon" method is not available but the others work. This syntax is not available in version 12.0

In a future release, these should be available as documented options, possibly using different syntax.