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:
try (MolImporter mi = new MolImporter("test.mol")) {
// read input molecule
Molecule mol = mi.read();
// 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: " + MolExporter.toFormat(msmol, "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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckMolecule(Molecule mol) Checks the input molecule.protected final MoleculeReturns the major tautomeric form of the molecule.protected MoleculeReturns 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.intReturns the number of microspeciesdoublegetpH()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.intgetResultCount(Object type) Returns the number of result items:1.intgetResultDomain(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.doublegetSortedMsDistribution(int index) Returns the microspecies distribution, sorted by descreasing distribution at the given pH.booleanReturnstrueif the plugin handles multifragment molecules,falseotherwise.booleanrun()Stores the input molecule with ungrouped sgroups.protected voidDeprecated.voidsetCorrectionLibrary(String correctionLibraryId) Sets the correction library.voidsetCorrectionLibraryPath(String correctionLibraryPath) Sets the correction library file directly.protected voidsetInputMolecule(Molecule mol) Sets the input molecule.voidsetKeepExplicitHydrogens(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.voidsetParameters(Properties params) Sets the input parameters for the plugin.voidsetpH(double pH) Sets the pH: major microspecies on given pH is taken as input molecule if set toDouble.NaNthen the input molecule is taken as it is.voidsetTakeMajorTatomericForm(boolean takeMajorTautomericForm) Sets to use major tautomeric form in calculation.voidstandardize(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, 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
-
MajorMicrospeciesPlugin
public MajorMicrospeciesPlugin()Constructor. Creates the ionizer object.
-
-
Method Details
-
setMolecule
Description copied from class:CalculatorPluginSets 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:
setMoleculein 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:
getProductNamein 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:
setParametersin classCalculatorPlugin- Parameters:
params- is the parameter table- Throws:
PluginException- on error
-
setChemicalTermsArgument
Deprecated.Description copied from class:CalculatorPluginSets the argument string as specified in Chemical Terms expressions. This method may only be called fromCalculatorPlugin.setChemicalTermsParameters(Properties, String).- Overrides:
setChemicalTermsArgumentin 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.NaNthen 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.NaNif no microspecies calculation required.- Overrides:
getpHin classCalculatorPlugin- Returns:
- the pH where the major microspecies should be taken
or
Double.NaNif no microspecies calculation
-
setInputMolecule
Sets the input molecule.- Specified by:
setInputMoleculein 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:
createModifiedInputMoleculein 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:
runin 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:
getResultTypesin classCalculatorPlugin- Returns:
- the result types
-
getResultDomain
Returns the calculation domainCalculatorPlugin.MOLECULE.- Overrides:
getResultDomainin classCalculatorPlugin- Parameters:
type- is the result type- Returns:
CalculatorPlugin.MOLECULE- See Also:
-
getResultCount
Returns the number of result items:1.- Overrides:
getResultCountin 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:
getResultin 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:
getResultAsStringin 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:
getDisplayMoleculein classCalculatorPlugin- Returns:
- the molecule object to be used for GUI display
- Throws:
PluginException- on error
-
getResultMolecule
Returns the major microspecies for display.- Overrides:
getResultMoleculein 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:
getErrorMessagein 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:
checkMoleculein 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:
standardizein 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()Returnstrueif the plugin handles multifragment molecules,falseotherwise. This plugin handles multifragment molecules, so it returnstrue.- Overrides:
handlesMultiFragmentMoleculesin classCalculatorPlugin- Returns:
- true because this plugin handles multifragment molecules in case of salt type strutures.e.g.[Na+].CC([O-])=O
-