|
|||||||||
| 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 geometrical 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.
| 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 | |
|---|---|
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 |
getMinimalProjectionArea()
Returns the minimal projection area in Angstrom^2. |
double |
getMinimalProjectionRadius()
Returns the radius of the circle surrounding the minimal projection in Angstrom. |
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. |
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 |
isLicensed()
Returns true if the plugin is licensed. |
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 calcuation before geometry calculations are processed. |
void |
setCalculateMoleculeProjections(boolean c)
Sets the calculation of molecule projections. |
protected void |
setInputMolecule(Molecule mol)
Sets the input molecule. |
void |
setOptimization(int opt)
Sets the optimization criteria for lowest energy conformer calculation. |
void |
setParameters(java.util.Properties params)
Sets the input parameters for the plugin. |
void |
setProgressMonitor(MProgressMonitor pmon)
Sets a progress observer to be used to display progress status. |
void |
setRadiusScaleFactor(double sc)
Sets the atomic radius scale factor. |
| 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 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
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 CalculatorPluginparams - is the parameter table
PluginException - on errorpublic void setProgressMonitor(MProgressMonitor pmon)
setProgressMonitor in class CalculatorPluginpmon - is the progress observer object, may be nullpublic 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 CalculatorPluginmol - is the input molecule
PluginException - with error message for the user if the molecule
is refused
protected void setInputMolecule(Molecule mol)
throws PluginException
setInputMolecule in class CalculatorPluginmol - is the input molecule
PluginException - on errorpublic void setCalculateEnergy(boolean e)
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 double getDreidingEnergy()
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
public 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
public 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
PluginExceptionpublic 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 void setRadiusScaleFactor(double sc)
1.0
sc - is the scale factor
public boolean run()
throws PluginException
run in class CalculatorPluginPluginException - on errorCalculatorPlugin.getErrorMessage()
public java.lang.Object getResult(java.lang.Object type,
int index)
throws PluginException
getResult in class CalculatorPlugintype - is the result typeindex - is the result index
PluginException - if the result cannot be returnedCalculatorPlugin.getResultTypes()
public java.lang.Object getResult(java.lang.Object type,
java.lang.String arg)
throws PluginException
getResult in class CalculatorPlugintype - 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 CalculatorPlugintype - 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 CalculatorPlugintype - is the result type
getResultTypes()public int getResultDomain(java.lang.Object type)
CalculatorPlugin.ATOM or CalculatorPlugin.MOLECULE.
getResultDomain in class CalculatorPlugintype - is the result key
getResultTypes()public java.lang.Object[] getResultTypes()
getResultTypes in class CalculatorPluginpublic java.lang.String getTypeString(java.lang.Object type)
getTypeString in class CalculatorPlugintype - 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 CalculatorPluginPluginException - on error
public Molecule[] getResultMolecules()
throws PluginException
getResultMolecules in class CalculatorPluginPluginException - on errorpublic java.lang.String getRemark()
null.
getRemark in class CalculatorPluginpublic java.lang.String getWarningMessage()
null otherwise.
getWarningMessage in class CalculatorPluginpublic boolean isMultiThreadedRunEnabled()
isMultiThreadedRunEnabled in class CalculatorPlugintrue if multi-threaded run is enabled
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||