@Beta @PublicAPI public final class StandardizerWrappers extends Object
StandardizerWrapper
.
Please note that the ThreadLocal
based thread safety fix might lead to unexpected memory leaks when
worker threads invoking the provided wrappers are pooled. To mitigate this problem make the reference to the
wrapper inacessable allowing the garbage collector to free the thread local copies up.
Note that an alternative approach would be to implement a Closeable
semantics to allow explicitly freeing
up the copies, however this is currently considered not viable.
Please note that this interface is marked with {@link Beta} annotation, so it can be subject of incompatible changes or removal in later releases.
Modifier and Type | Method and Description |
---|---|
static StandardizerWrapper |
aromatizeBasic()
Wrap basic aromatization.
|
static StandardizerWrapper |
aromatizeGeneral()
Wrap general aromatization.
|
static StandardizerWrapper |
aromatizeLoose()
Wrap loose aromatization.
|
static StandardizerWrapper |
chainOf(StandardizerWrapper... s)
Create a chained wrapper.
|
static StandardizerWrapper |
fromStandardizer(Standardizer standardizer)
Extract actions from a
Standardizer instance. |
static StandardizerWrapper |
fromStandardizerCfgLocation(String cfglocation)
Wrap a
Standardizer with config file location. |
static StandardizerWrapper |
fromStandardizerConfigXml(String configXml)
Wrap a
Standardizer with config XML location. |
static StandardizerWrapper |
identityStandardizer()
Identity standardization.
|
static StandardizerWrapper |
removeAllExplicitH()
Remove all explicit H atoms.
|
static StandardizerWrapper |
removeSmallFragments()
Remove small fragments (disconnected components).
|
public static StandardizerWrapper fromStandardizerCfgLocation(String cfglocation)
Standardizer
with config file location.
The returned wrapper uses ThreadLocal
clones of the supplied Standardizer
. For details
see fromStandardizer(chemaxon.standardizer.Standardizer)
cfglocation
- Config file locationIllegalArgumentException
- upon initialization proble,public static StandardizerWrapper fromStandardizerConfigXml(String configXml)
Standardizer
with config XML location.
The returned wrapper uses ThreadLocal
clones of the supplied Standardizer
. For details
see fromStandardizer(chemaxon.standardizer.Standardizer)
The returned wrapper is serializable and thread safe. Apart from the ThreadLocal
storage state it is
immutable.
configXml
- Configuration file locationIllegalArgumentException
- upon initialization proble,public static StandardizerWrapper fromStandardizer(Standardizer standardizer)
Standardizer
instance.
Note that only the following actions are supported:
AromatizeAction
maps to Aromatize
RemoveExplicitHydrogensAction
maps to RemoveExplicitH
standardizer
- Standardizer to extract enabled actionsIllegalArgumentException
- when non supported action found or a not valid
(StandardizerAction.isValid()
) action foundpublic static StandardizerWrapper identityStandardizer()
public static StandardizerWrapper chainOf(StandardizerWrapper... s)
s
- Stepspublic static StandardizerWrapper aromatizeBasic()
public static StandardizerWrapper aromatizeGeneral()
public static StandardizerWrapper aromatizeLoose()
public static StandardizerWrapper removeAllExplicitH()
Hydrogenize.convertExplicitHToImplicit(chemaxon.struc.MoleculeGraph, int)
with flags
value MolAtom.ALL_H
to remove all explicit H atoms. This includes lonely, h-bonded, isotope, charged
and others, for details see documentation of
Hydrogenize.convertExplicitHToImplicit(chemaxon.struc.MoleculeGraph, chemaxon.struc.MolAtom[], int, boolean)
.public static StandardizerWrapper removeSmallFragments()