Message Boards Message Boards

How do you like your Hydrogens? Request for user feedback

Posted 4 years ago

Version 12 introduces the Molecule, a computable data structure to represent a chemical species. This function is new and labeled as "Experimental", so the behavior of it is not set in stone. In this post I'm looking for feedback from users on how Molecule should behave.

Much of the functionality is based around the field of cheminformatics. In fact much of the implementation uses the RDKit cheminformatics library, in the same way that string patterns are implemented using the PCRE regular expression library.

From a computational point of view, keeping hydrogens as explicit vertices in the underlying chemical graph is inefficient. For organic molecules, hydrogens can account for over half the atoms present, yet their presence can be inferred from common valence rules. Without including them explicitly, a whole range of properties can be computed.

It's only when you want to view the molecule as a 3D object that they become essential.

As pointed out in this Stack Exchange post, there is currently some inconsistency with how Molecule and MoleculePlot treat hydrogens. When creating a Molecule, you can specify whether to have explicit hydrogens via the IncludeHydrogens option. By default, when creating a Molecule from an explicit list of atoms and bonds, explicit hydrogens are not added.

Molecule[{"C", "C", "C"}, Bond /@ {{1, 2}, {2, 3}}]

enter image description here

This molecule expression has implicit hydrogens, indicated visually by the fact that the atom count shows two numbers: the first showing the explicit atom count and the second, in gray, the full atom count. If we want for the implicit hydrogens to be made explicit, we can pass in an option

Molecule[{"C", "C", "C"}, Bond /@ {{1, 2}, {2, 3}}, IncludeHydrogens -> True]

enter image description here

The default option value for IncludeHydrogens is Automatic, meaning that if they are present in the input we keep them but if not we treat them as implicit. If you evaluate SetOptions[Molecule, IncludeHyrogens -> True], then every molecule you create will have explicit hydrogens.

But now we have a question, how should we treat the following input?

Molecule["propane"]

With the value of Automatic, should hydrogens be explicit or implicit? This is a point I would like user feedback on.

Another question is how MoleculePlot and MoleculePlot3D should behave based on the input. In the current implementation, MoleculePlot will by-default show some hydrogens but not all, and this is independent of whether the input has implicit or explicit hydrogens.

enter image description here

Likewise MoleculePlot3D will always show the hydrogens, even if they are implicit.

enter image description here

This seems inconsistent, and has caused at least two users some confusion. So my next question for users is, should the automatic behavior of the plotting functions change depending on whether the Molecule in question has implicit or explicit hydrogens?

POSTED BY: Jason Biggs

Hello Jason, I particularly prefer that the hydrogens are all explicit with the option to make them implicit at any time. I had some minor problems using MoleculePlot, because I prefer that hydrogens automatically appear in all molecules of a series of symmetrical molecules that I created, I programmed the hydrogens to have a different color, but they appeared (visually) only in methane and I wished they appeared in (e.g.) many halomethanes, etc. in the 2D view and wasn't sure how to do it. At least that's what I felt. But I found that both MoleculePlot and MoleculePlot3D are really amazing functions!

Another difficulty I had using MoleculePlot and MoleculePlot3D is that I could not differentiate the clockwise and anti-clockwise spatial isomers of for example {C, H, F, Cl, Br} in visual representation. I just couldn't do it just by changing the order (the way I imagined), they looked exactly the same. I wish it were easier to do this, such as changing the order in the list. I may be wrong and this is easier than I think, but I couldn't do it.

POSTED BY: Claudio Chaib
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract