@PublicAPI public abstract class CalculatorPlugin extends java.lang.Object implements chemaxon.license.Licensable
API usage examples:
// fill parameters Properties params = new Properties(); params.put("precision", "3"); params.put("type", "total,sigma"); // create plugin ChargePlugin plugin = new ChargePlugin(); // set plugin parameters plugin.setParameters(params); // set target molecule Molecule mol = MolImporter.importMol("Clc1cc(Cl)c(Cl)cc1"); plugin.setMolecule(mol); // run the calculation plugin.run(); // get the calculation results Object[] types = plugin.getResultTypes(); // now this is {"total", "sigma"} for (int i=0; i < types.length; ++i) { Object type = types[i]; System.out.println(); System.out.println(type + " charge: "); System.out.println("atom\tcharge"); int count = plugin.getResultCount(type); // now this is the atom count for (int j=0; j < count; ++j) { Object result = plugin.getResult(type, j); // now this is the charge value on atom j String rtext = plugin.getResultAsString(type, j, result); // string representation System.out.println((j+1)+"\t"+rtext); } }
For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.
Modifier and Type | Class and Description |
---|---|
protected static class |
CalculatorPlugin.HydrogenData |
Modifier and Type | Field and Description |
---|---|
static int |
ATOM
Calculation domain type: calculation refers to atoms.
|
static int |
BLUE
Constant storing the blue rgb value (the basic pKa result color).
|
protected static int |
CALCRGB_OFF
Calculator rgb offset.
|
protected static java.lang.String |
COVALENT_HYDRATION_ERROR_REMARK
Covalent hydration error remark.
|
protected static java.lang.String |
CRITICAL_ERROR_MSG
Critical error message.
|
static double |
EPSILON
The microspecies is ignored if its distribution is less than
EPSILON for all pH values.
|
protected java.util.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
|
protected static java.lang.String |
INCORRECT_AROMATIC_NITROGEN_REMARK
Incorrect aromatic nitrogen remark.
|
protected static java.lang.String |
INSTABLE_TAUTOMERIC_FORM_REMARK
Instable tautomeric form remark.
|
protected static java.lang.String |
KEEP_HYDROGENS |
protected boolean |
keepHydrogens |
protected java.lang.String |
licenseEnvironment
Member storing license environment.
|
static int |
MOLECULE
Calculation domain type: calculation refers to the molecule.
|
static int |
MOLECULES
Calculation domain type: calculation refers to multiple molecule output.
|
protected static java.lang.Double |
NAN
Double constant for
Double.NaN . |
static java.lang.String |
PLUGIN_CLASS_KEY
Plugin class key in manifest.
|
static java.lang.String |
PLUGIN_DIR
The plugin directory (relative to CLASSPATH).
|
static int |
RED
Constant storing the red rgb value (the acidic pKa result color).
|
protected static java.lang.String |
TRUE |
Constructor and Description |
---|
CalculatorPlugin()
Constructor.
|
CalculatorPlugin(com.google.common.base.Function<Molecule,java.lang.Boolean> sgExpander)
Constructor.
|
CalculatorPlugin(com.google.common.base.Function<Molecule,java.lang.Boolean> sgExpander,
com.google.common.base.Function<Molecule,java.lang.Boolean> sgContractor)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
arrangeHydrogenIncerments(Molecule mol,
int atomIndex,
java.lang.String label,
double hydrogenIncrement) |
boolean |
canRepeat()
Returns
true if repeatedly running the same plugin object
while getting the results on the GUI is allowed, false otherwise. |
protected void |
checkLicense() |
void |
checkMolecule(Molecule mol)
Checks the input molecule.
|
protected void |
checkType(java.lang.String type,
java.lang.String[] typerange)
Checks result types.
|
protected static boolean |
containsCoordinateBond(MoleculeGraph mol)
Decides whether a molecule graph contains coordinate bonds.
|
protected static boolean |
containsMulticenterSgroup(Molecule mol)
Decides whether a molecule contains Multicenter S-groups.
|
protected static boolean |
containsPseudoAtom(Molecule mol)
Returns
true if molecule contains pseudo atom. |
protected static boolean |
containsSRUSgroup(Molecule mol)
Decides whether a molecule contains SRU S-groups.
|
static CalculatorPlugin |
create(java.lang.String clname,
java.lang.String jar)
Loads a plugin, first tries to load it from CLASSPATH, then from JAR.
|
protected Molecule |
createModifiedInputMolecule(Molecule mol)
Returns the modified input molecule (e.g.
|
protected Molecule |
createStandardizedMolecule(Molecule mol)
Creates standardized molecule, the original input molecule is cloned.
|
protected Molecule |
createStandardizedMolecule(Molecule mol,
boolean om)
Deprecated.
Use
createStandardizedMolecule(Molecule) instead |
protected static void |
dehydrogenize(Molecule mol)
Deprecated.
MoleculeGraph.implicitizeHydrogens(int)
with parameter MolAtom.ALL_H does the same. |
java.lang.String |
format(double x)
Converts a double into String, applying the maximum
number of fractional digits specified.
|
java.lang.String |
format(double[][] t,
int intlen)
Converts a
double[][] 2xN table
to a 2-column tab-separated string representation of the table. |
java.lang.String |
format(double x,
int intlen)
Converts a double into String, applying the maximum
number of fractional digits specified.
|
java.lang.StringBuffer |
format(double x,
java.lang.StringBuffer s)
Converts a double into String, applying the maximum
number of fractional digits specified.
|
int |
getAtomCount()
Returns the number of atoms in the input molecule.
|
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.
|
protected int[] |
getAtomIndexMap() |
Molecule |
getCalcMolecule()
Returns the molecule used in the calculation.
|
protected Molecule |
getDisplayMolecule()
Returns the molecule object to be used for GUI display.
|
static MDocument |
getDocument(Molecule structure)
Returns encapsulating document, creates it if needed.
|
int |
getDoublePrecision()
Returns the precision.
|
java.lang.String |
getErrorMessage()
Returns the calculation error information message if
run()
returned false (calculation error). |
protected java.util.List<CalculatorPlugin.HydrogenData> |
getExplicitHydrogenData(Molecule cmol,
int n) |
int |
getInputMolDim()
Returns the input molecule dimension.
|
protected Molecule |
getMainMolecule(Molecule mol)
Deprecated.
Use
createModifiedInputMolecule(Molecule) instead |
protected Molecule |
getOriginalMolecule() |
double |
getpH()
Returns the pH where the major microspecies should be taken.
|
static java.net.URL |
getPluginResource(java.lang.String path)
Returns the plugin JAR as resource URL,
given the JAR file path relatively to the "plugins" directory.
|
abstract java.lang.String |
getProductName()
Returns the product identifier of the plugin as given by
LicenseManager . |
protected static java.lang.String |
getQueryMoleculeErrorMessage(Molecule mol) |
java.lang.String |
getRemark()
Returns the calculation remark.
|
java.lang.Object |
getResult(int index)
Returns the result item for the specified type and index.
|
java.lang.Object |
getResult(java.lang.Object type,
int index)
Returns the result item for the specified type and index.
|
java.lang.Object |
getResult(java.lang.Object type,
java.lang.String arg)
Returns the result item for the specified argument string.
|
java.lang.Object |
getResult(java.lang.String arg)
Returns the result item for the specified argument string.
|
int |
getResultAsRGB(int index,
java.lang.Object result)
Returns the specified result color as int format (alpha<<24 + red<<16 + green<<8 + blue).
|
int |
getResultAsRGB(java.lang.Object type,
int index,
java.lang.Object result)
Returns the specified result color as int format
(alpha<<24 + red<<16 + green<<8 + blue).
|
java.lang.String |
getResultAsString(int index,
java.lang.Object result)
Returns the specified result in String format for the first result type.
|
java.lang.String |
getResultAsString(java.lang.Object type,
int index,
java.lang.Object result)
Returns the specified result in String format.
|
int |
getResultCount()
Returns the number of result items for the first result type.
|
int |
getResultCount(java.lang.Object type)
Returns the number of result items for the given result key.
|
int |
getResultDomain()
|
int |
getResultDomain(java.lang.Object type)
|
java.lang.String |
getResultMessage()
Returns the plugin calculation error message,
error or warning.
|
Molecule |
getResultMolecule()
Returns the result molecule for display.
|
Molecule[] |
getResultMolecules()
Returns the result molecule array for display.
|
long |
getResultsAsRGB(int index,
java.lang.Object result)
Returns the specified result color(s) as int format
(alpha<<24 + red<<16 + green<<8 + blue).
|
long |
getResultsAsRGB(java.lang.Object type,
int index,
java.lang.Object result)
Returns the specified result color(s) as int format
(alpha<<24 + red<<16 + green<<8 + blue).
|
java.lang.String |
getResultsAsString(int index,
java.lang.Object result)
Returns the specified result with possible subresults.
|
java.lang.String |
getResultsAsString(java.lang.Object type,
int index,
java.lang.Object result)
Returns the specified result with possible subresults.
|
chemaxon.marvin.plugin.PluginMDocSource |
getResultSource()
Returns the result as a document source object.
|
java.lang.Object[] |
getResultTypes()
Returns the result types.
|
java.lang.String |
getTypeString(java.lang.Object type)
Returns a string representation of the given type.
|
java.lang.String |
getWarningMessage()
Returns the calculation warning information message.
|
boolean |
handlesMultiFragmentMolecules()
Returns
true if the plugin handles multifragment molecules,
false otherwise. |
boolean |
isInputMoleculeAromatized()
Returns
true if the input molecule has aromatic bond. |
boolean |
isLicensed()
Returns
true if the plugin is licensed. |
protected boolean |
isMsCalc()
Returns
true if microspecies calculation. |
boolean |
isMultiThreadedRunEnabled()
For internal use only.
|
boolean |
isNegligibleResult(java.lang.Object type,
int index,
java.lang.Object result)
Returns whether the result can be ignored.
|
boolean |
isOK()
Returns
true if no calculation error,
false on error. |
protected static boolean |
isRgrouped(Molecule mol)
Returns
true if molecule with R-groups. |
java.lang.Class |
loadClass(java.lang.String clname)
Loads a class, first tries from original CALSSPATH, then from the
class loader used to load this plugin class.
|
static java.lang.String |
readAttribute(java.lang.String attribute,
java.lang.String jar)
Reads an attribute from JAR manifest.
|
protected static java.lang.String |
removeWhitespace(java.lang.String str)
Removes whitespace characters from the given string.
|
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. |
abstract boolean |
run()
Runs the tool.
|
protected boolean |
setAtomIndexMap(int[] map) |
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).
|
void |
setDoublePrecision(int precision,
boolean pad)
Sets the double -> string conversion precision
(maximal number of fraction digits).
|
protected void |
setDoublePrecision(java.lang.String pr)
Sets the precision in the decimal format.
|
protected abstract void |
setInputMolecule(Molecule mol)
Sets the input molecule.
|
protected void |
setKeepHydrogens(java.util.Properties properties) |
void |
setLicenseEnvironment(java.lang.String env)
Sets license environment to be stored.
|
Molecule |
setMolecule(Molecule mol)
Sets the input molecule after standardization.
|
Molecule |
setMolecule(Molecule mol,
boolean st)
Sets the input molecule after an optional standardization.
|
Molecule |
setMolecule(Molecule mol,
boolean st,
boolean om)
Sets the input molecule after an optional standardization and/or modification.
|
protected Molecule |
setMolecule(Molecule mol,
boolean st,
boolean om,
boolean storeExplicitHydrogens) |
void |
setParameters(java.util.Properties params)
Sets the input parameters for the plugin.
|
void |
setProgressMonitor(MProgressMonitor pmon)
Sets a progress observer to be used in
run() to display progress status. |
void |
standardize(Molecule mol)
Standardizes the molecule by performing the transformations necessary
to run the plugin (aromatize, dehydrogenize, bring nitro groups to
common form, ...).
|
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]
|
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]
|
protected static final java.lang.String KEEP_HYDROGENS
protected static final java.lang.String TRUE
protected boolean keepHydrogens
public static final java.lang.String PLUGIN_DIR
public static final java.lang.String PLUGIN_CLASS_KEY
protected static final java.lang.String CRITICAL_ERROR_MSG
protected static final java.lang.String INCORRECT_AROMATIC_NITROGEN_REMARK
protected static final java.lang.String INSTABLE_TAUTOMERIC_FORM_REMARK
protected static final java.lang.String COVALENT_HYDRATION_ERROR_REMARK
protected java.lang.String licenseEnvironment
public static final int RED
public static final int BLUE
protected static final int CALCRGB_OFF
public static final int ATOM
public static final int MOLECULE
public static final int MOLECULES
protected static final java.lang.Double NAN
Double.NaN
.public static final double EPSILON
protected java.util.List<CalculatorPlugin.HydrogenData> explicitHydrogens
public CalculatorPlugin()
@Beta public CalculatorPlugin(com.google.common.base.Function<Molecule,java.lang.Boolean> sgExpander)
Beta
annotation, so it can be subject to incompatible changes or complete removal in any of the upcoming
releases without further notification.sgExpander
- Method to use to expand sgroups.@Beta public CalculatorPlugin(com.google.common.base.Function<Molecule,java.lang.Boolean> sgExpander, com.google.common.base.Function<Molecule,java.lang.Boolean> sgContractor)
Beta
annotation, so it can be subject to incompatible changes or complete removal in any of the upcoming
releases without further notification.sgExpander
- Method to use to expand sgroups.sgContractor
- Method to use to contract sgroups.public static java.net.URL getPluginResource(java.lang.String path)
path
- is the relative jar file pathpublic static java.lang.String readAttribute(java.lang.String attribute, java.lang.String jar) throws PluginException
attribute
- is the attribute namejar
- is the JAR file namenull
if not existsPluginException
public static CalculatorPlugin create(java.lang.String clname, java.lang.String jar) throws PluginException
null
then it is read from
the manifest attribute PLUGIN_CLASS_KEY
.clname
- is the plugin class namejar
- is the plugin JAR file namePluginException
public final java.lang.Class loadClass(java.lang.String clname) throws PluginException
clname
- is the class namenull
if could not be loadedPluginException
protected static boolean isRgrouped(Molecule mol)
true
if molecule with R-groups.mol
- is the moleculeprotected static boolean containsPseudoAtom(Molecule mol)
true
if molecule contains pseudo atom.mol
- the molecule to examinetrue
if the molecule contains pseudo atom, false otherwiseprotected static boolean containsMulticenterSgroup(Molecule mol)
mol
- the molecule to examineprotected static boolean containsSRUSgroup(Molecule mol)
mol
- the molecule to examineprotected static boolean containsCoordinateBond(MoleculeGraph mol)
mol
- the molecule to examine@Deprecated protected static void dehydrogenize(Molecule mol)
MoleculeGraph.implicitizeHydrogens(int)
with parameter MolAtom.ALL_H
does the same.mol
- is the moleculeprotected static java.lang.String removeWhitespace(java.lang.String str)
str
- is the stringpublic static MDocument getDocument(Molecule structure)
structure
- the moleculepublic boolean isLicensed()
true
if the plugin is licensed. The license checking
is based on the product name, returned by getProductName()
.isLicensed
in interface chemaxon.license.Licensable
true
if the plugin is licensedpublic void setLicenseEnvironment(java.lang.String env)
setLicenseEnvironment
in interface chemaxon.license.Licensable
env
- environment String to be stored and passed to the LicenseHandler in the isLicensed methodprotected final void checkLicense()
public abstract java.lang.String getProductName()
LicenseManager
.
The name is used by the isLicensed()
method.protected void checkType(java.lang.String type, java.lang.String[] typerange) throws PluginException
type
- is the type given by the usertyperange
- is the array containing the valid typesPluginException
- if the user-type is not contained in the type-rangepublic final int getDoublePrecision()
protected final void setDoublePrecision(java.lang.String pr)
pr
- is the precision string ("0"..."8" or "inf")public final void setDoublePrecision(int precision)
precision
- is the precisionpublic final void setDoublePrecision(int precision, boolean pad)
precision
- is the precisionpad
- 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=truepublic final java.lang.String format(double x)
x
- is the double value to be convertedsetDoublePrecision(int precision, boolean pad)
public final java.lang.String format(double x, int intlen)
x
- is the double value to be convertedintlen
- is the required integral part lengthsetDoublePrecision(int precision, boolean pad)
public final java.lang.StringBuffer format(double x, java.lang.StringBuffer s)
x
- is the double value to be converteds
- is the StringBuffer to be usedsetDoublePrecision(int precision, boolean pad)
public final java.lang.String format(double[][] t, int intlen)
double[][]
2xN
table
to a 2-column tab-separated string representation of the table.t
- is the tableintlen
- is the required integral part lengthpublic void setProgressMonitor(MProgressMonitor pmon)
run()
to display progress status.
Short calculations may ignore the observer object.
The default implementation does nothing.pmon
- is the progress monitor, may be null
public final Molecule setMolecule(Molecule mol) throws PluginException
mol
- is the input moleculePluginException
- on errorpublic Molecule setMolecule(Molecule mol, boolean st) throws PluginException
mol
- is the input moleculest
- is true if standardization is requiredPluginException
- on errorpublic Molecule setMolecule(Molecule mol, boolean st, boolean om) throws PluginException
mol
- is the input moleculest
- is true if standardization is requiredom
- is true if original input molecule is to be used for atom indexing
false if modified molecule is to be used for atom indexingPluginException
- on errorsetInputMolecule(Molecule)
,
createStandardizedMolecule(Molecule)
,
createModifiedInputMolecule(Molecule)
protected Molecule setMolecule(Molecule mol, boolean st, boolean om, boolean storeExplicitHydrogens) throws PluginException
PluginException
protected boolean setAtomIndexMap(int[] map)
protected int[] getAtomIndexMap()
protected java.util.List<CalculatorPlugin.HydrogenData> getExplicitHydrogenData(Molecule cmol, int n)
protected Molecule createModifiedInputMolecule(Molecule mol) throws PluginException
setMolecule(Molecule)
before passing the molecule to the calulation with setInputMolecule(Molecule)
method.
The default implementation returns the input molecule itself.mol
- is the input moleculePluginException
public int getInputMolDim()
public Molecule getCalcMolecule()
true
in
setMolecule(chemaxon.struc.Molecule, boolean)
or
setMolecule(chemaxon.struc.Molecule, boolean, boolean)
.
Input molecule is modified, if the plugin overrides the
createModifiedInputMolecule(Molecule)
mehod.@Deprecated protected Molecule createStandardizedMolecule(Molecule mol, boolean om) throws PluginException
createStandardizedMolecule(Molecule)
insteadhandlesMultiFragmentMolecules()
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.mol
- is the input moleculeom
- is true if original input molecule is to be used for atom indexing
false if modified molecule is to be used for atom indexingPluginException
- on errorprotected Molecule createStandardizedMolecule(Molecule mol) throws PluginException
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.mol
- is the input moleculePluginException
- on error@Deprecated protected Molecule getMainMolecule(Molecule mol) throws PluginException
createModifiedInputMolecule(Molecule)
insteadDouble.NaN
,
otherwise returns the input molecule itself.
The default implementation returns the input molecule itself.mol
- is the input moleculePluginException
protected Molecule getDisplayMolecule() throws PluginException
PluginException
- on errorpublic boolean handlesMultiFragmentMolecules()
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
.protected boolean isMsCalc()
true
if microspecies calculation.
The default implementation returns false
.false
public void setParameters(java.util.Properties params) throws PluginException
params
- is the parameter tablePluginException
- on errorpublic double getpH()
Double.NaN
if no microspecies calculation required.Double.NaN
if no microspecies calculationpublic void checkMolecule(Molecule mol) throws PluginException
mol
- is the input moleculePluginException
- with error message for the user if the molecule is refusedprotected static java.lang.String getQueryMoleculeErrorMessage(Molecule mol)
protected abstract void setInputMolecule(Molecule mol) throws PluginException
mol
- is the input moleculePluginException
- on errorpublic abstract boolean run() throws PluginException
PluginException
- on errorgetErrorMessage()
public boolean isOK()
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.true
if no calculation error or warningpublic java.lang.String getErrorMessage()
run()
returned false
(calculation error).
The default implementation returns the empty string.public java.lang.String getWarningMessage()
public final java.lang.String getResultMessage()
public java.lang.String getRemark()
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
.public java.lang.Object[] getResultTypes()
null
.public java.lang.String getTypeString(java.lang.Object type)
type.toString()
.type
- is the type objectpublic int getResultDomain(java.lang.Object type)
ATOM
, MOLECULE
or MOLECULES
.
The default implementation returns MOLECULE
.type
- is the result typegetResultTypes()
public boolean canRepeat()
true
if repeatedly running the same plugin object
while getting the results on the GUI is allowed, false
otherwise.
For internal use.true
if allowed, false
otherwisepublic int getResultCount(java.lang.Object type)
1
.type
- is the result typegetResultTypes()
public java.lang.Object getResult(java.lang.Object type, int index) throws PluginException
null
.type
- is the result typeindex
- is the result indexPluginException
- if the result cannot be returnedgetResultTypes()
public java.lang.String getResultAsString(java.lang.Object type, int index, java.lang.Object result) throws PluginException
null
.type
- is the result typeindex
- is the result indexresult
- is the result itemPluginException
- if an invalid result item is givenpublic java.lang.String getResultsAsString(java.lang.Object type, int index, java.lang.Object result) throws PluginException
type
- is the result typeindex
- is the result indexresult
- is the result itemPluginException
- if an invalid result item is givenpublic int getResultAsRGB(java.lang.Object type, int index, java.lang.Object result) throws PluginException
type
- is the result typeindex
- is the result indexresult
- is the result itemPluginException
- if an invalid result item is givenpublic long getResultsAsRGB(java.lang.Object type, int index, java.lang.Object result) throws PluginException
type
- is the result typeindex
- is the result indexresult
- is the result itemPluginException
- if an invalid result item is givenpublic boolean isNegligibleResult(java.lang.Object type, int index, java.lang.Object result) throws PluginException
false
.type
- is the result typeindex
- is the result indexresult
- is the result objectPluginException
public java.lang.Object getResult(java.lang.Object type, java.lang.String arg) throws PluginException
getResult(Object, int)
with the argument string converted to an integer (result index).type
- is the result typearg
- is the argument stringPluginException
- if the result cannot be returnedgetResultTypes()
public Molecule getResultMolecule() throws PluginException
MolAtom.getExtraLabel()
).
Molecular results are stored in molecule properties
with keys being the result types
(Molecule.getProperty(String)
).PluginException
- on errorpublic Molecule[] getResultMolecules() throws PluginException
MolAtom.getExtraLabel()
).
Molecular results are stored in molecule properties with keys being the
result types (Molecule.getProperty(String)
).PluginException
- on errorpublic chemaxon.marvin.plugin.PluginMDocSource getResultSource() throws PluginException
null
.PluginException
- on errorpublic int getResultDomain()
public int getResultCount()
getResultTypes()
public java.lang.Object getResult(int index) throws PluginException
index
- is the result indexPluginException
- if the result cannot be returnedgetResultTypes()
public java.lang.Object getResult(java.lang.String arg) throws PluginException
getResult(Object, int)
with the argument string converted to an integer (result index)
and with the first result type.arg
- is the argument stringPluginException
- if the result cannot be returnedgetResultTypes()
public java.lang.String getResultAsString(int index, java.lang.Object result) throws PluginException
index
- is the result indexresult
- is the result itemPluginException
- if an invalid result item is givenpublic java.lang.String getResultsAsString(int index, java.lang.Object result) throws PluginException
index
- is the result indexresult
- is the result itemPluginException
- if an invalid result item is givenpublic int getResultAsRGB(int index, java.lang.Object result) throws PluginException
index
- is the result indexresult
- is the result itemPluginException
- if an invalid result item is givenpublic long getResultsAsRGB(int index, java.lang.Object result) throws PluginException
index
- is the result indexresult
- is the result itemPluginException
- if an invalid result item is givenpublic final int getAtomCount()
public final int getAtomIndex(int index)
index
- is the atom index in the input moleculepublic final boolean isInputMoleculeAromatized()
true
if the input molecule has aromatic bond.true
if the input molecule has aromatic bondpublic void standardize(Molecule mol)
[O-:1][N+:2] >> [O:1]=[N:2]
, [NH1+:1][O-:2] >> [H:3][O:2][N:1]
[#6][S+:1]([#6])[#8-:2] >> [#6][S:1]([#6])=[O:2]
mol
- is the molecule to be standardizedprotected static void standardizeIonicGroups(Molecule mol)
[O-:1][N+:2] >> [O:1]=[N:2]
, [NH1+:1][O-:2] >> [H:3][O:2][N:1]
[#6][S+:1]([#6])[#8-:2]>>[#6][S:1]([#6])=[O:2]
mol
- is the molecule to be standardizedprotected static void standardizeNeutralGroups(Molecule mol)
[O:1]=[N:2] >> [O-:1][N+:2]
, [H:3][O:2][N:1] >> [NH1+:1][O-:2]
[#6][S:1]([#6])=[O:2] >> [#6][S+:1]([#6])[#8-:2]
mol
- is the molecule to be standardizedpublic boolean isMultiThreadedRunEnabled()
true
if multi-threaded run is enabledprotected boolean restoreExplicitHydrogens(Molecule molecule)
setMolecule(Molecule, boolean, boolean, boolean)
The parameter should be topologically equal to the input molecule
for a successfull restore.molecule
- the molecule to put the H-s onprotected void setKeepHydrogens(java.util.Properties properties)
protected void arrangeHydrogenIncerments(Molecule mol, int atomIndex, java.lang.String label, double hydrogenIncrement)
protected Molecule getOriginalMolecule()