Depicting Polar Hydrogens

Problem

You want to depict your molecule with explicit polar hydrogens. See example in Figure 1.

../_images/DepictPolarHydrogens.svg

Figure 1. Example of depicting polar hydrogens

Ingredients

Difficulty Level

🌶️

Solution

Before rendering a molecule, the OEPrepareDepiction function should be called which prepares the molecule for depiction. This function perceives atom and bond stereo information and suppresses or adds hydrogens if necessary. By default, the explicit hydrogens are suppressed by the OEPrepareDepiction function, see example (A) in Table: Example of default molecule depiction. Only hydrogens that are necessary to faithfully represent tetrahedral stereochemistry are added, see example (B) in Table 1.

Table 1. Example of default molecule depiction

( A )

( B )

../_images/DepictDefault.svg ../_images/DepictDefault-StereoH.svg

If depicting polar hydrogens is required (Figure 1.) it is recommended to use the following function. It is important to call the OEPrepareDepiction function with clear_coords = True and suppressH = False parameters.

def depict_molecule_with_polar_hydrogens(
    mol: oechem.OEMolBase, opts: oedepict.OE2DMolDisplayOptions, filename: str
) -> None:
    """Depict molecule with showing explicit polar hydrogens."""
    # add explicit hydrogens and remove all that is not polar
    oechem.OEAddExplicitHydrogens(mol)
    retain_polar = True
    oechem.OESuppressHydrogens(mol, retain_polar)

    clear_coords = True
    suppress_hydrogens = False  # do not change hydrogens
    oedepict.OEPrepareDepiction(mol, clear_coords, suppress_hydrogens)

    disp = oedepict.OE2DMolDisplay(mol, opts)
    oedepict.OERenderMolecule(filename, disp)

See also in OEChem TK manual

API

See also in OEDepict TK manual

Theory

API