Class CalculatorPlugin

    • Field Detail

      • keepHydrogens

        protected boolean keepHydrogens
      • INCORRECT_AROMATIC_NITROGEN_REMARK

        protected static final String INCORRECT_AROMATIC_NITROGEN_REMARK
        Incorrect aromatic nitrogen remark.
        See Also:
        Constant Field Values
      • INSTABLE_TAUTOMERIC_FORM_REMARK

        protected static final String INSTABLE_TAUTOMERIC_FORM_REMARK
        Instable tautomeric form remark.
        See Also:
        Constant Field Values
      • COVALENT_HYDRATION_ERROR_REMARK

        protected static final String COVALENT_HYDRATION_ERROR_REMARK
        Covalent hydration error remark.
        See Also:
        Constant Field Values
      • licenseEnvironment

        protected String licenseEnvironment
        Member storing license environment.
      • RED

        public static final int RED
        Constant storing the red rgb value (the acidic pKa result color).
        See Also:
        Constant Field Values
      • BLUE

        public static final int BLUE
        Constant storing the blue rgb value (the basic pKa result color).
        See Also:
        Constant Field Values
      • CALCRGB_OFF

        protected static final int CALCRGB_OFF
        Calculator rgb offset.
        See Also:
        Constant Field Values
      • ATOM

        public static final int ATOM
        Calculation domain type: calculation refers to atoms.
        See Also:
        Constant Field Values
      • MOLECULE

        public static final int MOLECULE
        Calculation domain type: calculation refers to the molecule.
        See Also:
        Constant Field Values
      • MOLECULES

        public static final int MOLECULES
        Calculation domain type: calculation refers to multiple molecule output.
        Since:
        Marvin 5.2
        See Also:
        Constant Field Values
      • EPSILON

        public static final double EPSILON
        The microspecies is ignored if its distribution is less than EPSILON for all pH values.
        See Also:
        Constant Field Values
      • explicitHydrogens

        protected List<CalculatorPlugin.HydrogenData> explicitHydrogens
        explicit hydrogens of the input molecule stored here key: index of the "parent" atom on the input molecule value: the hydrogen atom
    • Constructor Detail

      • CalculatorPlugin

        public CalculatorPlugin()
        Constructor. Initializes decimal format.
      • CalculatorPlugin

        @Beta
        public CalculatorPlugin​(Consumer<Molecule> sgExpander)
        Constructor. This constructor is intended to be used only internally. Please note that this constuctor is annotated with the Beta annotation, so it can be subject to incompatible changes or complete removal in any of the upcoming releases without further notification.
        Parameters:
        sgExpander - Method to use to expand sgroups.
      • CalculatorPlugin

        @Beta
        public CalculatorPlugin​(Consumer<Molecule> sgExpander,
                                Consumer<Molecule> sgContractor)
        Constructor. This constructor is intended to be used only internally. Please note that this constuctor is annotated with the Beta annotation, so it can be subject to incompatible changes or complete removal in any of the upcoming releases without further notification.
        Parameters:
        sgExpander - Method to use to expand sgroups.
        sgContractor - Method to use to contract sgroups.
    • Method Detail

      • getPluginResource

        public static URL getPluginResource​(String path)
        Returns the plugin JAR as resource URL, given the JAR file path relatively to the "plugins" directory.
        Parameters:
        path - is the relative jar file path
        Returns:
        the corresponding resource URL
      • readAttribute

        public static String readAttribute​(String attribute,
                                           String jar)
                                    throws PluginException
        Reads an attribute from JAR manifest.
        Parameters:
        attribute - is the attribute name
        jar - is the JAR file name
        Returns:
        the attribute value, or null if not exists
        Throws:
        PluginException
        Since:
        Marvin 4.0
      • create

        public static CalculatorPlugin create​(String clname,
                                              String jar)
                                       throws PluginException
        Loads a plugin, first tries to load it from CLASSPATH, then from JAR. If the plugin class name is null then it is read from the manifest attribute PLUGIN_CLASS_KEY.
        Parameters:
        clname - is the plugin class name
        jar - is the plugin JAR file name
        Returns:
        the created plugin
        Throws:
        PluginException
        Since:
        Marvin 4.0
      • loadClass

        public final Class loadClass​(String clname)
                              throws PluginException
        Loads a class, first tries from original CALSSPATH, then from the class loader used to load this plugin class.
        Parameters:
        clname - is the class name
        Returns:
        the Class object, or null if could not be loaded
        Throws:
        PluginException
        Since:
        Marvin 4.0
      • isRgrouped

        protected static boolean isRgrouped​(Molecule mol)
        Returns true if molecule with R-groups.
        Parameters:
        mol - is the molecule
        Returns:
        true if molecule with R-groups
      • containsPseudoAtom

        protected static boolean containsPseudoAtom​(Molecule mol)
        Returns true if molecule contains pseudo atom.
        Parameters:
        mol - the molecule to examine
        Returns:
        true if the molecule contains pseudo atom, false otherwise
      • containsMulticenterSgroup

        protected static boolean containsMulticenterSgroup​(Molecule mol)
        Decides whether a molecule contains Multicenter S-groups.
        Parameters:
        mol - the molecule to examine
        Returns:
        true if the molecule contains at least one MulticenterSgroup false otherwise.
      • containsSRUSgroup

        protected static boolean containsSRUSgroup​(Molecule mol)
        Decides whether a molecule contains SRU S-groups.
        Parameters:
        mol - the molecule to examine
        Returns:
        true if the molecule contains at least one SRU S-group false otherwise.
      • containsCoordinateBond

        protected static boolean containsCoordinateBond​(MoleculeGraph mol)
        Decides whether a molecule graph contains coordinate bonds.
        Parameters:
        mol - the molecule to examine
        Returns:
        true if the molecule contains at least one coordinate bond false otherwise.
      • removeWhitespace

        protected static String removeWhitespace​(String str)
        Removes whitespace characters from the given string.
        Parameters:
        str - is the string
        Returns:
        the string without whitespace characters
      • getDocument

        public static MDocument getDocument​(Molecule structure)
        Returns encapsulating document, creates it if needed.
        Parameters:
        structure - the molecule
        Returns:
        the encapsulating document
        Since:
        Marvin 5.0
      • isLicensed

        public boolean isLicensed()
        Returns true if the plugin is licensed. The license checking is based on the product name, returned by getProductName().
        Specified by:
        isLicensed in interface chemaxon.license.Licensable
        Returns:
        true if the plugin is licensed
      • setLicenseEnvironment

        public void setLicenseEnvironment​(String env)
        Sets license environment to be stored.
        Specified by:
        setLicenseEnvironment in interface chemaxon.license.Licensable
        Parameters:
        env - environment String to be stored and passed to the LicenseHandler in the isLicensed method
      • checkLicense

        protected final void checkLicense()
      • getProductName

        public abstract String getProductName()
        Returns the product identifier of the plugin as given by LicenseManager. The name is used by the isLicensed() method.
        Returns:
        product identifier or a default string
      • checkType

        protected void checkType​(String type,
                                 String[] typerange)
                          throws PluginException
        Checks result types.
        Parameters:
        type - is the type given by the user
        typerange - is the array containing the valid types
        Throws:
        PluginException - if the user-type is not contained in the type-range
      • getDoublePrecision

        public final int getDoublePrecision()
        Returns the precision. This is the max. number of fractional digits.
        Returns:
        the precision
      • setDoublePrecision

        protected final void setDoublePrecision​(String pr)
        Sets the precision in the decimal format. This is done according to the user defined precision value: 0..8 means maximal number of fractional digits, ending padded with zeros (e.g. 12.56 -> 12.5600 for precision 4). 'inf' means maximal number of digits set to 10, no padding zeros (e.g. 12.56 -> 12.56)
        Parameters:
        pr - is the precision string ("0"..."8" or "inf")
      • setDoublePrecision

        public final void setDoublePrecision​(int precision)
        Sets the double -> string conversion precision (maximal number of fraction digits) with zero-padding (12.56 -> 12.5600 if precision=4).
        Parameters:
        precision - is the precision
      • setDoublePrecision

        public final void setDoublePrecision​(int precision,
                                             boolean pad)
        Sets the double -> string conversion precision (maximal number of fraction digits).
        Parameters:
        precision - is the precision
        pad - is true if fractional ending zeros should be printed e.g. 12.56 -> 12.56 if precision=4, pad=false 12.56 -> 12.5600 if precision=4, pad=true
      • format

        public final String format​(double x)
        Converts a double into String, applying the maximum number of fractional digits specified.
        Parameters:
        x - is the double value to be converted
        Returns:
        the result as String
        See Also:
        setDoublePrecision(int precision, boolean pad)
      • format

        public final String format​(double x,
                                   int intlen)
        Converts a double into String, applying the maximum number of fractional digits specified. Adds leading spaces to ensure the given integral part length.
        Parameters:
        x - is the double value to be converted
        intlen - is the required integral part length
        Returns:
        the result as String
        See Also:
        setDoublePrecision(int precision, boolean pad)
      • format

        public final StringBuffer format​(double x,
                                         StringBuffer s)
        Converts a double into String, applying the maximum number of fractional digits specified. Appends the result to the specified StringBuffer.
        Parameters:
        x - is the double value to be converted
        s - is the StringBuffer to be used
        Returns:
        the StringBuffer with the current item appended
        See Also:
        setDoublePrecision(int precision, boolean pad)
      • format

        public final String format​(double[][] t,
                                   int intlen)
        Converts a double[][] 2xN table to a 2-column tab-separated string representation of the table.
        Parameters:
        t - is the table
        intlen - is the required integral part length
        Returns:
        the string representation
      • setProgressMonitor

        public void setProgressMonitor​(MProgressMonitor pmon)
        Sets a progress observer to be used in run() to display progress status. Short calculations may ignore the observer object. The default implementation does nothing.
        Parameters:
        pmon - is the progress monitor, may be null
      • setMolecule

        public final Molecule setMolecule​(Molecule mol)
                                   throws PluginException
        Sets the input molecule after standardization. Standardization includes plugin specific standardization (e.g. dehydrogenize, aromatize) and sgroup expansion. The input molecule is left unchanged (it is cloned for standardization).
        Parameters:
        mol - is the input molecule
        Returns:
        the molecule to be used for atom indexing
        Throws:
        PluginException - on error
      • setMolecule

        public Molecule setMolecule​(Molecule mol,
                                    boolean st)
                             throws PluginException
        Sets the input molecule after an optional standardization. Standardization includes plugin specific standardization (e.g. dehydrogenize, aromatize) and sgroup expansion. The input molecule is left unchanged (it is cloned if standardization is required).
        Parameters:
        mol - is the input molecule
        st - is true if standardization is required
        Returns:
        the molecule to be used for atom indexing
        Throws:
        PluginException - on error
      • setMolecule

        public Molecule setMolecule​(Molecule mol,
                                    boolean st,
                                    boolean om)
                             throws PluginException
        Sets the input molecule after an optional standardization and/or modification. Standardization includes plugin specific standardization (e.g. dehydrogenize, aromatize) and sgroup expansion, modification usually means taking a microspecies form, or the major tautomeric form of the input molecule (usually optional). The input molecule is left unchanged (it is cloned before standardization/modification if required).
        Parameters:
        mol - is the input molecule
        st - is true if standardization is required
        om - is true if original input molecule is to be used for atom indexing false if modified molecule is to be used for atom indexing
        Returns:
        the molecule to be used for atom indexing
        Throws:
        PluginException - on error
        See Also:
        setInputMolecule(Molecule), createStandardizedMolecule(Molecule), createModifiedInputMolecule(Molecule)
      • setAtomIndexMap

        protected boolean setAtomIndexMap​(int[] map)
      • getAtomIndexMap

        protected int[] getAtomIndexMap()
      • createModifiedInputMolecule

        protected Molecule createModifiedInputMolecule​(Molecule mol)
                                                throws PluginException
        Returns the modified input molecule (e.g. microspecies, major tautomeric form). This method is used for modifying the input molecule set by setMolecule(Molecule) before passing the molecule to the calulation with setInputMolecule(Molecule) method. The default implementation returns the input molecule itself.
        Parameters:
        mol - is the input molecule
        Returns:
        the modified input molecule
        Throws:
        PluginException
      • getInputMolDim

        public int getInputMolDim()
        Returns the input molecule dimension.
        Returns:
        the input molecule dimension
      • createStandardizedMolecule

        @Deprecated
        protected Molecule createStandardizedMolecule​(Molecule mol,
                                                      boolean om)
                                               throws PluginException
        Deprecated.
        Creates standardized molecule, the original input molecule is cloned. If handlesMultiFragmentMolecules() returns false then takes the largest fragment (measured by atom count). The cloned molecule is standardized by standardize(Molecule). Sets the atomIndexMap: atomIndexMap[i] is the index in the standardized molecule of the i-th atom in the original molecule or -1 if this atom has been removed.
        Parameters:
        mol - is the input molecule
        om - is true if original input molecule is to be used for atom indexing false if modified molecule is to be used for atom indexing
        Returns:
        the standardized molecule
        Throws:
        PluginException - on error
      • createStandardizedMolecule

        protected Molecule createStandardizedMolecule​(Molecule mol)
                                               throws PluginException
        Creates standardized molecule, the original input molecule is cloned. If handlesMultiFragmentMolecules() returns false then takes the largest fragment (measured by atom count). The cloned molecule is standardized by standardize(Molecule). Sets the atomIndexMap: atomIndexMap[i] is the index in the standardized molecule of the i-th atom in the original molecule or -1 if this atom has been removed.
        Parameters:
        mol - is the input molecule
        Returns:
        the standardized molecule
        Throws:
        PluginException - on error
        Since:
        Marvin 5.0
      • getMainMolecule

        @Deprecated
        protected Molecule getMainMolecule​(Molecule mol)
                                    throws PluginException
        Deprecated.
        Returns the molecule form with largest distribution. Returns a microspecies with largest distribution on a given pH if pH is different from Double.NaN, otherwise returns the input molecule itself. The default implementation returns the input molecule itself.
        Parameters:
        mol - is the input molecule
        Returns:
        the molecule form with largest distribution
        Throws:
        PluginException
      • getDisplayMolecule

        protected Molecule getDisplayMolecule()
                                       throws PluginException
        Returns the molecule object to be used for GUI display. Plugins will add atom labels and/or molecule properties to display plugin results in the molecule. The default implementation returns the original molecule.
        Returns:
        the molecule object to be used for GUI display
        Throws:
        PluginException - on error
      • handlesMultiFragmentMolecules

        public boolean handlesMultiFragmentMolecules()
        Returns true if the plugin handles multifragment molecules, false otherwise. In the latter case the plugin takes the fragment with more atoms if a multifragment molecule is given as input. The default implementation returns false.
        Returns:
        true if the plugin handles multifragment molecules, false otherwise
      • isMsCalc

        protected boolean isMsCalc()
        Returns true if microspecies calculation. The default implementation returns false.
        Returns:
        false
      • setParameters

        public void setParameters​(Properties params)
                           throws PluginException
        Sets the input parameters for the plugin.
        Parameters:
        params - is the parameter table
        Throws:
        PluginException - on error
      • getpH

        public double getpH()
        Returns the pH where the major microspecies should be taken. Returns Double.NaN if no microspecies calculation required.
        Returns:
        the pH where the major microspecies should be taken or Double.NaN if no microspecies calculation
      • checkMolecule

        public void checkMolecule​(Molecule mol)
                           throws PluginException
        Checks the input molecule. Throws exception if the molecule is not accepted as input molecule, otherwise does nothing (simply returns). The default implementation refuses query molecules, molecules with SRU S-groups, molecules with multicenter S-groups and molecules with coordinate bonds.
        Parameters:
        mol - is the input molecule
        Throws:
        PluginException - with error message for the user if the molecule is refused
      • getQueryMoleculeErrorMessage

        protected static String getQueryMoleculeErrorMessage​(Molecule mol)
      • setInputMolecule

        protected abstract void setInputMolecule​(Molecule mol)
                                          throws PluginException
        Sets the input molecule.
        Parameters:
        mol - is the input molecule
        Throws:
        PluginException - on error
      • isOK

        public boolean isOK()
        Returns true if no calculation error, false on error. This is the same as the return value of the last call to run(). The default implementation returns true if both getErrorMessage() and getWarningMessage() return the empty string.
        Returns:
        true if no calculation error or warning
        Since:
        Marvin 4.0
      • getErrorMessage

        public String getErrorMessage()
        Returns the calculation error information message if run() returned false (calculation error). The default implementation returns the empty string.
        Returns:
        the calculation error information message
      • getWarningMessage

        public String getWarningMessage()
        Returns the calculation warning information message. The default implementation returns the empty string.
        Returns:
        the calculation warning information message
      • getResultMessage

        public final String getResultMessage()
        Returns the plugin calculation error message, error or warning.
        Returns:
        the plugin calculation error message
      • getRemark

        public String getRemark()
        Returns the calculation remark. While in case of warning or error returned in getErrorMessage() or getWarningMessage() there is no calculation result, in case of a remark the calculation can be performed although the result may not be correct or precise - depending on the remark. The default implementation returns null.
        Returns:
        the calculation remark
      • getResultTypes

        public Object[] getResultTypes()
        Returns the result types. The default implementation returns null.
        Returns:
        the result types
      • getTypeString

        public String getTypeString​(Object type)
        Returns a string representation of the given type. The default implementation returns type.toString().
        Parameters:
        type - is the type object
        Returns:
        the type string
      • getResultDomain

        public int getResultDomain​(Object type)
        Returns the calculation domain ATOM, MOLECULE or MOLECULES. The default implementation returns MOLECULE.
        Parameters:
        type - is the result type
        Returns:
        the calculation domain
        See Also:
        getResultTypes()
      • canRepeat

        public boolean canRepeat()
        Returns true if repeatedly running the same plugin object while getting the results on the GUI is allowed, false otherwise. For internal use.
        Returns:
        true if allowed, false otherwise
        Since:
        Marvin 5.2
      • getResultCount

        public int getResultCount​(Object type)
        Returns the number of result items for the given result key. The default implementation returns 1.
        Parameters:
        type - is the result type
        Returns:
        the number of result items
        See Also:
        getResultTypes()
      • getResult

        public Object getResult​(Object type,
                                int index)
                         throws PluginException
        Returns the result item for the specified type and index. The default implementation returns null.
        Parameters:
        type - is the result type
        index - is the result index
        Returns:
        the result item for the specified type and index
        Throws:
        PluginException - if the result cannot be returned
        See Also:
        getResultTypes()
      • getResultAsString

        public String getResultAsString​(Object type,
                                        int index,
                                        Object result)
                                 throws PluginException
        Returns the specified result in String format. The default implementation returns null.
        Parameters:
        type - is the result type
        index - is the result index
        result - is the result item
        Returns:
        the specified result in String format
        Throws:
        PluginException - if an invalid result item is given
      • getResultsAsString

        public String getResultsAsString​(Object type,
                                         int index,
                                         Object result)
                                  throws PluginException
        Returns the specified result with possible subresults. (items separated by "|" characters) (e.g. both pKa values instead of the most significant pKa) in String format.
        Parameters:
        type - is the result type
        index - is the result index
        result - is the result item
        Returns:
        the specified result in String format
        Throws:
        PluginException - if an invalid result item is given
      • getResultAsRGB

        public int getResultAsRGB​(Object type,
                                  int index,
                                  Object result)
                           throws PluginException
        Returns the specified result color as int format (alpha<<24 + red<<16 + green<<8 + blue).
        Parameters:
        type - is the result type
        index - is the result index
        result - is the result item
        Returns:
        the specified result in color as int
        Throws:
        PluginException - if an invalid result item is given
      • getResultsAsRGB

        public long getResultsAsRGB​(Object type,
                                    int index,
                                    Object result)
                             throws PluginException
        Returns the specified result color(s) as int format (alpha<<24 + red<<16 + green<<8 + blue). (e.g. both pKa colors instead of the most significant pKa color) as long (lower and upper bits).
        Parameters:
        type - is the result type
        index - is the result index
        result - is the result item
        Returns:
        the specified result in color as int
        Throws:
        PluginException - if an invalid result item is given
      • isNegligibleResult

        public boolean isNegligibleResult​(Object type,
                                          int index,
                                          Object result)
                                   throws PluginException
        Returns whether the result can be ignored. Can be used to filter out out-of range values. The default implementation returns false.
        Parameters:
        type - is the result type
        index - is the result index
        result - is the result object
        Returns:
        true if the result can be ignored
        Throws:
        PluginException
      • getResult

        public Object getResult​(Object type,
                                String arg)
                         throws PluginException
        Returns the result item for the specified argument string. The default implementation calls getResult(Object, int) with the argument string converted to an integer (result index).
        Parameters:
        type - is the result type
        arg - is the argument string
        Returns:
        the result item for the specified type and argument string
        Throws:
        PluginException - if the result cannot be returned
        See Also:
        getResultTypes()
      • getResultMolecules

        public Molecule[] getResultMolecules()
                                      throws PluginException
        Returns the result molecule array for display. The display of the molecules in array have to be implemented in a class derived from CalculatorPluginDispaly class (example: MultipleDataDisplay class). Atomic results are stored in atom extra labels (MolAtom.getExtraLabel()). Molecular results are stored in molecule properties with keys being the result types (Molecule.getProperty(String)).
        Returns:
        the result molecule array
        Throws:
        PluginException - on error
        Since:
        Marvin 4.1
      • getResultSource

        public chemaxon.marvin.plugin.PluginMDocSource getResultSource()
                                                                throws PluginException
        Returns the result as a document source object. This is useful for displaying the molecules in a viewer dynamically as they become available instead of collecting all results before display. The default implementation returns null.
        Returns:
        the document source interface
        Throws:
        PluginException - on error
        Since:
        Marvin 5.0
      • getResultDomain

        public int getResultDomain()
        Returns the calculation domain ATOM, MOLECULE or MOLECULES. for the first result type.
        Returns:
        the calculation domain
      • getResultCount

        public int getResultCount()
        Returns the number of result items for the first result type.
        Returns:
        the number of result items
        See Also:
        getResultTypes()
      • getResult

        public Object getResult​(int index)
                         throws PluginException
        Returns the result item for the specified type and index. for the first result type.
        Parameters:
        index - is the result index
        Returns:
        the result item for the specified type and index
        Throws:
        PluginException - if the result cannot be returned
        See Also:
        getResultTypes()
      • getResult

        public Object getResult​(String arg)
                         throws PluginException
        Returns the result item for the specified argument string. The default implementation calls getResult(Object, int) with the argument string converted to an integer (result index) and with the first result type.
        Parameters:
        arg - is the argument string
        Returns:
        the result item for the first result type and the given argument string
        Throws:
        PluginException - if the result cannot be returned
        See Also:
        getResultTypes()
      • getResultAsString

        public String getResultAsString​(int index,
                                        Object result)
                                 throws PluginException
        Returns the specified result in String format for the first result type.
        Parameters:
        index - is the result index
        result - is the result item
        Returns:
        the specified result in String format
        Throws:
        PluginException - if an invalid result item is given
      • getResultsAsString

        public String getResultsAsString​(int index,
                                         Object result)
                                  throws PluginException
        Returns the specified result with possible subresults. (items separated by "|" characters) (e.g. both pKa values instead of the most significant pKa) in String format.
        Parameters:
        index - is the result index
        result - is the result item
        Returns:
        the specified result in String format
        Throws:
        PluginException - if an invalid result item is given
      • getResultAsRGB

        public int getResultAsRGB​(int index,
                                  Object result)
                           throws PluginException
        Returns the specified result color as int format (alpha<<24 + red<<16 + green<<8 + blue). for the first result type.
        Parameters:
        index - is the result index
        result - is the result item
        Returns:
        the specified result in color as int format
        Throws:
        PluginException - if an invalid result item is given
      • getResultsAsRGB

        public long getResultsAsRGB​(int index,
                                    Object result)
                             throws PluginException
        Returns the specified result color(s) as int format (alpha<<24 + red<<16 + green<<8 + blue). (e.g. both pKa colors instead of the most significant pKa color) as long (lower and upper bits).
        Parameters:
        index - is the result index
        result - is the result item
        Returns:
        the specified result in color as int
        Throws:
        PluginException - if an invalid result item is given
      • getAtomCount

        public final int getAtomCount()
        Returns the number of atoms in the input molecule.
        Returns:
        the number of atoms in the input molecule
      • getAtomIndex

        public final int getAtomIndex​(int index)
        Returns the atom index in the standardized molecule, or the atom index itself if the input molecule has not been standardized.
        Parameters:
        index - is the atom index in the input molecule
        Returns:
        the corresponding atom index in the standardized molecule, -1 if the atom has been removed
      • isInputMoleculeAromatized

        public final boolean isInputMoleculeAromatized()
        Returns true if the input molecule has aromatic bond.
        Returns:
        true if the input molecule has aromatic bond
      • standardize

        public void standardize​(Molecule mol)
        Standardizes the molecule by performing the transformations necessary to run the plugin (aromatize, dehydrogenize, bring nitro groups to common form, ...). This implementation performs the following transformations:
        • aromatization
        • nitro group transformation: [O-:1][N+:2] >> [O:1]=[N:2], [NH1+:1][O-:2] >> [H:3][O:2][N:1]
        • sulphynil group transformation: [#6][S+:1]([#6])[#8-:2] >> [#6][S:1]([#6])=[O:2]
        To be overridden by subclasses that require other standardization (or none at all). TODO: replace by call to chemaxon.standardizer.Standardizer
        Parameters:
        mol - is the molecule to be standardized
      • standardizeIonicGroups

        protected static void standardizeIonicGroups​(Molecule mol)
        Default standardization:
        • nitro groups: [O-:1][N+:2] >> [O:1]=[N:2], [NH1+:1][O-:2] >> [H:3][O:2][N:1]
        • sulphynil groups: [#6][S+:1]([#6])[#8-:2]>>[#6][S:1]([#6])=[O:2]
        Parameters:
        mol - is the molecule to be standardized
      • standardizeNeutralGroups

        protected static void standardizeNeutralGroups​(Molecule mol)
        Neutral -> ionic standardization:
          [O:1]=[N:2] >> [O-:1][N+:2], [H:3][O:2][N:1] >> [NH1+:1][O-:2]
        • sulphynil group transformation: [#6][S:1]([#6])=[O:2] >> [#6][S+:1]([#6])[#8-:2]
        Parameters:
        mol - is the molecule to be standardized
      • isMultiThreadedRunEnabled

        public boolean isMultiThreadedRunEnabled()
        For internal use only.
        Returns:
        true if multi-threaded run is enabled
      • restoreExplicitHydrogens

        protected boolean restoreExplicitHydrogens​(Molecule molecule)
        When the input molecule is set, the explicit H-s may be stored setMolecule(Molecule, boolean, boolean, boolean) The parameter should be topologically equal to the input molecule for a successfull restore.
        Parameters:
        molecule - the molecule to put the H-s on
        Returns:
        true if the restore was successful, false otherwise
      • setKeepHydrogens

        protected void setKeepHydrogens​(Properties properties)
      • arrangeHydrogenIncerments

        protected void arrangeHydrogenIncerments​(Molecule mol,
                                                 int atomIndex,
                                                 String label,
                                                 double hydrogenIncrement)
      • getOriginalMolecule

        protected Molecule getOriginalMolecule()