chemaxon.marvin.calculations
Class TopologyAnalyserPlugin

java.lang.Object
  extended by chemaxon.marvin.plugin.CalculatorPlugin
      extended by chemaxon.marvin.calculations.TopologyAnalyserPlugin
All Implemented Interfaces:
chemaxon.license.Licensable

public class TopologyAnalyserPlugin
extends CalculatorPlugin

Calculates topological data. Data types:

API usage example (as an alternative, you can also use the TopologyAnalyser class directly):

    // read input molecule
    MolImporter mi = new MolImporter("test.mol");
    Molecule mol = mi.read();
    mi.close();

    // create plugin
    TopologyAnalyserPlugin plugin = new TopologyAnalyserPlugin();

    // set target molecule
    plugin.setMolecule(mol);

    // run the calculation
    plugin.run();

    // get molecular results
    int ringCount = plugin.getRingCount();
    int rotatableBondCount = plugin.getRotatableBondCount();
    int smallestRingSize = plugin.getSmallestRingSize();

    // get atomic result
    int count = mol.getAtomCount();
    double[] stericEffectIndexes = new double[count];
    for (int i=0; i < count; ++i) {
        stericEffectIndexes[i] = plugin.getStericEffectIndex(i);
    }

    // get bond result 
    int index = plugin.getBondIndex(0,3); // bond index connecting atom 0 and atom 3
    boolean isChainBond = plugin.isChainBond(index);

    // do something with the results ...
 

For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.

Since:
Marvin 3.5, 09/27/2004
Version:
Marvin 5.1, 06/02/2008
Author:
Nora Mate, Zsolt Mohacsi

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
TopologyAnalyserPlugin()
          Constructor.
 
