chemaxon.calculations.hydrogenize
Class Hydrogenize

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

public class Hydrogenize
extends java.lang.Object
implements StereoConstants

Addition and removal of explicit hydrogens or lone pairs.

Since:
Marvin 2.4, 04/24/2000
Version:
5.0, 11/27/2007
Author:
Peter Csizmadia, Andras Volford, Erika Biro, Zsuzsanna Szabo

Field Summary
 
Fields inherited from interface chemaxon.struc.StereoConstants
ANTI, ATOMSTEREO_EITHER, ATOMSTEREO_MASK, ATOMSTEREO_NONE, ATOMSTEREO_SPECIFIC, CHIRALITY_M, CHIRALITY_MASK, CHIRALITY_P, CHIRALITY_r, CHIRALITY_R, CHIRALITY_s, CHIRALITY_S, CHIRALITYSUPPORT_ALL, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, ENDO, EXO, PARITY_ALLENE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_ODD, PARITY_TETRAHEDRAL, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, SYN, TRANS
 
Constructor Summary
Hydrogenize()
           
 
Method Summary
static boolean addHAtoms(MoleculeGraph m)
          Deprecated. since Marvin 5.11 use convertImplicitHToExplicit(MoleculeGraph) instead
static boolean addHAtoms(MoleculeGraph m, MolAtom[] atoms)
          Deprecated. since Marvin 5.11 use convertImplicitHToExplicit(MoleculeGraph, MolAtom[]) instead
static boolean addHAtoms(MoleculeGraph m, MolAtom[] atoms, int flags)
          Deprecated. since Marvin 5.11 use convertImplicitHToExplicit(MoleculeGraph, MolAtom[], int) instead
static boolean addLonePairs(MoleculeGraph m, MolAtom[] atoms)
          Deprecated. since Marvin 5.11 use convertImplicitLonePairsToExplicit(MoleculeGraph, MolAtom[]) isntead
static boolean convertExplicitHToImplicit(MoleculeGraph m)
          Convert explicit Hydrogen atoms of the molecule to implicit.
static boolean convertExplicitHToImplicit(MoleculeGraph m, int flags)
          Convert explicit Hydrogen atoms of the molecule to implicit.
static boolean convertExplicitHToImplicit(MoleculeGraph m, MolAtom[] atoms, int flags)
          Convert explicit Hydrogen atoms attached to the specified atoms of the molecule to implicit.
static boolean convertExplicitHToImplicit(MoleculeGraph m, MolAtom[] atoms, int flags, boolean check)
          Convert explicit Hydrogen atoms attached to the specified atoms of a molecule to implicit.
static boolean convertExplicitLonePairsToImplicit(MoleculeGraph m)
          Converts explicit lone pairs from a molecule to implicit.
static boolean convertImplicitHToExplicit(MoleculeGraph m)
          Convert implicit Hydrogen atoms of the molecule to explicit.
static boolean convertImplicitHToExplicit(MoleculeGraph m, MolAtom[] atoms)
          Convert implicit Hydrogen atoms of the specified atoms in a molecule to explicit.
static boolean convertImplicitHToExplicit(MoleculeGraph m, MolAtom[] atoms, int flags)
          Convert implicit Hydrogen atoms of the specified atoms in a molecule to explicit.
static boolean convertImplicitLonePairsToExplicit(MoleculeGraph m, MolAtom[] atoms)
          Convert implicit lone pairs of the atoms of a molecule to explicit.
static boolean[] getImplicitizableHList(Molecule m, int flags)
          Gets which atom is an implicitizable hydrogen.
static boolean isBridgeHeadAtom(MoleculeGraph mol, int atom)
          Deprecated. as of Marvin 5.11.1, replaced by TopologyUtil.isBridgeHeadAtom(MoleculeGraph, int)
static boolean removeHAtoms(MoleculeGraph m)
          Deprecated. since Marvin 5.11 use convertExplicitHToImplicit(MoleculeGraph) instead
static boolean removeHAtoms(MoleculeGraph m, int flags)
          Deprecated. since Marvin 5.11 use convertExplicitHToImplicit(MoleculeGraph, int) instead
static boolean removeHAtoms(MoleculeGraph m, MolAtom[] atoms, int flags)
          Deprecated. since Marvin 5.11 use convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int) instead
static boolean removeHAtoms(MoleculeGraph m, MolAtom[] atoms, int flags, boolean check)
          Deprecated. since Marvin 5.11 use convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean) instead
static boolean removeLonePairs(MoleculeGraph m)
          Deprecated. since Marvin 5.11 use convertExplicitLonePairsToImplicit(MoleculeGraph) instead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hydrogenize

public Hydrogenize()
Method Detail

addHAtoms

public static boolean addHAtoms(MoleculeGraph m,
                                MolAtom[] atoms)
Deprecated. since Marvin 5.11 use convertImplicitHToExplicit(MoleculeGraph, MolAtom[]) instead

Adds Hydrogen atoms to specified atoms in a molecule. Same as addHAtoms(m, null, MolAtom.LONELY_H | MolAtom.WEDGED_H)

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)
Convert implicit Hydrogen atoms of the specified atoms in a molecule to explicit. Same as convertImplicitHToExplicit(m, null, MolAtom.LONELY_H | MolAtom.WEDGED_H)

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

public static boolean addHAtoms(MoleculeGraph m)
Deprecated. since Marvin 5.11 use convertImplicitHToExplicit(MoleculeGraph) instead

