|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.marvin.plugin.CalculatorPlugin
chemaxon.marvin.calculations.MajorMicrospeciesPlugin
public class MajorMicrospeciesPlugin
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.
| Field Summary |
|---|
| Fields inherited from class chemaxon.marvin.plugin.CalculatorPlugin |
|---|
ATOM, BLUE, CALCRGB_OFF, COVALENT_HYDRATION_ERROR_REMARK, CRITICAL_ERROR_MSG, EPSILON, INCORRECT_AROMATIC_NITROGEN_REMARK, INSTABLE_TAUTOMERIC_FORM_REMARK, licenseEnvironment, MOLECULE, NAN, PLUGIN_CLASS_KEY, PLUGIN_DIR, RED |
| Constructor Summary | |
|---|---|
MajorMicrospeciesPlugin()
Constructor. |
|
| Method Summary | |
|---|---|
void |
checkMolecule(Molecule mol)
Checks the input molecule. |
protected Molecule |
getDisplayMolecule()
Returns the molecule object to be used for GUI display. |
java.lang.String |
getErrorMessage()
Returns the calculation error information message or the empty string if there is no error. |
java.lang.String |
getIonizerErrorMessage()
Returns the calculation error information message or the empty string if there is no error. |
Molecule |
getMajorMicrospecies()
Returns the major microspecies at the pH set in setpH(double). |
Molecule |
getMicrospecies(int index)
Returns the microspecies molecule. |
int |
getMicrospeciesCount()
Returns the number of microspecies. |
double |
getpH()
Returns the pH where the major microspecies should be taken. |
java.lang.Object |
getResult(java.lang.Object type,
int index)
Returns the microsepcies if pH is different from Double.NaN, otherwise returns the input molecule itself. |
java.lang.String |
getResultAsString(java.lang.Object type,
int index,
java.lang.Object result)
Returns the specified result molecule in SMILES format. |
int |
getResultCount(java.lang.Object type)
Returns the number of result items: 1. |
int |
getResultDomain(java.lang.Object type)
Returns the calculation domain CalculatorPlugin.MOLECULE. |
Molecule |
getResultMolecule()
Returns the major microspecies for display. |
java.lang.Object[] |
getResultTypes()
Returns the result types (possible types: "majority-ms"). |
Molecule |
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 |
isLicensed()
Returns true if the plugin is licensed. |
boolean |
run()
Stores the input molecule with ungrouped sgroups. |
protected void |
setInputMolecule(Molecule mol)
Sets the input molecule. |
void |
setParameters(java.util.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 to Double.NaN then the input molecule is taken as it is. |
void |
standardize(Molecule mol)
Standardizes the molecule. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MajorMicrospeciesPlugin()
| Method Detail |
|---|
public boolean isLicensed()
CalculatorPlugintrue if the plugin is licensed. Implement this only if you want to sell your plugin and
protect it with a license key. The default implementation always returns true which means that
the plugin is free: no license key is required. This method returns only information about the licensing,
license checking has to be implemented separately.
isLicensed in interface chemaxon.license.LicensableisLicensed in class CalculatorPlugintrue if the plugin is licensed
public void setParameters(java.util.Properties params)
throws PluginException
setParameters in class CalculatorPluginparams - is the parameter table
PluginException - on errorpublic void setpH(double pH)
Double.NaN then the input molecule is taken as it is.
pH - is the pH valuepublic double getpH()
Double.NaN if no microspecies calculation required.
getpH in class CalculatorPluginDouble.NaN if no microspecies calculation
protected void setInputMolecule(Molecule mol)
throws PluginException
setInputMolecule in class CalculatorPluginmol - is the input molecule
PluginException - on error
public boolean run()
throws PluginException
run in class CalculatorPluginPluginException - on errorCalculatorPlugin.getErrorMessage()
public Molecule getMajorMicrospecies()
throws PluginException
setpH(double).
PluginException - if run() has not been called beforehand
public int getMicrospeciesCount()
throws PluginException
PluginException - on error
public Molecule getMicrospecies(int index)
throws PluginException
index - is the microspecies index
PluginException - on error
public Molecule getSortedMicrospecies(int index)
throws PluginException
index - is the microspecies index
PluginException - on error
public double getSortedMsDistribution(int index)
throws PluginException
index - is the microspecies index
PluginException - on errorpublic java.lang.Object[] getResultTypes()
getResultTypes in class CalculatorPluginpublic int getResultDomain(java.lang.Object type)
CalculatorPlugin.MOLECULE.
getResultDomain in class CalculatorPlugintype - is the result type
CalculatorPlugin.MOLECULEgetResultTypes()public int getResultCount(java.lang.Object type)
1.
getResultCount in class CalculatorPlugintype - is the result type
getResultTypes()
public java.lang.Object getResult(java.lang.Object type,
int index)
throws PluginException
Double.NaN, otherwise returns the input molecule itself.
getResult in class CalculatorPlugintype - is the result type ("major-ms", "ms", "ms-count" or "ms-distr")index - is the microspecies index
PluginException - if the result cannot be returnedgetResultTypes()
public java.lang.String getResultAsString(java.lang.Object type,
int index,
java.lang.Object result)
throws PluginException
getResultAsString in class CalculatorPlugintype - is the result typeindex - is the result indexresult - is the result item (molecule)
PluginException - if an invalid result item is given
protected Molecule getDisplayMolecule()
throws PluginException
getMajorMicrospecies().
getDisplayMolecule in class CalculatorPluginPluginException - on error
public Molecule getResultMolecule()
throws PluginException
getResultMolecule in class CalculatorPluginPluginException - on errorpublic java.lang.String getErrorMessage()
getErrorMessage in class CalculatorPluginpublic java.lang.String getIonizerErrorMessage()
public void checkMolecule(Molecule mol)
throws PluginException
checkMolecule in class CalculatorPluginmol - is the input molecule
PluginException - with error message for the user if the molecule is refusedpublic void standardize(Molecule mol)
standardize in class CalculatorPluginmol - is the molecule to be standardized
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||