Method Summary
 void checkMolecule(Molecule mol)
          Checks the input molecule.
 int getAliphaticAtomCount()
          Returns the aliphatic atom count.
 int getAliphaticBondCount()
          Returns the aliphatic bond count.
 int getAliphaticRingCount()
          Returns the aliphatic ring count.
 int getAliphaticRingCountOfSize(int size)
          Returns the number of aliphatic rings (SSSR smallest set of smallest rings) of a given size in the molecule.
 int getAllAtomCount()
          Returns the atom count.
 int getAromaticAtomCount()
          Returns the aromatic atom count.
 int getAromaticBondCount()
          Returns the aromatic bond count.
 int getAromaticRingCount()
          Returns the aromatic ring count.
 int getAromaticRingCountOfSize(int size)
          Returns the number of aromatic rings (SSSR smallest set of smallest rings) of a given size in the molecule.
 int getAsymmetricAtomCount()
          Returns the number of asymmetric atoms.
 double getBalabanIndex()
          Calculates the Balaban distance connectivity of the molecule, which is the average distance sum connectivity.
 int getBondCount()
          Returns the bond count.
 int getBondIndex(int i1, int i2)
          Returns the index of the bond connecting two atoms, -1 if the two atoms are not connected by bond.
 int getBondType(int index)
          Determines the type of a bond (aromatic bonds are automatically recognized)
 int getCarboaromaticRingCount()
          Returns the carboaromatic ring count.
 int getCarboRingCount()
          Returns the carbo ring count.
 int getChainAtomCount()
          Returns the chain atom count.
 int getChainBondCount()
          Returns the chain bond count.
 int getChiralCenterCount()
          Calculates the number of tetrahedral stereogenic centers.
 int getCyclomaticNumber()
          Calculates the smallest number of graph edges which must be removed such that no circuit remains.
 int getDistanceCount(int index, int distance)
          Counts the given value in a row of the distance matrix.
 int getDistanceDegree(int index)
          Calculates the distance degree of an atom, which is the sum of the corresponding row values in the distance matrix.
 int getEccentricity(int index)
          Calculates the eccentricity of an atom, which is the greatest value in the corresponding row of the distance matrix.
 int getFragmentCount()
          Returns the number of fragments (disconnected parts) of the molecule.
 int getFusedAliphaticRingCount()
          Calculates the number of fused aliphatic rings (SSSR smallest set of smallest aliphatic rings) in the molecule.
 int getFusedAromaticRingCount()
          Calculates the number of fused aromatic rings (SSSR smallest set of smallest aromatic rings) in the molecule.
 int getFusedRingCount()
          Calculates the number of fused rings (SSSR smallest set of smallest rings) in the molecule.
 double getHararyIndex()
          Calculates the Harary index which is the half-sum of the off-diagonal elements of the reciprocal molecular distance matrix of the molecule.
 int getHeteroaromaticRingCount()
          Returns the heteroaromatic ring count.
 int getHeteroRingCount()
          Returns the hetero ring count.
 int getHyperWienerIndex()
          Calculates the hyper Wiener index of the molecule.
 int getLargestRingSize()
          Returns the largest ring size.
 int getLargestRingSizeOfAtom(int index)
          Returns the size of largest ring containing the specified atom.
 int getLargestRingSystemSize()
          Returns the size of the largest ring system (number of rings) in the molecule.
 int getPlattIndex()
          Calculates the Platt index of the molecule which is equal to the total sum of the edge degrees of a molecular graph.
 double getRandicIndex()
          Calculates the Randic index or molecular connectivity index as the harmonic sum of the geometric means of the node degrees for each edge.
 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 shortest path between two atoms if type is set ot "shortestPath", returns connectivity info if type is set to "connected".
 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.
 int getRingAtomCount()
          Returns the ring atom count.
 int getRingBondCount()
          Returns the ring bond count.
 int getRingCount()
          Returns the ring count.
 int getRingCountOfAtom(int index)
          Calculates the number of rings (SSSR smallest set of smallest rings) an atom is part of.
 int getRingCountOfSize(int size)
          Calculates the number of rings (SSSR smallest set of smallest rings) of a given size in the molecule.
 int getRingSystemCount()
          Returns the number of ring systems.
 int getRingSystemCountOfSize(int size)
          Returns the number of ring systems having a given size (number of rings) in the molecule.
 int getRotatableBondCount()
          Returns the rotatable bond count.
 int getShortestPath(int index1, int index2)
          Calculates the shortest topological path (number of bonds) between two atoms.
 int getSmallestRingSize()
          Returns the smallest ring size.
 int getSmallestRingSizeOfAtom(int index)
          Returns the size of smallest ring containing the specified atom.
 int getSmallestRingSystemSize()
          Returns the size of the smallest ring system (number of rings) in the molecule.
 double getStericEffectIndex(int index)
          Calculates topological steric effect index (TSEI) of an atom from covalent radii values and topological distances.
 int getSzegedIndex()
          Calculates the Szeged index of the molecule.
 java.lang.String getTypeString(java.lang.Object type)
          Returns a string representation of the given type.
 int getWienerIndex()
          Calculates the Wiener index of the molecule, which is the average topological atom distance (half of the sumof all atom distances) in the molecule.
 int getWienerPolarity()
          Calculates the Wiener polarity number of the molecule, which is the number of 3 bond length distances in the molecule.
 boolean handlesMultiFragmentMolecules()
          Returns true if the plugin handles multifragment molecules, false otherwise.
 boolean isAliphaticAtom(int index)
          Returns true if aliphatic atom.
 boolean isAromaticAtom(int index)
          Returns true if aromatic atom.
 boolean isAsymmetricAtom(int index)
          Returns true if asymmetric atom.
 boolean isChainAtom(int index)
          Returns true if chain atom.
 boolean isChainBond(int index)
          Determines if a bond is a ring bond or a chain bond.
 boolean isChiralCenter(int index)
          Determines if an atom can be a tetrahedral stereogenic center.
 boolean isConnected(int index1, int index2)
          Returns true if two atoms are in the same connected component, false for atoms of disconnected structures.
 boolean isConnectedGraph()
          Determines if the molecule is a connected graph or not.
 boolean isLicensed()
          Returns true if the plugin is licensed.
 boolean isRingAtom(int index)
          Returns true if ring atom.
 boolean isRingBond(int index)
          Determines if a bond is a ring bond or a chain bond.
 boolean isRotatableBond(int index)
          Determines if a bond is a rotatable or not
 boolean run()
          Runs the tool.
protected  void setInputMolecule(Molecule mol)
          Sets the input molecule.
 void setParameters(java.util.Properties params)
          Sets the input parameters for the plugin.
 void standardize(Molecule mol)
          Prevents default standardization: does nothing.
 
Methods inherited from class chemaxon.marvin.plugin.CalculatorPlugin
checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, createModifiedInputMolecule, createStandardizedMolecule, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getCalcMolecule, getDisplayMolecule, getDocument, getDoublePrecision, getErrorMessage, getInputMolDim, getMainMolecule, getpH, getPluginResource, getResult, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultMessage, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getResultSource, getWarningMessage, isInputMoleculeAromatized, isMsCalc, isMultiThreadedRunEnabled, isNegligibleResult, isOK, isRgrouped, loadClass, readAttribute, removeWhitespace, setDoublePrecision, setDoublePrecision, setDoublePrecision, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setProgressMonitor, standardizeIonicGroups, standardizeNeutralGroups
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopologyAnalyserPlugin

