Class StandardizerRunner


  • @PublicAPI
    public class StandardizerRunner
    extends Object
    Concurrent executor of the standardizer
    Since:
    6.0
    • Constructor Detail

      • StandardizerRunner

        @Deprecated
        public StandardizerRunner​(Iterator<Molecule> input,
                                  StandardizerConfiguration configuration)
        Deprecated.
        Won't be public in the future
        Constructs a parallel standardizer runner based on the available processor number.
        Parameters:
        input - the input molecule iterator
        configuration - the standardizer configuration to apply concurrently
      • StandardizerRunner

        @Deprecated
        public StandardizerRunner​(Iterator<Molecule> input,
                                  StandardizerConfiguration configuration,
                                  int threadCount)
        Deprecated.
        Won't be public in the future
        Constructs a parallel standardizer runner that will use specified number of threads for standardization.
        Parameters:
        input - the input molecule iterator
        configuration - the standardizer configuration to apply concurrently
        threadCount - the number of standardizer threads
      • StandardizerRunner

        @Deprecated
        public StandardizerRunner​(Iterator<Molecule> input,
                                  StandardizerConfiguration configuration,
                                  int threadCount,
                                  String reportPropertyName)
        Deprecated.
        Won't be public in the future
        Constructs a parallel standardizer runner that will use specified number of threads for standardization.
        Parameters:
        input - the input molecule iterator
        configuration - the standardizer configuration to apply concurrently
        threadCount - the number of standardizer threads
        reportPropertyName - the property name to report the applied actions to
    • Method Detail

      • iterator

        public static Iterator<Molecule> iterator​(Iterator<Molecule> iterator,
                                                  StandardizerConfiguration configuration,
                                                  int threadCount,
                                                  StandardizerRunner.ErrorHandlingPolicy policy,
                                                  String reportPropertyName)
        Returns an iterator that will wrap the specified iterator and standardizes all molecules.
        IMPORTANT NOTE: in case of StandardizerRunner.ErrorHandlingPolicy.HALT the method Iterator.next() of the resulted molecule iterator may throw IllegalArgumentException, if exception occurred during standardization. The thrown exception wraps the original exception.
        NOTE: the returned iterator not supports Iterator.remove().
        Parameters:
        iterator - the iterator containing the molecules to be standardized
        configuration - the configuration to apply on the iterator
        threadCount - the number of threads to use for standardization
        policy - the error handling policy
        reportPropertyName - the name of the property to report applied standardizer actions to
        Returns:
        an iterator that iterates through the standardized molecules of the original iterator
      • resultIterator

        public static Iterator<StandardizerResult> resultIterator​(Iterator<Molecule> iterator,
                                                                  StandardizerConfiguration configuration,
                                                                  int threadCount,
                                                                  String reportPropertyName)
        Returns an iterator that will wrap the specified iterator and standardizes all molecules. NOTE: the returned iterator not supports Iterator.remove().
        Parameters:
        iterator - the iterator to wrap
        configuration - the configuration to apply on the iterator
        threadCount - the number of threads to use for standardization
        reportPropertyName - the name of the property to report applied standardizer actions to
        Returns:
        an iterator that iterates through the standardization results of the original iterator
      • resultIterator

        public static Iterator<StandardizerResult> resultIterator​(Iterator<Molecule> iterator,
                                                                  StandardizerConfiguration configuration,
                                                                  int threadCount,
                                                                  String reportPropertyName,
                                                                  boolean saveChangeList)
        Returns an iterator that will wrap the specified iterator and standardizes all molecules. NOTE: the returned iterator does not support Iterator.remove().
        Parameters:
        iterator - the iterator to wrap
        configuration - the configuration to apply on the iterator
        threadCount - the number of threads to use for standardization
        reportPropertyName - the name of the property to report applied standardizer actions to
        saveChangeList - sets to save the molecule modifications of each performed standardizer action; if true then the changes will be saved
        Returns:
        an iterator that iterates through the standardization results of the original iterator
        Since:
        JChem 6.4
      • standardize

        public static void standardize​(MolImporter importer,
                                       MolExporter exporter,
                                       StandardizerConfiguration configuration,
                                       int threadCount,
                                       StandardizerRunner.ErrorHandlingPolicy policy,
                                       String reportPropertyName)
                                throws MolExportException,
                                       IOException
        Reads the molecules from the importer, standardizes them, and writes to the exporter.
        Parameters:
        importer - the importer to read molecules from
        exporter - the exporter to write standardized molecules to
        configuration - the configuration to be applied on the molecules
        threadCount - the number of threads to use for standardization
        policy - the error handling policy
        reportPropertyName - the name of the property to report applied standardizer actions to
        Throws:
        MolExportException - on export failure
        IOException - on export failure