Package chemaxon.marvin.calculations
Class MajorMicrospeciesPlugin
java.lang.Object
chemaxon.marvin.plugin.CalculatorPlugin
chemaxon.marvin.calculations.MajorMicrospeciesPlugin
- All Implemented Interfaces:
TaggedCalculator
,chemaxon.license.Licensable
Plugin class that calculates the major microspecies on a given pH.
API usage example:
// read input molecule MolImporter mi = new MolImporter("test.mol"); Molecule mol = mi.read(); mi.close(); // create plugin MajorMicrospeciesPlugin plugin = new MajorMicrospeciesPlugin(); // set pH plugin.setpH(7.4); // set target molecule plugin.setMolecule(mol); // run the calculation plugin.run(); // get result Molecule msmol = plugin.getMajorMicrospecies(); // print result System.out.println("Major microspecies at pH=7.4: "+msmol.toFormat("smiles"));
For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.
-
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 TypeMethodDescriptionvoid
checkMolecule
(Molecule mol) Checks the input molecule.protected final Molecule
Returns the major tautomeric form of the molecule.protected Molecule
Returns the molecule object to be used for GUI display.Returns the calculation error information message or the empty string if there is no error.Returns the calculation error information message or the empty string if there is no error.Returns the major microspecies at the pH set insetpH(double)
.getMicrospecies
(int index) Returns the microspecies molecule.int
Returns the number of microspeciesdouble
getpH()
Returns the pH where the major microspecies should be taken.Returns the product identifier of the plugin as given byLicenseManager
.Returns the microsepcies if pH is different fromDouble.NaN
, otherwise returns the input molecule itself.getResultAsString
(Object type, int index, Object result) Returns the specified result molecule in SMILES format.int
getResultCount
(Object type) Returns the number of result items:1
.int
getResultDomain
(Object type) Returns the calculation domainCalculatorPlugin.MOLECULE
.Returns the major microspecies for display.Object[]
Returns the result types (possible types: "majority-ms").getSortedMicrospecies
(int index) Returns the microspecies molecule, sorted by descreasing distribution at the given pH.double
getSortedMsDistribution
(int index) Returns the microspecies distribution, sorted by descreasing distribution at the given pH.boolean
Returnstrue
if the plugin handles multifragment molecules,false
otherwise.boolean
run()
Stores the input molecule with ungrouped sgroups.protected void
Deprecated.void
setCorrectionLibrary
(String correctionLibraryId) Sets the correction library.void
setCorrectionLibraryPath
(String correctionLibraryPath) Sets the correction library file directly.protected void
setInputMolecule
(Molecule mol) Sets the input molecule.void
setKeepExplicitHydrogens
(boolean keepExplicitHydrogens) Sets if result molecule keeps explicit hydrogens or notsetMolecule
(Molecule mol, boolean st, boolean om) Sets the input molecule after an optional standardization and/or modification.void
setParameters
(Properties params) Sets the input parameters for the plugin.void
setpH
(double pH) Sets the pH: major microspecies on given pH is taken as input molecule if set toDouble.NaN
then the input molecule is taken as it is.void
setTakeMajorTatomericForm
(boolean takeMajorTautomericForm) Sets to use major tautomeric form in calculation.void
standardize
(Molecule mol) Standardizes the molecule.Methods inherited from class chemaxon.marvin.plugin.CalculatorPlugin
addHeavyAtomLimitChecker, addInputChecker, arrangeHydrogenIncerments, canRepeat, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, create, createStandardizedMolecule, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getAtomIndexMap, getAtomIndexMapping, getCalcMolecule, getDocument, getDoublePrecision, getExplicitHydrogenData, getInputMolDim, getMainMolecule, getOriginalMolecule, getPluginResource, getQueryMoleculeErrorMessage, getRemark, getResult, getResult, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultMessage, getResultMolecules, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getResultSource, getTypeString, getWarningMessage, isInputMoleculeAromatized, isLicensed, isMsCalc, isMultiThreadedRunEnabled, isNegligibleResult, isOK, isRgrouped, loadClass, loadPluginClass, loadPluginClass, readAttribute, removeWhitespace, restoreExplicitHydrogens, setAtomIndexMap, setChemicalTermsParameters, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, 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
-
MajorMicrospeciesPlugin
public MajorMicrospeciesPlugin()Constructor. Creates the ionizer object.
-
-
Method Details
-
setMolecule
Description copied from class:CalculatorPlugin
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).- Overrides:
setMolecule
in classCalculatorPlugin
- Parameters:
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 indexing- Returns:
- the molecule to be used for atom indexing
- Throws:
PluginException
- on error- See Also:
-
getProductName
Returns the product identifier of the plugin as given byLicenseManager
.- Specified by:
getProductName
in classCalculatorPlugin
- Returns:
- The identifier
LicenseManager.PROTONATION_PLUGIN_GROUP
-
setParameters
Sets the input parameters for the plugin. The parameters and value ranges:- pH: major microspecies on given pH is taken as input molecule if omitted then the input molecule is taken as it is
- microspecies: "true" if major microspecies should be taken as input molecule (corresponds to 'take major microspecies' GUI checkbox)
- msdistr: "true" if microspecies distributions should be calculated (default: "false")
- Overrides:
setParameters
in classCalculatorPlugin
- Parameters:
params
- is the parameter table- Throws:
PluginException
- on error
-
setChemicalTermsArgument
Deprecated.Description copied from class:CalculatorPlugin
Sets the argument string as specified in Chemical Terms expressions. This method may only be called fromCalculatorPlugin.setChemicalTermsParameters(Properties, String)
.- Overrides:
setChemicalTermsArgument
in classCalculatorPlugin
- Parameters:
arg
- The argument, never null. Its meaning is implementation-dependent.- Throws:
PluginException
- on error
-
setpH
public void setpH(double pH) Sets the pH: major microspecies on given pH is taken as input molecule if set toDouble.NaN
then the input molecule is taken as it is.- Parameters:
pH
- is the pH value
-
getpH
public double getpH()Returns the pH where the major microspecies should be taken. ReturnsDouble.NaN
if no microspecies calculation required.- Overrides:
getpH
in classCalculatorPlugin
- Returns:
- the pH where the major microspecies should be taken
or
Double.NaN
if no microspecies calculation
-
setInputMolecule
Sets the input molecule.- Specified by:
setInputMolecule
in classCalculatorPlugin
- Parameters:
mol
- is the input molecule- Throws:
PluginException
- on error
-
setTakeMajorTatomericForm
public void setTakeMajorTatomericForm(boolean takeMajorTautomericForm) Sets to use major tautomeric form in calculation. Default:false
.- Parameters:
takeMajorTautomericForm
- the calculation will be performed on the major tutomeric form of the input molecule if set (true
)- Since:
- Marvin 5.2
-
setCorrectionLibrary
Sets the correction library.- Parameters:
correctionLibraryId
- is the correction library identifier- Since:
- Marvin 21.16
-
setCorrectionLibraryPath
Sets the correction library file directly.- Since:
- Marvin 21.16
-
createModifiedInputMolecule
Returns the major tautomeric form of the molecule.- Overrides:
createModifiedInputMolecule
in classCalculatorPlugin
- Parameters:
mol
- is the input molecule- Returns:
- the major tautomeric form of the molecule
- Throws:
PluginException
- on error- Since:
- Marvin 5.2
-
run
Stores the input molecule with ungrouped sgroups.- Specified by:
run
in classCalculatorPlugin
- Returns:
- true if the calculation was successful, false on calculation error
- Throws:
PluginException
- on error- See Also:
-
getMajorMicrospecies
Returns the major microspecies at the pH set insetpH(double)
.- Returns:
- the major microspecies
- Throws:
PluginException
- ifrun()
has not been called beforehand
-
getMicrospeciesCount
Returns the number of microspecies- Returns:
- the number of microspecies
- Throws:
PluginException
- on error
-
getMicrospecies
Returns the microspecies molecule.- Parameters:
index
- is the microspecies index- Returns:
- the microspecies molecule
- Throws:
PluginException
- on error
-
getSortedMicrospecies
Returns the microspecies molecule, sorted by descreasing distribution at the given pH.- Parameters:
index
- is the microspecies index- Returns:
- the microspecies molecule
- Throws:
PluginException
- on error
-
getSortedMsDistribution
Returns the microspecies distribution, sorted by descreasing distribution at the given pH.- Parameters:
index
- is the microspecies index- Returns:
- the microspecies distribution
- Throws:
PluginException
- on error
-
getResultTypes
Returns the result types (possible types: "majority-ms").- Overrides:
getResultTypes
in classCalculatorPlugin
- Returns:
- the result types
-
getResultDomain
Returns the calculation domainCalculatorPlugin.MOLECULE
.- Overrides:
getResultDomain
in classCalculatorPlugin
- Parameters:
type
- is the result type- Returns:
CalculatorPlugin.MOLECULE
- See Also:
-
getResultCount
Returns the number of result items:1
.- Overrides:
getResultCount
in classCalculatorPlugin
- Parameters:
type
- is the result type- Returns:
- the number of result items
- See Also:
-
getResult
Returns the microsepcies if pH is different fromDouble.NaN
, otherwise returns the input molecule itself.- Overrides:
getResult
in classCalculatorPlugin
- Parameters:
type
- is the result type ("major-ms", "ms", "ms-count" or "ms-distr")index
- is the microspecies index- Returns:
- the result item for the specified type and index
- Throws:
PluginException
- if the result cannot be returned- See Also:
-
getResultAsString
Returns the specified result molecule in SMILES format.- Overrides:
getResultAsString
in classCalculatorPlugin
- Parameters:
type
- is the result typeindex
- is the result indexresult
- is the result item (molecule)- Returns:
- the specified result in String format
- Throws:
PluginException
- if an invalid result item is given
-
getDisplayMolecule
Returns the molecule object to be used for GUI display. This is the major microspecies returned bygetMajorMicrospecies()
.- Overrides:
getDisplayMolecule
in classCalculatorPlugin
- Returns:
- the molecule object to be used for GUI display
- Throws:
PluginException
- on error
-
getResultMolecule
Returns the major microspecies for display.- Overrides:
getResultMolecule
in classCalculatorPlugin
- Returns:
- the major microspecies
- Throws:
PluginException
- on error- Since:
- Marvin 4.0
-
getErrorMessage
Returns the calculation error information message or the empty string if there is no error.- Overrides:
getErrorMessage
in classCalculatorPlugin
- Returns:
- the calculation error information message
-
getIonizerErrorMessage
Returns the calculation error information message or the empty string if there is no error.- Returns:
- the calculation error information message
-
checkMolecule
Checks the input molecule. Throws exception if the molecule molecule contains R-groups.- Overrides:
checkMolecule
in classCalculatorPlugin
- Parameters:
mol
- is the input molecule- Throws:
PluginException
- with error message for the user if the molecule is refused
-
standardize
Standardizes the molecule. Adds dehydrogenization to default standardization in case when major microsepcies calculation required.- Overrides:
standardize
in classCalculatorPlugin
- Parameters:
mol
- is the molecule to be standardized
-
setKeepExplicitHydrogens
public void setKeepExplicitHydrogens(boolean keepExplicitHydrogens) Sets if result molecule keeps explicit hydrogens or not- Parameters:
keepExplicitHydrogens
- if the result should keep explicit hydrogens or not
-
handlesMultiFragmentMolecules
public boolean handlesMultiFragmentMolecules()Returnstrue
if the plugin handles multifragment molecules,false
otherwise. This plugin handles multifragment molecules, so it returnstrue
.- Overrides:
handlesMultiFragmentMolecules
in classCalculatorPlugin
- Returns:
- true because this plugin handles multifragment molecules in case of salt type strutures.e.g.[Na+].CC([O-])=O
-