Adds Hydrogen atoms to all atoms in a molecule. Same as addHAtoms(m, null, MolAtom.LONELY_H | MolAtom.WEDGED_H)

Parameters:
m - the molecule to add Hydrogen atoms to.
Returns:
true if Hydrogen atoms were successfully added

convertImplicitHToExplicit

public static boolean convertImplicitHToExplicit(MoleculeGraph m)
Convert implicit Hydrogen atoms of the molecule to explicit. Same as convertImplicitHToExplicit(m, null, MolAtom.LONELY_H | MolAtom.WEDGED_H)

Parameters:
m - the molecule to add Hydrogen atoms to.
Returns:
true if Hydrogen atoms were successfully added

addHAtoms

public static boolean addHAtoms(MoleculeGraph m,
                                MolAtom[] atoms,
                                int flags)
Deprecated. since Marvin 5.11 use convertImplicitHToExplicit(MoleculeGraph, MolAtom[], int) instead

Adds Hydrogen atoms to specified atoms in a molecule.

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)
Convert 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 include partial clean after Hydrogen atom addition.
Returns:
true if Hydrogen atoms were successfully added

removeHAtoms

public static boolean removeHAtoms(MoleculeGraph m,
                                   int flags)
Deprecated. 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(MoleculeGraph, MolAtom[], int, boolean)

convertExplicitHToImplicit

public static boolean convertExplicitHToImplicit(MoleculeGraph m,
                                                 int flags)
Convert explicit Hydrogen atoms of the molecule to implicit.

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(MoleculeGraph, MolAtom[], int, boolean)

removeHAtoms

public static boolean removeHAtoms(MoleculeGraph m)
Deprecated. since Marvin 5.11 use convertExplicitHToImplicit(MoleculeGraph) instead

Removes Hydrogen atoms from a molecule. Same as removeAtoms(m, MolAtom.LONELY_H | MolAtom.WEDGED_H). Besides lonely and wedged H atoms, bound (to non-Hydrogen atom), 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:
MolAtom.isImplicitizableH(int)

convertExplicitHToImplicit

public static boolean convertExplicitHToImplicit(MoleculeGraph m)
Convert explicit Hydrogen atoms of the molecule to implicit. Same as convertExplicitHToImplicit(m, MolAtom.LONELY_H | MolAtom.WEDGED_H). Besides lonely and wedged H atoms, bound (to non-Hydrogen atom), 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:
MolAtom.isImplicitizableH(int)

removeHAtoms

public static boolean removeHAtoms(MoleculeGraph m,
                                   MolAtom[] atoms,
                                   int flags)
Deprecated. since Marvin 5.11 use convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int) instead

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
See Also:
removeHAtoms(MoleculeGraph, MolAtom[], int, boolean)

convertExplicitHToImplicit

public static boolean convertExplicitHToImplicit(MoleculeGraph m,
                                                 MolAtom[] atoms,
                                                 int flags)
Convert 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 - to use special removal conditions
See Also:
removeHAtoms(MoleculeGraph, MolAtom[], int, boolean)

convertExplicitHToImplicit

public static boolean convertExplicitHToImplicit(MoleculeGraph m,
                                                 MolAtom[] atoms,
                                                 int flags,
                                                 boolean check)
Convert 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 - 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.
  • 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:
MolAtom.ALL_H, MolAtom.LONELY_H, MolAtom.ISOTOPE_H, MolAtom.CHARGED_H, MolAtom.RADICAL_H, MolAtom.MAPPED_H, MolAtom.WEDGED_H, MolAtom.HCONNECTED_H, MolAtom.CTSPECIFIC_H, MolAtom.POLYMERENDGROUP_H, MolAtom.SGROUPEND_H, MolAtom.VALENCEERROR_H, MolAtom.SGROUP_H, MolAtom.BRIDGEHEAD_H

removeHAtoms

public static boolean removeHAtoms(MoleculeGraph m,
                                   MolAtom[] atoms,
                                   int flags,
                                   boolean check)
Deprecated. since Marvin 5.11 use convertExplicitHToImplicit(MoleculeGraph, MolAtom[], int, boolean) instead

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.
  • 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:
MolAtom.ALL_H, MolAtom.LONELY_H, MolAtom.ISOTOPE_H, MolAtom.CHARGED_H, MolAtom.RADICAL_H, MolAtom.MAPPED_H, MolAtom.WEDGED_H, MolAtom.HCONNECTED_H, MolAtom.CTSPECIFIC_H, MolAtom.POLYMERENDGROUP_H, MolAtom.SGROUPEND_H, MolAtom.VALENCEERROR_H, MolAtom.SGROUP_H, MolAtom.BRIDGEHEAD_H

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

public static boolean addLonePairs(MoleculeGraph m,
                                   MolAtom[] atoms)
Deprecated. since Marvin 5.11 use convertImplicitLonePairsToExplicit(MoleculeGraph, MolAtom[]) isntead

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

public static boolean removeLonePairs(MoleculeGraph m)
Deprecated. since Marvin 5.11 use convertExplicitLonePairsToImplicit(MoleculeGraph) instead

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

public static boolean isBridgeHeadAtom(MoleculeGraph mol,
                                       int atom)
Deprecated. as of Marvin 5.11.1, replaced by TopologyUtil.isBridgeHeadAtom(MoleculeGraph, int)

Test wheter 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.

Parameters:
m -
flags -
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.