Package chemaxon.marvin.calculations
Class IUPACNamingPlugin
java.lang.Object
chemaxon.marvin.plugin.CalculatorPlugin
chemaxon.marvin.calculations.IUPACNamingPlugin
- All Implemented Interfaces:
TaggedCalculator
,chemaxon.license.Licensable
IUPAC name generator plugin.
API usage example:
// read input molecule MolImporter mi = new MolImporter("test.mol"); Molecule mol = mi.read(); mi.close(); // create plugin IUPACNamingPlugin plugin = new IUPACNamingPlugin(); // set the input molecule plugin.setMolecule(mol); // run the calculation plugin.run(); // get results String preferredIUPACName = plugin.getPreferredIUPACName(); String traditionalName = plugin.getTraditionalName(); String casNumber = plugin.getCASNumber(); // do something with the result ...
For concurrent plugin example applications using Chemaxon's concurrent framework, refer to the Concurrent plugin examples.
- Since:
- Marvin 4.1.7, 03/12/2007
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class chemaxon.marvin.plugin.CalculatorPlugin
CalculatorPlugin.HydrogenData
-
Field Summary
Fields inherited from class chemaxon.marvin.plugin.CalculatorPlugin
ATOM, BLUE, CALCRGB_OFF, COVALENT_HYDRATION_ERROR_REMARK, CRITICAL_ERROR_MSG, EPSILON, explicitHydrogens, INCORRECT_AROMATIC_NITROGEN_REMARK, INSTABLE_TAUTOMERIC_FORM_REMARK, KEEP_HYDROGENS, keepHydrogens, licenseEnvironment, MOLECULE, MOLECULES, NAN, PLUGIN_CLASS_KEY, PLUGIN_DIR, RED, TRUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if repeatedly running the same plugin object while getting the results on the GUI is allowed,false
otherwise.void
checkMolecule
(Molecule mol) Checks the input molecule.Returns the CAS number via public web service.Returns the calculation error information message ifCalculatorPlugin.run()
returnedfalse
(calculation error).Returns the preferred IUPAC name.Returns the product identifier of the plugin as given byLicenseManager
.Returns the result item for the specified key and index.getResultAsString
(Object type, int index, Object result) Returns the specified result in String format.Returns the result molecule for display.Object[]
Returns the result types.Returns the traditional IUPAC name.getTypeString
(Object type) Returns a string representation of the given type.boolean
Returnstrue
if the plugin handles multifragment molecules,false
otherwise.boolean
run()
Runs the tool.void
setGenerateCASNumber
(boolean g) Sets CAS number name generation.void
setGeneratePreferredIUPACName
(boolean g) Sets preferred IUPAC name generation.void
setGenerateTraditionalIUPACName
(boolean g) Sets traditional IUPAC name generation.protected void
setInputMolecule
(Molecule mol) Sets the input molecule.void
setParameters
(Properties params) Sets the input parameters for the plugin.void
standardize
(Molecule mol) Standardizes the molecule.Methods inherited from class chemaxon.marvin.plugin.CalculatorPlugin
addHeavyAtomLimitChecker, addInputChecker, arrangeHydrogenIncerments, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, create, createModifiedInputMolecule, createStandardizedMolecule, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getAtomIndexMap, getAtomIndexMapping, getCalcMolecule, getDisplayMolecule, getDocument, getDoublePrecision, getExplicitHydrogenData, getInputMolDim, getMainMolecule, getOriginalMolecule, getpH, getPluginResource, getQueryMoleculeErrorMessage, getRemark, getResult, getResult, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultCount, getResultDomain, getResultDomain, getResultMessage, getResultMolecules, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getResultSource, getWarningMessage, isInputMoleculeAromatized, isLicensed, isMsCalc, isMultiThreadedRunEnabled, isNegligibleResult, isOK, isRgrouped, loadClass, loadPluginClass, loadPluginClass, readAttribute, removeWhitespace, restoreExplicitHydrogens, setAtomIndexMap, setChemicalTermsArgument, setChemicalTermsParameters, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setMolecule, setProgressMonitor, standardizeIonicGroups
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface chemaxon.calculator.TaggedCalculator
tags
-
Constructor Details
-
IUPACNamingPlugin
public IUPACNamingPlugin()
-
-
Method Details
-
canRepeat
public boolean canRepeat()Description copied from class:CalculatorPlugin
Returnstrue
if repeatedly running the same plugin object while getting the results on the GUI is allowed,false
otherwise. For internal use.- Overrides:
canRepeat
in classCalculatorPlugin
- Returns:
true
if allowed,false
otherwise
-
checkMolecule
Description copied from class:CalculatorPlugin
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.- Overrides:
checkMolecule
in classCalculatorPlugin
- Parameters:
mol
- is the input molecule
-
getCASNumber
Returns the CAS number via public web service.- Returns:
- the CAS number
- Throws:
PluginException
- if name generation fail- See Also:
-
getErrorMessage
Description copied from class:CalculatorPlugin
Returns the calculation error information message ifCalculatorPlugin.run()
returnedfalse
(calculation error). The default implementation returns the empty string.- Overrides:
getErrorMessage
in classCalculatorPlugin
- Returns:
- the calculation error information message
-
getPreferredIUPACName
Returns the preferred IUPAC name.- Returns:
- the preferred IUPAC name
- Throws:
PluginException
- if name generation fail- See Also:
-
getProductName
Returns the product identifier of the plugin as given byLicenseManager
.- Specified by:
getProductName
in classCalculatorPlugin
- Returns:
- The identifier
LicenseManager.STRUCTURE_TO_NAME
-
getResult
Returns the result item for the specified key and index.- Overrides:
getResult
in classCalculatorPlugin
- Parameters:
type
- is the result typeindex
- is the result index- Returns:
- the result item for the specified key and index
- Throws:
PluginException
- if the result cannot be returned- See Also:
-
getResultAsString
Returns the specified result in String format.- Overrides:
getResultAsString
in classCalculatorPlugin
- Parameters:
type
- is the result typeindex
- is the result indexresult
- is the result item- Returns:
- the specified result in String format
- Throws:
PluginException
- if an invalid result item is given
-
getResultMolecule
Description copied from class:CalculatorPlugin
Returns the result molecule for display. Atomic results are stored in atom extra labels (MolAtom.getExtraLabel()
). Molecular results are stored in molecule properties with keys being the result types (MPropHandler.convertToString(MPropertyContainer, String)
).- Overrides:
getResultMolecule
in classCalculatorPlugin
- Returns:
- the result molecule
- Throws:
PluginException
- on error
-
getResultTypes
Returns the result types.- Overrides:
getResultTypes
in classCalculatorPlugin
- Returns:
- the result types
-
getTraditionalName
Returns the traditional IUPAC name.- Returns:
- the traditional IUPAC name
- Throws:
PluginException
- if name generation fail- See Also:
-
getTypeString
Description copied from class:CalculatorPlugin
Returns a string representation of the given type. The default implementation returnstype.toString()
.- Overrides:
getTypeString
in classCalculatorPlugin
- Parameters:
type
- is the type object- Returns:
- the type string
-
handlesMultiFragmentMolecules
public boolean handlesMultiFragmentMolecules()Returnstrue
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. Returnstrue
if parameter "single" is set to "false",false
otherwise (default:false
).- Overrides:
handlesMultiFragmentMolecules
in classCalculatorPlugin
- Returns:
- true if the plugin handles multifragment molecules, false otherwise
-
run
public boolean run()Description copied from class:CalculatorPlugin
Runs the tool.- Specified by:
run
in classCalculatorPlugin
- Returns:
- true if the calculation was successful, false on calculation problems
- See Also:
-
setGenerateCASNumber
public void setGenerateCASNumber(boolean g) Sets CAS number name generation. CAS number is fetched using a public web service.- Parameters:
g
- iftrue
then CAS number is generated- Since:
- Marvin 5.0
- See Also:
-
setGeneratePreferredIUPACName
public void setGeneratePreferredIUPACName(boolean g) Sets preferred IUPAC name generation.- Parameters:
g
- iftrue
then preferred IUPAC name is generated- Since:
- Marvin 5.0
- See Also:
-
setGenerateTraditionalIUPACName
public void setGenerateTraditionalIUPACName(boolean g) Sets traditional IUPAC name generation.- Parameters:
g
- iftrue
then traditional IUPAC name is generated- Since:
- Marvin 5.0
- See Also:
-
setParameters
Description copied from class:CalculatorPlugin
Sets the input parameters for the plugin.- Overrides:
setParameters
in classCalculatorPlugin
- Parameters:
params
- is the parameter table- Throws:
PluginException
- on error
-
standardize
Standardizes the molecule. Overrides the default standardization.- Overrides:
standardize
in classCalculatorPlugin
- Parameters:
mol
- is the molecule to be standardized
-
setInputMolecule
Description copied from class:CalculatorPlugin
Sets the input molecule.- Specified by:
setInputMolecule
in classCalculatorPlugin
- Parameters:
mol
- is the input molecule- Throws:
PluginException
- on error
-