public TopologyAnalyserPlugin()
Constructor. Creates the topology analyser object.

Method Detail

isLicensed

public boolean isLicensed()
Description copied from class: CalculatorPlugin
Returns true 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.

Specified by:
isLicensed in interface chemaxon.license.Licensable
Overrides:
isLicensed in class CalculatorPlugin
Returns:
true if the plugin is licensed

setParameters

public void setParameters(java.util.Properties params)
                   throws PluginException
Sets the input parameters for the plugin. Parameters:

Overrides:
setParameters in class CalculatorPlugin
Parameters:
params - is the parameter table
Throws:
PluginException - on error

handlesMultiFragmentMolecules

public boolean handlesMultiFragmentMolecules()
Returns 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. Returns true if parameter "single" is set to "false", false otherwise (default: false).

Overrides:
handlesMultiFragmentMolecules in class CalculatorPlugin
Returns:
true if the plugin handles multifragment molecules, false otherwise

checkMolecule

public void checkMolecule(Molecule mol)
                   throws PluginException
Checks the input molecule. Throws exception if the molecule is RxnMolecule or if the molecule contains R-groups.

Overrides:
checkMolecule in class CalculatorPlugin
Parameters:
mol - is the input molecule
Throws:
PluginException - with error message for the user if the molecule is refused

setInputMolecule

protected void setInputMolecule(Molecule mol)
                         throws PluginException
Sets the input molecule.

Specified by:
setInputMolecule in class CalculatorPlugin
Parameters:
mol - is the input molecule
Throws:
PluginException - on error

getAllAtomCount

public int getAllAtomCount()
Returns the atom count.

Returns:
the atom count

getAliphaticAtomCount

public int getAliphaticAtomCount()
Returns the aliphatic atom count.

Returns:
the aliphatic atom count

getAromaticAtomCount

public int getAromaticAtomCount()
Returns the aromatic atom count.

Returns:
the aromatic atom count

getBondCount

public int getBondCount()
Returns the bond count.

Returns:
the bond count

getAliphaticBondCount

public int getAliphaticBondCount()
Returns the aliphatic bond count.

Returns:
the aliphatic bond count

getAromaticBondCount

public int getAromaticBondCount()
Returns the aromatic bond count.

Returns:
the aromatic bond count

getFragmentCount

public int getFragmentCount()
Returns the number of fragments (disconnected parts) of the molecule.

Returns:
number of fragments in the molecule
Since:
Marvin 5.1

getRingCount

public int getRingCount()
Returns the ring count.

Returns:
the ring count

getAliphaticRingCount

public int getAliphaticRingCount()
Returns the aliphatic ring count.

Returns:
the aliphatic ring count

getAliphaticRingCountOfSize

public int getAliphaticRingCountOfSize(int size)
Returns the number of aliphatic rings (SSSR smallest set of smallest rings) of a given size in the molecule.

Parameters:
size - size of the ring to count
Returns:
number of aliphatic rings with the specified size in the molecule
Since:
Marvin 5.1

getAromaticRingCount

public int getAromaticRingCount()
Returns the aromatic ring count.

Returns:
the aromatic ring count

getAromaticRingCountOfSize

public int getAromaticRingCountOfSize(int size)
Returns the number of aromatic rings (SSSR smallest set of smallest rings) of a given size in the molecule.

Parameters:
size - size of the ring to count
Returns:
number of aromatic rings with the specified size in the molecule
Since:
Marvin 5.1

getHeteroRingCount

public int getHeteroRingCount()
Returns the hetero ring count.

Returns:
the hetero ring count

getHeteroaromaticRingCount

public int getHeteroaromaticRingCount()
Returns the heteroaromatic ring count.

Returns:
the heteroaromatic ring count

getCarboRingCount

public int getCarboRingCount()
Returns the carbo ring count.

Returns:
the carbo ring count

getCarboaromaticRingCount

public int getCarboaromaticRingCount()
Returns the carboaromatic ring count.

Returns:
the carboaromatic ring count

getRingAtomCount

public int getRingAtomCount()
Returns the ring atom count.

Returns:
the ring atom count

