Class StandardizerWrappers
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.
- See Also:
-
- http://www.javacodegeeks.com/2013/01/how-to-shoot-yourself-in-foot-with-threadlocals.html
-
http://stackoverflow.com/questions/817856/when-and-how-should-i-use-a-threadlocal-variable
Please note that this interface is marked with Beta annotation, so it can be subject of incompatible changes or removal in later releases.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StandardizerWrapper
Wrap basic aromatization.static StandardizerWrapper
Wrap general aromatization.static StandardizerWrapper
Wrap loose aromatization.static StandardizerWrapper
chainOf
(StandardizerWrapper... s) Create a chained wrapper.static StandardizerWrapper
fromStandardizer
(Standardizer standardizer) Extract actions from aStandardizer
instance.static StandardizerWrapper
fromStandardizerConfigXml
(String configXml) Wrap aStandardizer
with config XML location.static StandardizerWrapper
Identity standardization.static StandardizerWrapper
Remove all explicit H atoms.static StandardizerWrapper
Remove small fragments (disconnected components).
-
Method Details
-
fromStandardizerConfigXml
Wrap aStandardizer
with config XML location.The returned wrapper uses
ThreadLocal
clones of the suppliedStandardizer
. For details seefromStandardizer(chemaxon.standardizer.Standardizer)
The returned wrapper is serializable and thread safe. Apart from the
ThreadLocal
storage state it is immutable.- Parameters:
configXml
- Configuration file location- Returns:
- Wrapped and initialzied Standardizer
- Throws:
IllegalArgumentException
- upon initialization proble,
-
fromStandardizer
Extract actions from aStandardizer
instance.Note that only the following actions are supported:
AromatizeAction
maps toStandardizerWrappers.Aromatize
RemoveExplicitHydrogensAction
maps toStandardizerWrappers.RemoveExplicitH
- Parameters:
standardizer
- Standardizer to extract enabled actions- Returns:
- Wrapper
- Throws:
IllegalArgumentException
- when non supported action found or a not valid (StandardizerAction.isValid()
) action found
-
identityStandardizer
Identity standardization.- Returns:
- Wrapper doing nothing
-
chainOf
Create a chained wrapper.- Parameters:
s
- Steps- Returns:
- Chained wrapper
-
aromatizeBasic
Wrap basic aromatization.- Returns:
- Wrapper
-
aromatizeGeneral
Wrap general aromatization.- Returns:
- Wrapper
-
aromatizeLoose
Wrap loose aromatization.- Returns:
- Wrapper
-
removeAllExplicitH
Remove all explicit H atoms.Delegates
Hydrogenize.convertExplicitHToImplicit(chemaxon.struc.MoleculeGraph, int)
withflags
valueMolAtom.ALL_H
to remove all explicit H atoms. This includes lonely, h-bonded, isotope, charged and others, for details see documentation ofHydrogenize.convertExplicitHToImplicit(chemaxon.struc.MoleculeGraph, chemaxon.struc.MolAtom[], int, boolean)
.- Returns:
- Wrapper
-
removeSmallFragments
Remove small fragments (disconnected components).Implicit H atoms are also considered. When multiple largest fragments )having the same size) are found the behavior is not specified currently.
- Returns:
- Wrapper
-