Class Hydrogenize

java.lang.Object
chemaxon.calculations.hydrogenize.Hydrogenize
All Implemented Interfaces:
StereoConstants

@PublicApi public class Hydrogenize extends Object implements StereoConstants
Addition and removal of explicit hydrogens or lone pairs.
Since:
Marvin 2.4, 04/24/2000
  • Constructor Details

    • Hydrogenize

      public Hydrogenize()
  • Method Details

    • addHAtoms

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static boolean addHAtoms(MoleculeGraph m, MolAtom[] atoms)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds Hydrogen atoms to specified atoms in a molecule. Same as convertImplicitHToExplicit(m, atoms).
      Parameters:
      m - the molecule to add Hydrogen atoms to.
      atoms - the atoms to add Hydrogen atoms to, null for all
      Returns:
      true if Hydrogen atoms were successfully added
    • convertImplicitHToExplicit

      public static boolean convertImplicitHToExplicit(MoleculeGraph m, MolAtom[] atoms)
      Converts implicit Hydrogen atoms of the specified atoms in a molecule to explicit. Same as convertImplicitHToExplicit(m, atoms, 0).
      Parameters:
      m - the molecule to add Hydrogen atoms to.
      atoms - the atoms to add Hydrogen atoms to, null for all
      Returns:
      true if Hydrogen atoms were successfully added
    • addHAtoms

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static boolean addHAtoms(MoleculeGraph m)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since Marvin 5.11, use convertImplicitHToExplicit(MoleculeGraph) instead
      Adds Hydrogen atoms to all atoms in a molecule. Same as convertImplicitHToExplicit(m).
      Parameters:
      m - the molecule to add Hydrogen atoms to.
      Returns:
      true if Hydrogen atoms were successfully added
    • convertImplicitHToExplicit

      public static boolean convertImplicitHToExplicit(MoleculeGraph m)
      Converts implicit Hydrogen atoms of the molecule to explicit. Same as convertImplicitHToExplicit(m, null, 0).
      Parameters:
      m - the molecule to add Hydrogen atoms to.
      Returns:
      true if Hydrogen atoms were successfully added
    • addHAtoms

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static boolean addHAtoms(MoleculeGraph m, MolAtom[] atoms, int flags)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds Hydrogen atoms to specified atoms in a molecule. Same as convertImplicitHToExplicit(m, atoms, flags).
      Parameters:
      m - the molecule to add Hydrogen atoms to.
      atoms - the atoms to add Hydrogen atoms to, null for all
      flags - set this flag to MoleculeGraph.OMIT_POSTCLEAN to include partial clean after Hydrogen atom addition.
      Returns:
      true if Hydrogen atoms were successfully added
    • convertImplicitHToExplicit

      public static boolean convertImplicitHToExplicit(MoleculeGraph m, MolAtom[] atoms, int flags)
      Converts implicit Hydrogen atoms of the specified atoms in a molecule to explicit.
      Parameters:
      m - the molecule to add Hydrogen atoms to.
      atoms - the atoms to add Hydrogen atoms to, null for all
      flags - set this flag to MoleculeGraph.OMIT_POSTCLEAN to exclude partial clean after Hydrogen atom addition.
      Returns:
      true if Hydrogen atoms were successfully added
    • removeHAtoms

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static boolean removeHAtoms(MoleculeGraph m, int flags)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since Marvin 5.11, use convertExplicitHToImplicit(MoleculeGraph, int) instead
      Removes Hydrogen atoms from atoms in a molecule.
      Parameters:
      m - the molecule to remove Hydrogen atoms from.
      flags - to use special removal conditions set
      Returns:
      true if specified Hydrogen atoms were successfully removed.
      See Also:
    • convertExplicitHToImplicit

      public static boolean convertExplicitHToImplicit(MoleculeGraph m, int flags)
      Converts explicit Hydrogen atoms of the molecule to implicit.
      Parameters:
      m - the molecule to remove Hydrogen atoms from.
      flags - the flags to specify special removal conditions, see convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean) for the details.
      Returns:
      true if specified Hydrogen atoms were successfully removed.
    • removeHAtoms

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static boolean removeHAtoms(MoleculeGraph m)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since Marvin 5.11, use convertExplicitHToImplicit(MoleculeGraph) instead
      Removes Hydrogen atoms from a molecule. Besides lonely and wedged H atoms, bound (to non-Hydrogen atom and without Hydrogen bond), non-isotope, neutral, non-radical, non-mapped H atoms are also removed.
      Parameters:
      m - the molecule to remove Hydrogen atoms from.
      Returns:
      true if Hydrogen atoms were successfully removed.
      See Also:
    • convertExplicitHToImplicit

      public static boolean convertExplicitHToImplicit(MoleculeGraph m)
      Converts explicit Hydrogen atoms of the molecule to implicit. Same as convertExplicitHToImplicit(m, MolAtom.LONELY_H | MolAtom.WEDGED_H | MolAtom.METALCONNECTED_H). Besides lonely and wedged H atoms, bound (to non-Hydrogen atom and without Hydrogen bond), non-isotope, neutral, non-radical, non-mapped H atoms are also removed.
      Parameters:
      m - the molecule to remove Hydrogen atoms from.
      Returns:
      true if Hydrogen atoms were successfully removed.
      See Also:
    • removeHAtoms

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static boolean removeHAtoms(MoleculeGraph m, MolAtom[] atoms, int flags)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes Hydrogen atoms from specified atoms of a molecule.
      Parameters:
      m - the molecule to remove Hydrogen atoms from.
      atoms - the subset of atoms to include or null for all
      flags - to use special removal conditions
    • convertExplicitHToImplicit

      public static boolean convertExplicitHToImplicit(MoleculeGraph m, MolAtom[] atoms, int flags)
      Converts explicit Hydrogen atoms attached to the specified atoms of the molecule to implicit.
      Parameters:
      m - the molecule to remove Hydrogen atoms from.
      atoms - the subset of atoms to include or null for all
      flags - the flags to specify special removal conditions, see convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean) for the details.
    • convertExplicitHToImplicit

      public static boolean convertExplicitHToImplicit(MoleculeGraph m, MolAtom[] atoms, int flags, boolean check)
      Converts explicit Hydrogen atoms attached to the specified atoms of a molecule to implicit.
      Parameters:
      m - the molecule to remove Hydrogen atoms from.
      atoms - the subset of atoms to include or null for all
      flags - the flags to specify special removal conditions:
      • MolAtom.ALL_H for including any Hydrogen atom for removal.
      • MolAtom.LONELY_H for including lonely Hydrogen atom(s) for removal. Hydrogen atoms with only Hydrogen bonds counted as lonely.
      • MolAtom.ISOTOPE_H for including Hydrogen isotope(s) for removal.
      • MolAtom.CHARGED_H for including charged Hydrogen atom(s) for removal.
      • MolAtom.RADICAL_H for including radical Hydrogen atom(s) for removal.
      • MolAtom.MAPPED_H for including mapped Hydrogen atom(s) for removal.
      • MolAtom.WEDGED_H for including Hydrogen atom(s) with wedge bonds for removal.
      • MolAtom.HCONNECTED_H for including Hydrogen atom(s) connected to another Hydrogen atom only for removal.
      • MolAtom.METALCONNECTED_H for including Hydrogen atom(s) connected to metal atoms.
      • MolAtom.HBONDED_H for including Hydrogen atom(s) having a Hydrogen bond connected to them for removal.
      • MolAtom.CTSPECIFIC_H for including to remove the Hydrogen atom(s) connecting alone to one side of a double bond with specified CIS or TRANS stereo information.
      • MolAtom.POLYMERENDGROUP_H for including Hydrogen atom(s) which have a neighbor that is in an Sgroup (not DataSgroup or SuperatomSgroup).
      • MolAtom.SGROUPEND_H for including Hydrogen atom(s) which have a neighbor that is in SuperatomSgroup.
      • MolAtom.VALENCEERROR_H for including Hydrogen atom(s) connected to an atom with valence error.
      • MolAtom.SGROUP_H for including Hydrogen atom(s) which are in one element Sgroups.
      • MolAtom.BRIDGEHEAD_H for including Hydrogen atom which is connected to a bridgehead atom.
      check - checks if the given atoms belong to the given molecule.
      Returns:
      true if specified Hydrogen atoms were successfully removed.
      See Also:
    • removeHAtoms

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static boolean removeHAtoms(MoleculeGraph m, MolAtom[] atoms, int flags, boolean check)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes Hydrogen atoms from specified atoms of a molecule.
      Parameters:
      m - the molecule to remove Hydrogen atoms from.
      atoms - the subset of atoms to include or null for all
      flags - to use special removal conditions set this flag to:
      • MolAtom.ALL_H for including any Hydrogen atom for removal.
      • MolAtom.LONELY_H for including lonely Hydrogen atom(s) for removal. Hydrogen atoms with only Hydrogen bonds counted as lonely.
      • MolAtom.ISOTOPE_H for including Hydrogen isotope(s) for removal.
      • MolAtom.CHARGED_H for including charged Hydrogen atom(s) for removal.
      • MolAtom.RADICAL_H for including radical Hydrogen atom(s) for removal.
      • MolAtom.MAPPED_H for including mapped Hydrogen atom(s) for removal.
      • MolAtom.WEDGED_H for including Hydrogen atom(s) with wedge bonds for removal.
      • MolAtom.HCONNECTED_H for including Hydrogen atom(s) connected to another Hydrogen atom only for removal.
      • MolAtom.CTSPECIFIC_H for including to remove the Hydrogen atom(s) connecting alone to one side of a double bond with specified CIS or TRANS stereo information.
      • MolAtom.POLYMERENDGROUP_H for including Hydrogen atom(s) which have a neighbor that is in an Sgroup (not DataSgroup or SuperatomSgroup).
      • MolAtom.SGROUPEND_H for including Hydrogen atom(s) which have a neighbor that is in SuperatomSgroup.
      • MolAtom.VALENCEERROR_H for including Hydrogen atom(s) connected to an atom with valence error.
      • MolAtom.SGROUP_H for including Hydrogen atom(s) which are in one element Sgroups.
      • MolAtom.BRIDGEHEAD_H for including Hydrogen atom which is connected to a bridgehead atom.
      check - checks if the given atoms belong to the given molecule.
      Returns:
      true if specified Hydrogen atoms were successfully removed.
      See Also:
    • convertImplicitLonePairsToExplicit

      public static boolean convertImplicitLonePairsToExplicit(MoleculeGraph m, MolAtom[] atoms)
      Convert implicit lone pairs of the atoms of a molecule to explicit.
      Parameters:
      m - the molecule to add lone pairs to.
      atoms - the atoms to include for lone pair addition, null for all
      Returns:
      true if lone pairs were successfully added false otherwise
    • addLonePairs

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static boolean addLonePairs(MoleculeGraph m, MolAtom[] atoms)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds lone pairs to atoms of a molecule.
      Parameters:
      m - the molecule to add lone pairs to.
      atoms - the atoms to include for lone pair addition, null for all
      Returns:
      true if lone pairs were successfully added false otherwise
    • convertExplicitLonePairsToImplicit

      public static boolean convertExplicitLonePairsToImplicit(MoleculeGraph m)
      Converts explicit lone pairs from a molecule to implicit.
      Parameters:
      m - the molecule to remove lone pairs from.
      Returns:
      true if lone pairs were successfully removed false otherwise.
    • removeLonePairs

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static boolean removeLonePairs(MoleculeGraph m)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes lone pairs from a molecule.
      Parameters:
      m - the molecule to remove lone pairs from.
      Returns:
      true if lone pairs were successfully removed false otherwise.
    • isBridgeHeadAtom

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static boolean isBridgeHeadAtom(MoleculeGraph mol, int atom)
      Deprecated, for removal: This API element is subject to removal in a future version.
      as of Marvin 5.11.1, replaced by TopologyUtil.isBridgeHeadAtom(MoleculeGraph, int)
      Test whether the given atom is bridgehead.
      Parameters:
      mol - molecule
      atom - atom to check
      Returns:
      true if the given atom is bridgehead else false
    • getImplicitizableHList

      public static boolean[] getImplicitizableHList(Molecule m, int flags)
      Gets which atom is an implicitizable hydrogen.
      Returns:
      a boolean array. The i-th element of the array is true if the i-th atom of the molecule is an implicitizable hydrogen.