getRingBondCount

public int getRingBondCount()
Returns the ring bond count.

Returns:
the ring bond count

getChainAtomCount

public int getChainAtomCount()
Returns the chain atom count.

Returns:
the chain atom count

getChainBondCount

public int getChainBondCount()
Returns the chain bond count.

Returns:
the chain bond count

getRotatableBondCount

public int getRotatableBondCount()
Returns the rotatable bond count.

Returns:
the rotatable bond count

getSmallestRingSize

public int getSmallestRingSize()
Returns the smallest ring size.

Returns:
the smallest ring size

getLargestRingSize

public int getLargestRingSize()
Returns the largest ring size.

Returns:
the largest ring size

getFusedRingCount

public int getFusedRingCount()
Calculates the number of fused rings (SSSR smallest set of smallest rings) in the molecule.

Returns:
number of fused rings in the molecule

getFusedAliphaticRingCount

public int getFusedAliphaticRingCount()
Calculates the number of fused aliphatic rings (SSSR smallest set of smallest aliphatic rings) in the molecule.

Returns:
number of fused aliphatic rings in the molecule

getFusedAromaticRingCount

public int getFusedAromaticRingCount()
Calculates the number of fused aromatic rings (SSSR smallest set of smallest aromatic rings) in the molecule.

Returns:
number of fused aromatic rings in the molecule

getRingSystemCount

public int getRingSystemCount()
Returns the number of ring systems. Fused and spiro rings belong to to one ring system.

Returns:
number of ring systems in the molecule
Since:
Marvin 5.1

getRingSystemCountOfSize

public int getRingSystemCountOfSize(int size)
Returns the number of ring systems having a given size (number of rings) in the molecule.

Parameters:
size - size of the ring to count
Returns:
number of ring systems with the specified size in the molecule
Since:
Marvin 5.1

getLargestRingSystemSize

public int getLargestRingSystemSize()
Returns the size of the largest ring system (number of rings) in the molecule.

Returns:
size of the largest ring system in the molecule (0 when acylcic)
Since:
Marvin 5.1

getSmallestRingSystemSize

public int getSmallestRingSystemSize()
Returns the size of the smallest ring system (number of rings) in the molecule.

Returns:
size of the smallest ring system in the molecule (0 when acylcic)
Since:
Marvin 5.1

isAromaticAtom

public boolean isAromaticAtom(int index)
Returns true if aromatic atom.

Parameters:
index - is the atom index
Returns:
true if aromatic atom

isAliphaticAtom

public boolean isAliphaticAtom(int index)
Returns true if aliphatic atom.

Parameters:
index - is the atom index
Returns:
true if aliphatic atom

isChainAtom

public boolean isChainAtom(int index)
Returns true if chain atom.

Parameters:
index - is the atom index
Returns:
true if chain atom

isRingAtom

public boolean isRingAtom(int index)
Returns true if ring atom.

Parameters:
index - is the atom index
Returns:
true if ring atom

getSmallestRingSizeOfAtom

public int getSmallestRingSizeOfAtom(int index)
Returns the size of smallest ring containing the specified atom.

Parameters:
index - is the atom index
Returns:
the size of smallest ring containing the specified atom

getLargestRingSizeOfAtom

public int getLargestRingSizeOfAtom(int index)
Returns the size of largest ring containing the specified atom.

Parameters:
index - is the atom index
Returns:
the size of largest ring containing the specified atom

getCyclomaticNumber

public int getCyclomaticNumber()
Calculates the smallest number of graph edges which must be removed such that no circuit remains. Also known as circuit rank.

Returns:
cyclomatic number of the molecule

getAsymmetricAtomCount

public int getAsymmetricAtomCount()
Returns the number of asymmetric atoms.

Returns:
the number of asymmetric atoms

isAsymmetricAtom

public boolean isAsymmetricAtom(int index)
Returns true if asymmetric atom.

Parameters:
index - is the atom index
Returns:
true if asymmetric atom

getChiralCenterCount

public int getChiralCenterCount()
Calculates the number of tetrahedral stereogenic centers. This function identifies two chiral centers in 1,4-dimethylcyclohexane, which does not contain asymmetric atoms.

Returns:
number of tetrahedral stereogenic center atoms

isChiralCenter

public boolean isChiralCenter(int index)
Determines if an atom can be a tetrahedral stereogenic center.

Parameters:
index - is the atom index
Returns:
true if the atom is stereogenic.

getShortestPath

