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:
try (MolImporter mi = new MolImporter("test.mol")) {
// read input molecule
Molecule mol = mi.read();
// 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif repeatedly running the same plugin object while getting the results on the GUI is allowed,falseotherwise.voidcheckMolecule(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.booleanReturnstrueif the plugin handles multifragment molecules,falseotherwise.booleanrun()Runs the tool.voidsetGenerateCASNumber(boolean g) Sets CAS number name generation.voidsetGeneratePreferredIUPACName(boolean g) Sets preferred IUPAC name generation.voidsetGenerateTraditionalIUPACName(boolean g) Sets traditional IUPAC name generation.protected voidsetInputMolecule(Molecule mol) Sets the input molecule.voidsetParameters(Properties params) Sets the input parameters for the plugin.voidstandardize(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, standardizeIonicGroupsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface chemaxon.calculator.TaggedCalculator
tags
-
Constructor Details
-
IUPACNamingPlugin
public IUPACNamingPlugin()
-
-
Method Details
-
canRepeat
public boolean canRepeat()Description copied from class:CalculatorPluginReturnstrueif repeatedly running the same plugin object while getting the results on the GUI is allowed,falseotherwise. For internal use.- Overrides:
canRepeatin classCalculatorPlugin- Returns:
trueif allowed,falseotherwise
-
checkMolecule
Description copied from class:CalculatorPluginChecks 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:
checkMoleculein 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:CalculatorPluginReturns the calculation error information message ifCalculatorPlugin.run()returnedfalse(calculation error). The default implementation returns the empty string.- Overrides:
getErrorMessagein 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:
getProductNamein classCalculatorPlugin- Returns:
- The identifier
LicenseManager.STRUCTURE_TO_NAME
-
getResult
Returns the result item for the specified key and index.- Overrides:
getResultin 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:
getResultAsStringin 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:CalculatorPluginReturns 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:
getResultMoleculein classCalculatorPlugin- Returns:
- the result molecule
- Throws:
PluginException- on error
-
getResultTypes
Returns the result types.- Overrides:
getResultTypesin 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:CalculatorPluginReturns a string representation of the given type. The default implementation returnstype.toString().- Overrides:
getTypeStringin classCalculatorPlugin- Parameters:
type- is the type object- Returns:
- the type string
-
handlesMultiFragmentMolecules
public boolean handlesMultiFragmentMolecules()Returnstrueif the plugin handles multifragment molecules,falseotherwise. In the latter case the plugin takes the fragment with more atoms if a multifragment molecule is given as input. Returnstrueif parameter "single" is set to "false",falseotherwise (default:false).- Overrides:
handlesMultiFragmentMoleculesin classCalculatorPlugin- Returns:
- true if the plugin handles multifragment molecules, false otherwise
-
run
public boolean run()Description copied from class:CalculatorPluginRuns the tool.- Specified by:
runin 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- iftruethen CAS number is generated- Since:
- Marvin 5.0
- See Also:
-
setGeneratePreferredIUPACName
public void setGeneratePreferredIUPACName(boolean g) Sets preferred IUPAC name generation.- Parameters:
g- iftruethen preferred IUPAC name is generated- Since:
- Marvin 5.0
- See Also:
-
setGenerateTraditionalIUPACName
public void setGenerateTraditionalIUPACName(boolean g) Sets traditional IUPAC name generation.- Parameters:
g- iftruethen traditional IUPAC name is generated- Since:
- Marvin 5.0
- See Also:
-
setParameters
Description copied from class:CalculatorPluginSets the input parameters for the plugin.- Overrides:
setParametersin classCalculatorPlugin- Parameters:
params- is the parameter table- Throws:
PluginException- on error
-
standardize
Standardizes the molecule. Overrides the default standardization.- Overrides:
standardizein classCalculatorPlugin- Parameters:
mol- is the molecule to be standardized
-
setInputMolecule
Description copied from class:CalculatorPluginSets the input molecule.- Specified by:
setInputMoleculein classCalculatorPlugin- Parameters:
mol- is the input molecule- Throws:
PluginException- on error
-