|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object chemaxon.marvin.plugin.CalculatorPlugin chemaxon.marvin.calculations.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(); // 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"));
Field Summary |
Fields inherited from class chemaxon.marvin.plugin.CalculatorPlugin |
ATOM, BLUE, CALCRGB_OFF, CHART, HYDROGEN_VALENCE_ERROR_MSG, MOLECULE, NAN, RED, SUBRESULT |
Constructor Summary | |
MajorMicrospeciesPlugin()
Constructor. |
Method Summary | |
void |
checkMolecule(Molecule mol)
Checks the input molecule. |
java.lang.String |
getErrorMessage()
Returns the calculation error information message if run()
returned false (calculation error): hydrogen valence error. |
protected Molecule |
getMainMolecule(Molecule mol)
Returns the molecule form with largest distribution. |
Molecule |
getMajorMicrospecies()
Returns the major microspecies at the pH set in setpH(double) . |
protected java.lang.String |
getMolText()
Returns the plugin molecule text to be displayed in the viewer. |
java.lang.String |
getOutputClassName()
Returns the output provider class name for the command line interface. |
double |
getpH()
Returns the pH where the majority microspecies should be taken. |
Molecule |
getReferenceMolecule(java.lang.Object type,
int index)
Returns the molecule to be used as reference image for the given result type and index. |
java.lang.Object |
getResult(java.lang.Object type,
int index)
Returns the majority 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 rsule 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 . |
java.lang.Object[] |
getResultTypes()
Returns the result types (possible types: "majority-ms"). |
protected java.lang.String |
getSuffix()
Returns the plugin text suffix. |
protected boolean |
isMajorMs()
Returns true if major microspecies required,
ie, if pH is different from Double.NaN . |
boolean |
run()
Does nothing, the input molecule is already standardized and set to the majority microsepcies. |
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: majority microspecies on given pH is taken as input molecule if set to Double.NaN then the input molecule is taken as it is. |
protected 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 void setParameters(java.util.Properties params) throws PluginException
setParameters
in class CalculatorPlugin
params
- 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.
Double.NaN
if no microspecies calculationprotected Molecule getMainMolecule(Molecule mol)
getpH()
returns a value different from Double.NaN
,
otherwise returns the input molecule itself.
getMainMolecule
in class CalculatorPlugin
mol
- is the input molecule
protected boolean isMajorMs()
true
if major microspecies required,
ie, if pH is different from Double.NaN
.
isMajorMs
in class CalculatorPlugin
true
if major microspecies requiredprotected java.lang.String getSuffix()
Double.NaN
,
returns the empty string otherwise.
getSuffix
in class CalculatorPlugin
protected java.lang.String getMolText()
Double.NaN
,
returns null
otherwise.
getMolText
in class CalculatorPlugin
public void checkMolecule(Molecule mol) throws PluginException
checkMolecule
in class CalculatorPlugin
mol
- is the input molecule
PluginException
- with error message for the user if the molecule is refusedprotected void setInputMolecule(Molecule mol) throws PluginException
setInputMolecule
in class CalculatorPlugin
mol
- is the input molecule
PluginException
- on errorpublic boolean run() throws PluginException
run
in class CalculatorPlugin
PluginException
- on errorCalculatorPlugin.getErrorMessage()
public java.lang.String getErrorMessage()
run()
returned false (calculation error): hydrogen valence error.
getErrorMessage
in class CalculatorPlugin
public Molecule getMajorMicrospecies()
setpH(double)
.
public Molecule getReferenceMolecule(java.lang.Object type, int index)
null
.
getReferenceMolecule
in class CalculatorPlugin
type
- is the result typeindex
- is the result index
public java.lang.Object[] getResultTypes()
getResultTypes
in class CalculatorPlugin
public int getResultDomain(java.lang.Object type)
CalculatorPlugin.MOLECULE
.
getResultDomain
in class CalculatorPlugin
type
- is the result type
CalculatorPlugin.MOLECULE
getResultTypes()
public int getResultCount(java.lang.Object type)
1
.
getResultCount
in class CalculatorPlugin
type
- 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 CalculatorPlugin
type
- is the result type ("major-ms")index
- is no used
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 CalculatorPlugin
type
- is the result typeindex
- is the result indexresult
- is the result item (molecule)
PluginException
- if an invalid result item is givenpublic java.lang.String getOutputClassName()
getOutputClassName
in class CalculatorPlugin
protected void standardize(Molecule mol)
standardize
in class CalculatorPlugin
mol
- is the molecule to be standardized
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |