chemaxon.marvin.calculations
Class TopologyAnalyserPlugin

java.lang.Object
  extended bychemaxon.marvin.plugin.CalculatorPlugin
      extended bychemaxon.marvin.calculations.TopologyAnalyserPlugin

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 results
    int ringCount = plugin.getRingCount();
    int rotatableBondCount = plugin.getRotatableBondCount();
    int smallestRingSize = plugin.getSmallestRingSize();

    // do something with the results ...
 

Since:
Marvin 3.5, 27/09/2004
Author:
Nora Mate

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
TopologyAnalyserPlugin()
           
 
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 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 getBondCount()
          Returns the bond count.
 int getChainAtomCount()
          Returns the chain atom count.
 int getChainBondCount()
          Returns the chain bond count.
 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.
 int getHeteroaromaticRingCount()
          Returns the heteroaromatic ring count.
 int getHeteroRingCount()
          Returns the hetero ring count.
 int getLargestRingSize()
          Returns the largest ring size.
 int getLargestRingSizeOfAtom(int index)
          Returns the size of largest ring containing the specified atom.
 java.lang.Object getResult(java.lang.Object type, int index)
          Returns the result item for the specified key and index.
 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.
 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 getRotatableBondCount()
          Returns the rotatable bond count.
 int getSmallestRingSize()
          Returns the smallest ring size.
 int getSmallestRingSizeOfAtom(int index)
          Returns the size of smallest ring containing the specified atom.
 java.lang.String getTypeString(java.lang.Object type)
          Returns a string representation of the given type.
 boolean handlesMultiFragmentMolecules()
          Returns true if the plugin handles multifragment molecules, false otherwise.
 boolean isAromaticAtom(int index)
          Returns true if aromatic atom.
 boolean isChainAtom(int index)
          Returns true if chain atom.
 boolean isRingAtom(int index)
          Returns true if ring atom.
 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.
protected  void standardize(Molecule mol)
          Prevents default standardization: does nothing.
 
Methods inherited from class chemaxon.marvin.plugin.CalculatorPlugin
check, checkLicense, checkLicenseKey, checkType, create, createImageMolecule, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getChartColor, getDoublePrecision, getErrorMessage, getGUIResultTypes, getLicenseKey, getMainMolecule, getMolText, getOutputClassName, getReferenceMolecule, getResult, getResult, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getSuffix, getXAxisLabel, getXLabels, getYAxisLabel, isLicensed, isMajorityMsCalculation, isMajorMs, isMsCalc, isNegligibleResult, isRgrouped, removeWhitespace, saveLicense, setDoublePrecision, setDoublePrecision, setDoublePrecision, setLicense, setMolecule, setMolecule, setMolecule, standardizeGroups, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopologyAnalyserPlugin

public TopologyAnalyserPlugin()
Method Detail

setParameters

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

Specified by:
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

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

getAromaticRingCount

public int getAromaticRingCount()
Returns the aromatic ring count.

Returns:
the aromatic ring count

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

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

isAromaticAtom

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

Parameters:
index - is the atom index
Returns:
true if aromatic 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

getResult

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

Specified by:
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()

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.

Specified by:
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.

Specified by:
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.

Specified by:
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:

Specified by:
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()

standardize

protected 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