public int getShortestPath(int index1,
                           int index2)
Calculates the shortest topological path (number of bonds) between two atoms. It returns Integer.MAX_VALUE for atoms of disconnected structures.

Parameters:
index1 - is the index of the first atom
index2 - is the index of the second atom
Returns:
the shortest path between two atoms

isConnected

public boolean isConnected(int index1,
                           int index2)
Returns true if two atoms are in the same connected component, false for atoms of disconnected structures.


getPlattIndex

public int getPlattIndex()
Calculates the Platt index of the molecule which is equal to the total sum of the edge degrees of a molecular graph.

Returns:
the Platt index

getRandicIndex

public double getRandicIndex()
Calculates the Randic index or molecular connectivity index as the harmonic sum of the geometric means of the node degrees for each edge.

Returns:
the Randic index

getBalabanIndex

public double getBalabanIndex()
Calculates the Balaban distance connectivity of the molecule, which is the average distance sum connectivity.

Returns:
the Balaban index (Integer.MAX_VALUE for disconnected graphs)

getDistanceDegree

public int getDistanceDegree(int index)
Calculates the distance degree of an atom, which is the sum of the corresponding row values in the distance matrix.

Parameters:
index - atom index
Returns:
the distance degree of the atom (Integer.MAX_VALUE for disconnected graphs)

getEccentricity

public int getEccentricity(int index)
Calculates the eccentricity of an atom, which is the greatest value in the corresponding row of the distance matrix.

Parameters:
index - atom index
Returns:
the eccentricity value of the atom (Integer.MAX_VALUE for disconnected graphs)

getHararyIndex

public double getHararyIndex()
Calculates the Harary index which is the half-sum of the off-diagonal elements of the reciprocal molecular distance matrix of the molecule.

Returns:
the Harary index (Integer.MAX_VALUE for disconnected graphs)

getHyperWienerIndex

public int getHyperWienerIndex()
Calculates the hyper Wiener index of the molecule.

Returns:
the hyper Wiener index (Integer.MAX_VALUE for disconnected graphs)

getSzegedIndex

public int getSzegedIndex()
Calculates the Szeged index of the molecule. The Szeged index is based on the Wiener number, which is calculated by simply counting the number of nodes on both sides of each edge (and sum these counts). The Szeged index extends the Wiener number for cyclic graphs by counting those nodes only which are nearer to the given side of the edge than to the other. Unreachable nodes (disconnected graphs) or those at equidistance position to both sides of the given edge are not taken into account.

Returns:
the Szeged index

getWienerIndex

public int getWienerIndex()
Calculates the Wiener index of the molecule, which is the average topological atom distance (half of the sumof all atom distances) in the molecule.

Returns:
the Wiener index (Integer.MAX_VALUE for disconnected graphs)

getWienerPolarity

public int getWienerPolarity()
Calculates the Wiener polarity number of the molecule, which is the number of 3 bond length distances in the molecule.

Returns:
the Wiener polarity number

getStericEffectIndex

public double getStericEffectIndex(int index)
Calculates topological steric effect index (TSEI) of an atom from covalent radii values and topological distances. The stericEffectIndex is related to the steric hindrance of the given atom.

Parameters:
index - atom index
Returns:
the topological steric effect index of the atom

getBondType

public int getBondType(int index)
Determines the type of a bond (aromatic bonds are automatically recognized)

Parameters:
index - bond index
Returns:
bond type

getDistanceCount

public int getDistanceCount(int index,
                            int distance)
Counts the given value in a row of the distance matrix.

Parameters:
index - atom index
distance - the distance value to count
Returns:
the distance count of a value for the atom

isRingBond

public boolean isRingBond(int index)
Determines if a bond is a ring bond or a chain bond.

Parameters:
index - bond index
Returns:
true if the bond is a ring bond, false if chain bond

isChainBond

public boolean isChainBond(int index)
Determines if a bond is a ring bond or a chain bond.

Parameters:
index - bond index
Returns:
true if the bond is a chain bond, false if chain bond

isConnectedGraph

public boolean isConnectedGraph()
Determines if the molecule is a connected graph or not. There is a path from any node to any other node in the graph.

Returns:
true if the graph is connected, false if the graph is disconnected.

isRotatableBond

public boolean isRotatableBond(int index)
Determines if a bond is a rotatable or not

Parameters:
index - bond index
Returns:
true if the bond is a rotatable bond, false otherwise

getRingCountOfAtom

