|
|||||||||
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.GeometryPlugin
public class GeometryPlugin
Plugin class for geometric properties calculations. Data types:
API usage example:
// read input molecule MolImporter mi = new MolImporter("test.mol"); Molecule mol = mi.read(); mi.close(); // create plugin GeometryPlugin plugin = new GeometryPlugin(); // set target molecule plugin.setMolecule(mol); // set parameters for calculation plugin.setCalculateForLEConformer("if2D"); plugin.setCalculateEnergy(true); // sets the energy calculation plugin.setCalculateMoleculeProjections(true); // sets the calculation of molecule projections // run the calculation plugin.run(); // get results double energy = plugin.getDreidingEnergy(); double distance = plugin.getDistance(2,4); double angle = plugin.getAngle(4,2,6); int[] atoms = { 2, 1, 4, 6 }; double dihedral = plugin.getDihedral(atoms); double hindrance = plugin.getStericHindrance(5); // steric hindrance of 5th atom double minimalProjectionArea = plugin.getMinimalProjectionArea(); double maximalProjectionArea = plugin.getMaximalProjectionArea(); double minimalProjectionRadius = plugin.getMinimalProjectionRadius(); double maximalProjectionRadius = plugin.getMaximalProjectionRadius(); // do something with the results ...
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 | |
---|---|
GeometryPlugin()
Constructor. |
Method Summary | |
---|---|
void |
checkMolecule(Molecule mol)
Checks the input molecule. |
double |
getAngle(int[] atoms)
Returns the angle of 3 atoms. |
double |
getAngle(int atom1,
int atom2,
int atom3)
Returns the angle of 3 atoms. |
double |
getDihedral(int[] atoms)
Returns the dihedral of 4 atoms. |
double |
getDihedral(int atom1,
int atom2,
int atom3,
int atom4)
Returns the dihedral of 4 atoms. |
double |
getDistance(int[] atoms)
Returns the distance of 2 atoms. |
double |
getDistance(int atom1,
int atom2)
Returns the distance of 2 atoms. |
double |
getDreidingEnergy()
Returns the energy of the conformer in kcal/mol. |
Molecule |
getLowestEnergyConformer()
Returns the lowest energy conformer of the molecule. |
double |
getMaximalProjectionArea()
Returns the maximal projection area in Angstrom^2. |
double |
getMaximalProjectionRadius()
Returns the radius of the circle surrounding the maximal projection in Angstrom. |
double |
getMaxZ()
|
double |
getMinimalProjectionArea()
Returns the minimal projection area in Angstrom^2. |
double |
getMinimalProjectionRadius()
Returns the radius of the circle surrounding the minimal projection in Angstrom. |
double |
getMinZ()
|
double |
getMMFF94Energy()
Returns the MMFF94 energy of the structure in kcal/mol. |
java.lang.String |
getProductName()
Returns the product identifier of the plugin as given by LicenseManager . |
java.lang.String |
getRemark()
Returns the calculation remark: if no results (no result types) then returns remark, otherwise returns null . |
java.lang.Object |
getResult(java.lang.Object type,
int index)
Returns the result item for the specified key and index. |
java.lang.Object |
getResult(java.lang.Object type,
java.lang.String arg)
Returns the distance, angle or dihedral of 2, 3 or 4 atoms if type is set to "distance", "angle" or "diheral". |
java.lang.String |
getResultAsString(java.lang.Object type,
int index,
java.lang.Object result)
Returns the specified result in String format. |
int |
getResultCount(java.lang.Object type)
Returns the number of result items for the given result key. |
int |
getResultDomain(java.lang.Object type)
Returns the calculation domain CalculatorPlugin.ATOM or CalculatorPlugin.MOLECULE . |
Molecule |
getResultMolecule()
Returns the result molecule for display. |
Molecule[] |
getResultMolecules()
Returns the result molecules, molecular results are set in the first molecule, atomic results are set in subsequent molecules as atom labels. |
java.lang.Object[] |
getResultTypes()
Returns the result types. |
double |
getStericHindrance(int atom)
Calculates hindrance of an atom from covalent radii values and distances. |
java.lang.String |
getTypeString(java.lang.Object type)
Returns a string representation of the given type. |
double |
getVolume()
|
java.lang.String |
getWarningMessage()
Returns a warning message if lowest energy conformer calculation was unsuccessful or aborted by user, null otherwise. |
boolean |
handlesMultiFragmentMolecules()
Returns true if the plugin handles multifragment
molecules, false otherwise. |
boolean |
isMultiThreadedRunEnabled()
For internal use only. |
boolean |
run()
Runs the tool. |
void |
setCalculateEnergy(boolean e)
Sets the calculation of dreiding energy. |
void |
setCalculateForLEConformer(java.lang.String condition)
Sets the condition for lowest energy conformer calculation before geometry calculations are processed. |
void |
setCalculateMMFF94Energy(boolean mmffe)
Sets the calculation of MMFF94 energy. |
void |
setCalculateMoleculeProjections(boolean c)
Sets the calculation of molecule projections. |
void |
setCalculateVolume(boolean calculateVolume)
|
protected void |
setInputMolecule(Molecule mol)
Sets the input molecule. |
void |
setLicenseEnvironment(java.lang.String env)
Sets license environment to be stored. |
void |
setMMFF94Optimization(boolean opt)
Sets MMFF94 optimization. |
void |
setOptimization(int opt)
Sets the optimization criteria for lowest energy conformer calculation. |
void |
setOptimizeProjection(boolean optimize)
|
void |
setParameters(java.util.Properties params)
Sets the input parameters for the plugin. |
void |
setProgressMonitor(chemaxon.common.util.MProgressMonitor pmon)
Sets a progress observer to be used to display progress status. |
void |
standardize(Molecule mol)
Expands sgroups. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GeometryPlugin()
Method Detail |
---|
public java.lang.String getProductName()
LicenseManager
.
getProductName
in class CalculatorPlugin
LicenseManager.GEOMETRY_PLUGIN_GROUP
public void setParameters(java.util.Properties params) throws PluginException
type="distance"
(n=2), "angle"
(n=3) and "dihedral"
(n=4)
calculations only, sets the atoms used by cxcalc
, for
internal use only; API usage: call getDistance(int,int)
or
getDistance(int[])
.
setParameters
in class CalculatorPlugin
params
- is the parameter table
PluginException
- on errorpublic void setProgressMonitor(chemaxon.common.util.MProgressMonitor pmon)
setProgressMonitor
in class CalculatorPlugin
pmon
- is the progress observer object, may be null
public void setCalculateVolume(boolean calculateVolume)
public boolean handlesMultiFragmentMolecules()
true
if the plugin handles multifragment
molecules, false
otherwise. In the latter case the plugin
takes the fragment with more atoms if a multifragment molecule is given
as input.
handlesMultiFragmentMolecules
in class CalculatorPlugin
public void checkMolecule(Molecule mol) throws PluginException
RxnMolecule
or if the molecule contains R-groups.
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 void setCalculateEnergy(boolean e)
e
- if true
then dreiding energy is calculatedpublic void setCalculateMMFF94Energy(boolean mmffe)
mmffe
- if true
then MMFF94 energy is calculatedsetMMFF94Optimization(boolean)
public void setMMFF94Optimization(boolean opt)
opt
- if true
then MMFF94 optimization is performedsetCalculateMMFF94Energy(boolean)
public void setCalculateForLEConformer(java.lang.String condition)
condition
- is the condition for lowest energy conformer calculationpublic void setOptimization(int opt)
opt
- is the optimization limit for the calculationpublic Molecule getLowestEnergyConformer()
public void setLicenseEnvironment(java.lang.String env)
CalculatorPlugin
setLicenseEnvironment
in interface chemaxon.license.Licensable
setLicenseEnvironment
in class CalculatorPlugin
env
- environment String to be stored and passed to the LicenseHandler in the isLicensed methodpublic double getDreidingEnergy()
public double getMMFF94Energy()
public double getDistance(int atom1, int atom2)
atom1
- is the (1-based) index of the 1st atomatom2
- is the (1-based) index of the 2nd atom
public double getDistance(int[] atoms) throws PluginException
atoms
- is the array containing (1-based) indexes of 2 atoms
PluginException
- if atoms are not set properlypublic double getAngle(int atom1, int atom2, int atom3)
atom1
- is the (1-based) index of the 1st atomatom2
- is the (1-based) index of the 2nd atomatom3
- is the (1-based) index of the 3rd atom
public double getAngle(int[] atoms) throws PluginException
atoms
- is the array containing (1-based) indexes of 3 atoms
PluginException
- if atoms are not set properlypublic double getDihedral(int atom1, int atom2, int atom3, int atom4)
atom1
- is the (1-based) index of the 1st atomatom2
- is the (1-based) index of the 2nd atomatom3
- is the (1-based) index of the 3rd atomatom4
- is the (1-based) index of the 4th atom
public double getDihedral(int[] atoms) throws PluginException
atoms
- is the array containing (1-based) indexes of 4 atoms
PluginException
- if atoms are not set properlypublic double getStericHindrance(int atom)
atom
- index of the atom
public void setCalculateMoleculeProjections(boolean c)
false
c
- if true
then molecule projection calculations are run.getMinimalProjectionArea()
,
getMaximalProjectionArea()
,
getMinimalProjectionRadius()
,
getMaximalProjectionRadius()
public double getMinimalProjectionArea()
setCalculateMoleculeProjections(boolean)
public double getMaximalProjectionArea()
setCalculateMoleculeProjections(boolean)
public double getMinimalProjectionRadius()
setCalculateMoleculeProjections(boolean)
public double getMaximalProjectionRadius()
setCalculateMoleculeProjections(boolean)
public double getVolume()
public void setOptimizeProjection(boolean optimize)
public boolean run() throws PluginException
run
in class CalculatorPlugin
PluginException
- on errorCalculatorPlugin.getErrorMessage()
public java.lang.Object getResult(java.lang.Object type, int index) throws PluginException
getResult
in class CalculatorPlugin
type
- is the result typeindex
- is the result index
PluginException
- if the result cannot be returnedCalculatorPlugin.getResultTypes()
public double getMaxZ()
public double getMinZ()
public java.lang.Object getResult(java.lang.Object type, java.lang.String arg) throws PluginException
getResult
in class CalculatorPlugin
type
- is the result type ("distance", "angle" or "dihedral")arg
- is the atom string as atom1-atom2 (e.g. "2-3")
PluginException
- on errorCalculatorPlugin.getResultTypes()
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
PluginException
- if an invalid result item is givenpublic int getResultCount(java.lang.Object type)
getResultCount
in class CalculatorPlugin
type
- is the result type
getResultTypes()
public int getResultDomain(java.lang.Object type)
CalculatorPlugin.ATOM
or CalculatorPlugin.MOLECULE
.
getResultDomain
in class CalculatorPlugin
type
- is the result key
getResultTypes()
public java.lang.Object[] getResultTypes()
getResultTypes
in class CalculatorPlugin
public java.lang.String getTypeString(java.lang.Object type)
getTypeString
in class CalculatorPlugin
type
- is the type object
public Molecule getResultMolecule() throws PluginException
MolAtom.getExtraLabel()
).
Molecular results are stored in molecule properties with keys being the
result types (Molecule.getProperty(String)
).
getResultMolecule
in class CalculatorPlugin
PluginException
- on errorpublic Molecule[] getResultMolecules() throws PluginException
getResultMolecules
in class CalculatorPlugin
PluginException
- on errorpublic java.lang.String getRemark()
null
.
getRemark
in class CalculatorPlugin
public java.lang.String getWarningMessage()
null
otherwise.
getWarningMessage
in class CalculatorPlugin
public boolean isMultiThreadedRunEnabled()
isMultiThreadedRunEnabled
in class CalculatorPlugin
true
if multi-threaded run is enabledpublic 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 |