Class MoleculeStandardizer


  • public class MoleculeStandardizer
    extends java.lang.Object
    MoleculeStandardizer
    Version:
    1.0 Apr 5, 2012 MvK: Start implementation Oct 2020 MvK,TLS: improved performance and adapted standardization according to following publication: Bento, A. P., Hersey, A., Félix, E., Landrum, G., Gaulton, A., Atkinson, F., ... & Leach, A. R. (2020). An open source chemical structure curation pipeline using RDKit. Journal of Cheminformatics, 12(1), 1-16.
    Exceptions: - S=O is not transformed into S(+)-O(-)
    - If charges (e.g. quarternary nitrogen) cannot be balanced, then Na(+) or Cl(-) are added to neutralize as last resort
    Author:
    Modest von Korff, Thomas Sander
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static StereoMolecule getStandardized​(java.lang.String idcode, java.lang.String coordinates, int mode)
      Under normal circumstances, one should never need to standardize a molecule from an idcode, because molecules should be standardized before generating the canonical encoding.
      static void standardize​(StereoMolecule mol, int mode)
      Standardises a molecule and fixes some structural errors.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MoleculeStandardizer

        public MoleculeStandardizer()
    • Method Detail

      • getStandardized

        public static StereoMolecule getStandardized​(java.lang.String idcode,
                                                     java.lang.String coordinates,
                                                     int mode)
                                              throws java.lang.Exception
        Under normal circumstances, one should never need to standardize a molecule from an idcode, because molecules should be standardized before generating the canonical encoding. An exception is when generating the parent structure using mode MODE_GET_PARENT and potentially MODE_ADD_NA_AND_CL.
        Parameters:
        idcode -
        coordinates - if null the result may change.
        mode - 0 or any combination of MODE_GET_PARENT and MODE_ADD_NA_AND_CL
        Returns:
        Throws:
        java.lang.Exception
      • standardize

        public static void standardize​(StereoMolecule mol,
                                       int mode)
                                throws java.lang.Exception
        Standardises a molecule and fixes some structural errors. Typically this is done before canonicalization. It includes the following changes:
        - different forms of functional groups (e.g. nitro) are normalized to a preferred one
        - charged acidic or basic atoms are (de-)protonated to remove charges and neutralize the molecule, if possible.
        - alkali/earthalkali/halogene atoms, if charged despite being covalently bound, get uncharged
        - trivalent, uncharged oxygens get a positive charge
        - unusual amide tautomeric structures, if not in a ring, are inverted
        - uncharged isocyano groups get proper charges to validate valences
        - wrongly charged azido groups get proper charges to validate valences
        - uncharged, quarternary nitrogens get a positive charge
        If mode includes MODE_GET_PARENT, then only the largest, normalized fragment is kept. If mode includes MODE_ADD_NA_AND_CL, then molecules, that are still charged after normalization, e.g. quarternary ammonium, are neutralized by adding the right amount of Na+ or Cl- ions.
        Parameters:
        mol -
        mode - 0 or any combination of MODE_GET_PARENT and MODE_ADD_NA_AND_CL
        Throws:
        java.lang.Exception