public int getRingCountOfAtom(int index)
Calculates the number of rings (SSSR smallest set of smallest rings) an atom is part of.

Parameters:
index - atom index
Returns:
number of rings the atom is a member of

getRingCountOfSize

public int getRingCountOfSize(int size)
Calculates the number of rings (SSSR smallest set of smallest rings) of a given size in the molecule.

Parameters:
size - size of the ring to count
Returns:
number of rings in the molecule

getBondIndex

public int getBondIndex(int i1,
                        int i2)
Returns the index of the bond connecting two atoms, -1 if the two atoms are not connected by bond.

Parameters:
i1 - the first atom index
i2 - the second atom index
Returns:
the connectiong bond index, -1 if there is no such bond

getResult

public java.lang.Object getResult(java.lang.Object type,
                                  int index)
                           throws PluginException
Returns the result item for the specified key and index.

Overrides:
getResult in class CalculatorPlugin
Parameters:
type - is the result type
index - is the result index
Returns:
the result item for the specified key and index
Throws:
PluginException - if the result cannot be returned
See Also:
CalculatorPlugin.getResultTypes()

getResult

public java.lang.Object getResult(java.lang.Object type,
                                  java.lang.String arg)
                           throws PluginException
Returns the shortest path between two atoms if type is set ot "shortestPath", returns connectivity info if type is set to "connected". For internal use only.

Overrides:
getResult in class CalculatorPlugin
Parameters:
type - is the result type ("shortestPath" or "connected")
arg - is the atom string as atom1-atom2 (e.g. "2-3")
Returns:
the shortest path
Throws:
PluginException - on error
See Also:
CalculatorPlugin.getResultTypes()

getResultAsString

public java.lang.String getResultAsString(java.lang.Object type,
                                          int index,
                                          java.lang.Object result)
                                   throws PluginException
Returns the specified result in String format.

Overrides:
getResultAsString in class CalculatorPlugin
Parameters:
type - is the result type
index - is the result index
result - is the result item
Returns:
the specified result in String format
Throws:
PluginException - if an invalid result item is given

getResultCount

public int getResultCount(java.lang.Object type)
Returns the number of result items for the given result key.

Overrides:
getResultCount in class CalculatorPlugin
Parameters:
type - is the result type
Returns:
the number of result items
See Also:
getResultTypes()

getResultDomain

public int getResultDomain(java.lang.Object type)
Returns the calculation domain CalculatorPlugin.ATOM or CalculatorPlugin.MOLECULE.

Overrides:
getResultDomain in class CalculatorPlugin
Parameters:
type - is the result key
Returns:
the calculation domain
See Also:
getResultTypes()

getResultTypes

public java.lang.Object[] getResultTypes()
Returns the result types. Possible result types:

Overrides:
getResultTypes in class CalculatorPlugin
Returns:
the result types

getTypeString

public java.lang.String getTypeString(java.lang.Object type)
Returns a string representation of the given type.

Overrides:
getTypeString in class CalculatorPlugin
Parameters:
type - is the type object
Returns:
the type string

run

public boolean run()
            throws PluginException
Runs the tool.

Specified by:
run in class CalculatorPlugin
Returns:
true if the calculation was successful, false on calculation problems
Throws:
PluginException - on error
See Also:
CalculatorPlugin.getErrorMessage()

getResultMolecule

public Molecule getResultMolecule()
                           throws PluginException
Returns the result molecule for display. Atomic results are stored in atom extra labels (MolAtom.getExtraLabel()). Molecular results are stored in molecule properties with keys being the result types (Molecule.getProperty(String)).

Overrides:
getResultMolecule in class CalculatorPlugin
Returns:
the result molecule
Throws:
PluginException - on error
Since:
Marvin 4.0

getResultMolecules

public Molecule[] getResultMolecules()
                              throws PluginException
Returns the result molecules, molecular results are set in the first molecule, atomic results are set in subsequent molecules as atom labels.

Overrides:
getResultMolecules in class CalculatorPlugin
Returns:
the result molecules
Throws:
PluginException - on error

getRemark

public java.lang.String getRemark()
Returns the calculation remark: if no results (no result types) then returns remark, otherwise returns null.

Overrides:
getRemark in class CalculatorPlugin
Returns:
the calculation remark

standardize

public void standardize(Molecule mol)
Prevents default standardization: does nothing. TopologyAnalyser does not need standardization.

Overrides:
standardize in class CalculatorPlugin
Parameters:
mol - is the molecule to be standardized