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.3, 10/26/2009
Author:
Nora Mate, Zsolt Mohacsi

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
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 getAliphaticRingCount(int size)
          Returns the number of aliphatic rings (SSSR smallest set of smallest rings) of a given size in the molecule.
 int getAliphaticRingCountOfSize(int size)
          Deprecated. Use getAliphaticRingCount(int)
 int[][] getAliphaticRings()
          Identifies the aliphatic rings in the molecule.
 int[][] getAliphaticRings(int size)
          Indentifies aliphatic rings in the molecule having a given size (number of atoms).
 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 getAromaticRingCount(int size)
          Returns the number of aromatic rings (SSSR smallest set of smallest rings) of a given size in the molecule.
 int getAromaticRingCountOfSize(int size)
          Deprecated. Use getAromaticRingCount(int)
 int[][] getAromaticRings()
          Identifies the aromatic rings in the molecule.
 int[][] getAromaticRings(int size)
          Indentifies aromatic rings in the molecule having a given size (number of rings).
 int getAsymmetricAtomCount()
          Returns the number of asymmetric atoms.
 int[] getAsymmetricAtoms()
          Determines the 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 getCarboaliphaticRingCount()
          Calculates the number of carboaliphatic rings in the molecule (aliphatic rings containing carbon atoms only).
 int getCarboaromaticRingCount()
          Calculates the number of carboaromatic rings in the molecule (aromatic rings containing carbon atoms only).
 int getCarboRingCount()
          Returns the carbo ring count.
 int getCarboRingCount(int size)
          Calculates the number of carbocyclic rings in the molecule (rings containing at least a non-carbon atom).
 int[][] getCarboRings()
          Identifies carbocyclic rings in the molecule (rings containing carbon atoms only).
 int[][] getCarboRings(int size)
          Identifies carbocyclic rings in the molecule (rings containing carbon atoms only) having the given number of atoms.
 int getChainAtomCount()
          Returns the chain atom count.
 int getChainBondCount()
          Returns the chain bond count.
 int getChiralCenterCount()
          Calculates the number of tetrahedral stereogenic centers.
 int[] getChiralCenters()
          Determines the chiral center atoms.
 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 getFusedAliphaticRingCount(int size)
          Calculates the number of fused aliphatic rings in the molecule (rings s).
 int[][] getFusedAliphaticRings()
          Identifies fused aliphatic rings (SSSR smallest set of smallest aliphatic rings) in the molecule.
 int[][] getFusedAliphaticRings(int size)
          Identifies fused aliphatic rings (SSSR smallest set of smallest aliphatic rings) in the molecule having the given size (number of atoms).
 int getFusedAromaticRingCount()
          Calculates the number of fused aromatic rings (SSSR smallest set of smallest aromatic rings) in the molecule.
 int getFusedAromaticRingCount(int size)
          Calculates the number of fused aromatic rings in the molecule (rings s).
 int[][] getFusedAromaticRings()
          Identifies fused aromatic rings (SSSR smallest set of smallest aromatic rings) in the molecule.
 int[][] getFusedAromaticRings(int size)
          Identifies fused aromatic rings (SSSR smallest set of smallest aromatic rings) in the molecule having the given size (number of atoms).
 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 getHeteroaliphaticRingCount()
          Calculates the number of aliphatic heterocyclic rings in the molecule (aliphatic rings containing at least a non-carbon atom).
 int getHeteroaliphaticRingCount(int size)
          Calculates the number of aliphatic heterocyclic rings in the molecule (aliphatic rings containing at least a non-carbon atom) having a given size (number of atoms).
 int[][] getHeteroaliphaticRings()
          Identifies heteroaliphatic rings in the molecule (aliphatic rings containing at least a non-carbon atom).
 int[][] getHeteroaliphaticRings(int size)
          Identifies heteroaliphatic rings in the molecule (aliphatic rings containing at least a non-carbon atom) having a given size (number of atoms).
 int getHeteroaromaticRingCount()
          Returns the heteroaromatic ring count.
 int getHeteroaromaticRingCount(int size)
          Calculates the number of aromatic heterocyclic rings in the molecule (aromatic rings containing at least a non-carbon atom) having a given size (number of atoms).
 int[][] getHeteroaromaticRings()
          Identifies heteroaromatic rings in the molecule (aromatic rings containing at least a non-carbon atom).
 int[][] getHeteroaromaticRings(int size)
          Identifies heteroaromatic rings in the molecule (aromatic rings containing at least a non-carbon atom) having a given size (number of atoms).
 int getHeteroRingCount()
          Returns the hetero ring count.
 int getHeteroRingCount(int size)
          Calculates the number of heterocyclic rings in the molecule (rings containing at least a non-carbon atom).
 int[][] getHeteroRings()
          Identifies heterocyclic rings in the molecule (rings containing at least a non-carbon atom).
 int[][] getHeteroRings(int size)
          Indentifies hetero rings in the molecule having a given size (number of atoms).
 int getHyperWienerIndex()
          Calculates the hyper Wiener index of the molecule.
 int[] getLargestRing()
          Identifies the atoms of the largest ring (number of atoms) in the molecule.
 int getLargestRingSize()
          Returns the largest ring size.
 int getLargestRingSizeOfAtom(int index)
          Returns the size of largest ring containing the specified atom.
 int[] getLargestRingSystem()
          Identifies the atoms of the largest ring system (number of rings) in the molecule.
 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.
 java.lang.String getProductName()
          Returns the product identifier of the plugin as given by LicenseManager.
 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 getRingCount(int size)
          Calculates the number of rings (SSSR smallest set of smallest rings) of a given size in the molecule.
 int getRingCountOfAtom(int index)
          Calculates the number of rings (SSSR smallest set of smallest rings) an atom is part of.
 int getRingCountOfSize(int size)
          Deprecated. Use getRingCount(int)
 int[][] getRings()
          Identifies the rings in the molecule.
 int[][] getRings(int size)
          Identifies rings in the molecule having a given size.
 int getRingSystemCount()
          Returns the number of ring systems.
 int getRingSystemCount(int size)
          Returns the number of ring systems having a given size (number of rings) in the molecule.
 int getRingSystemCountOfSize(int size)
          Deprecated. Use getRingSystemCount(int)
 int[][] getRingSystems()
          Identifies the ring systems in the molecule.
 int[][] getRingSystems(int size)
          Indentifies the ring systems in the molecule having a given size (number of rings).
 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[] getSmallestRing()
          Identifies the smallest ring (number of stoms) in the molecule.
 int getSmallestRingSize()
          Returns the smallest ring size.
 int getSmallestRingSizeOfAtom(int index)
          Returns the size of smallest ring containing the specified atom.
 int[] getSmallestRingSystem()
          Identifies the smallest ring system (number of rings) in the molecule.
 int getSmallestRingSystemSize()
          Returns the size of the smallest ring system (number of rings) in the molecule.
 java.lang.String getStereo(int a)
          Calculates absolute stereo configuration of the given atom.
 java.lang.String getStereo(int a1, int a2)
          Calculates absolute stereo configuration of the given double bond.
 int getStereoDoubleBondCount()
          Calculates the number of stereo double bonds.
 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 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 setLicenseEnvironment(java.lang.String env)
          Sets license environment to be stored.
 void setParameters(java.util.Properties params)
          Sets the input parameters for the plugin.
 void standardize(Molecule mol)
          Expands sgroups.
 
Methods inherited from class chemaxon.marvin.plugin.CalculatorPlugin
arrangeHydrogenIncerments, canRepeat, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, createModifiedInputMolecule, createStandardizedMolecule, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getCalcMolecule, getDisplayMolecule, getDocument, getDoublePrecision, getErrorMessage, getExplicitHydrogenData, getInputMolDim, getMainMolecule, getpH, getPluginResource, getQueryMoleculeErrorMessage, getResult, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultMessage, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getResultSource, getWarningMessage, isInputMoleculeAromatized, isLicensed, isMsCalc, isMultiThreadedRunEnabled, isNegligibleResult, isOK, isRgrouped, loadClass, readAttribute, removeWhitespace, restoreExplicitHydrogens, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setMolecule, 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

setLicenseEnvironment

public void setLicenseEnvironment(java.lang.String env)
Description copied from class: CalculatorPlugin
Sets license environment to be stored.

Specified by:
setLicenseEnvironment in interface chemaxon.license.Licensable
Overrides:
setLicenseEnvironment in class CalculatorPlugin
Parameters:
env - environment String to be stored and passed to the LicenseHandler in the isLicensed method

getProductName

public java.lang.String getProductName()
Returns the product identifier of the plugin as given by LicenseManager.

Specified by:
getProductName in class CalculatorPlugin
Returns:
The identifier LicenseManager.GEOMETRY_PLUGIN_GROUP

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
See Also:
class header

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

getAliphaticRingCount

public int getAliphaticRingCount(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.2

getAliphaticRingCountOfSize

public int getAliphaticRingCountOfSize(int size)
Deprecated. Use getAliphaticRingCount(int)

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

getAliphaticRings

public int[][] getAliphaticRings()
Identifies the aliphatic rings in the molecule.

Returns:
aliphatic rings of the molecule (null if the molecule does not contain aliphatic rings)
Since:
version 5.2

getAliphaticRings

public int[][] getAliphaticRings(int size)
Indentifies aliphatic rings in the molecule having a given size (number of atoms).

Parameters:
size - size of the aliphatic rings to return
Returns:
aliphatic rings in the molecule having the given size (null if the molecule does not contain aliphatic rings)
Since:
version 5.2

getAromaticRingCount

public int getAromaticRingCount()
Returns the aromatic ring count.

Returns:
the aromatic ring count

getAromaticRingCount

public int getAromaticRingCount(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.2

getAromaticRingCountOfSize

public int getAromaticRingCountOfSize(int size)
Deprecated. Use getAromaticRingCount(int)

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

getAromaticRings

public int[][] getAromaticRings()
Identifies the aromatic rings in the molecule.

Returns:
aromatic rings of the molecule (null if the molecule is aliphatic)
Since:
version 5.2

getAromaticRings

public int[][] getAromaticRings(int size)
Indentifies aromatic rings in the molecule having a given size (number of rings).

Parameters:
size - size of the aromatic rings to return
Returns:
aromatic rings in the molecule having the given size (null if the molecule is aliphatic or contains different sized aromatic rings only)
Since:
version 5.2

getHeteroRingCount

public int getHeteroRingCount()
Returns the hetero ring count.

Returns:
the hetero ring count

getHeteroRingCount

public int getHeteroRingCount(int size)
Calculates the number of heterocyclic rings in the molecule (rings containing at least a non-carbon atom).

Parameters:
size - size of the rings to count
Returns:
number of heterocyclic rings
Since:
version 5.2

getHeteroRings

public int[][] getHeteroRings()
Identifies heterocyclic rings in the molecule (rings containing at least a non-carbon atom).

Returns:
heterocyclic rings (null of no heterocyclic ring found in the molecule.
Since:
version 5.2

getHeteroRings

public int[][] getHeteroRings(int size)
Indentifies hetero rings in the molecule having a given size (number of atoms).

Parameters:
size - size of the aliphatic rings to return
Returns:
aliphatic rings in the molecule having the given size (null if the molecule does not contain aliphatic rings)
Since:
version 5.2

getHeteroaliphaticRingCount

public int getHeteroaliphaticRingCount()
Calculates the number of aliphatic heterocyclic rings in the molecule (aliphatic rings containing at least a non-carbon atom).

Returns:
number of heteroaliphatic rings
Since:
version 5.2

getHeteroaliphaticRingCount

public int getHeteroaliphaticRingCount(int size)
Calculates the number of aliphatic heterocyclic rings in the molecule (aliphatic rings containing at least a non-carbon atom) having a given size (number of atoms).

Parameters:
size - size of the heteroaliphatc rings to count
Returns:
number of heteroaliphatic rings having the given size
Since:
version 5.2

getHeteroaliphaticRings

public int[][] getHeteroaliphaticRings()
Identifies heteroaliphatic rings in the molecule (aliphatic rings containing at least a non-carbon atom).

Returns:
atom indexes of heteroaliphatic rings
Since:
version 5.2

getHeteroaliphaticRings

public int[][] getHeteroaliphaticRings(int size)
Identifies heteroaliphatic rings in the molecule (aliphatic rings containing at least a non-carbon atom) having a given size (number of atoms).

Parameters:
size - size of the heteroaliphatic rings to count
Returns:
heteroaliphatic rings having the given size
Since:
version 5.2

getHeteroaromaticRingCount

public int getHeteroaromaticRingCount()
Returns the heteroaromatic ring count.

Returns:
the heteroaromatic ring count

getHeteroaromaticRingCount

public int getHeteroaromaticRingCount(int size)
Calculates the number of aromatic heterocyclic rings in the molecule (aromatic rings containing at least a non-carbon atom) having a given size (number of atoms).

Parameters:
size - size of the heteroaromatic rings to count
Returns:
number of heteroaromatic rings having the given size
Since:
version 5.2

getHeteroaromaticRings

public int[][] getHeteroaromaticRings()
Identifies heteroaromatic rings in the molecule (aromatic rings containing at least a non-carbon atom).

Returns:
heteroaromatic rings
Since:
version 5.2

getHeteroaromaticRings

public int[][] getHeteroaromaticRings(int size)
Identifies heteroaromatic rings in the molecule (aromatic rings containing at least a non-carbon atom) having a given size (number of atoms).

Parameters:
size - size of the heteroaromatic rings to count
Returns:
heteroaromatic rings having the given size
Since:
version 5.2

getCarboRingCount

public int getCarboRingCount()
Returns the carbo ring count.

Returns:
the carbo ring count

getCarboRingCount

public int getCarboRingCount(int size)
Calculates the number of carbocyclic rings in the molecule (rings containing at least a non-carbon atom).

Parameters:
size - size of the rings to count
Returns:
number of carbocyclic rings with the given size
Since:
version 5.2

getCarboRings

public int[][] getCarboRings()
Identifies carbocyclic rings in the molecule (rings containing carbon atoms only).

Returns:
carbocyclic rings (null if no carbocyclic ring found in the molecule.
Since:
version 5.2

getCarboRings

public int[][] getCarboRings(int size)
Identifies carbocyclic rings in the molecule (rings containing carbon atoms only) having the given number of atoms.

Parameters:
size - size of the rings to count
Returns:
carbocyclic rings with the given size (null if no carbocyclic ring found in the molecule.
Since:
version 5.2

getCarboaliphaticRingCount

public int getCarboaliphaticRingCount()
Calculates the number of carboaliphatic rings in the molecule (aliphatic rings containing carbon atoms only).

Returns:
number of carboaliphatic rings

getCarboaromaticRingCount

public int getCarboaromaticRingCount()
Calculates the number of carboaromatic rings in the molecule (aromatic rings containing carbon atoms only).

Returns:
number of carboaromatic rings

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

getFusedAliphaticRingCount

public int getFusedAliphaticRingCount(int size)
Calculates the number of fused aliphatic rings in the molecule (rings s).

Parameters:
size - size of the fused aliphatic rings to count
Returns:
number of fused aliphatic rings having the given size
Since:
version 5.2

getFusedAliphaticRings

public int[][] getFusedAliphaticRings()
Identifies fused aliphatic rings (SSSR smallest set of smallest aliphatic rings) in the molecule.

Returns:
atom indexes of the fused aliphatic rings in the molecule
Since:
version 5.2

getFusedAliphaticRings

public int[][] getFusedAliphaticRings(int size)
Identifies fused aliphatic rings (SSSR smallest set of smallest aliphatic rings) in the molecule having the given size (number of atoms).

Parameters:
size - size of the fused aliphatic rings to count
Returns:
atom indexes of the fused aliphatic rings in the molecule having the given number of atoms
Since:
version 5.2

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

getFusedAromaticRingCount

public int getFusedAromaticRingCount(int size)
Calculates the number of fused aromatic rings in the molecule (rings s).

Parameters:
size - size of the fused aromatic rings to count
Returns:
number of fused aromatic rings having the given size
Since:
version 5.2

getFusedAromaticRings

public int[][] getFusedAromaticRings()
Identifies fused aromatic rings (SSSR smallest set of smallest aromatic rings) in the molecule.

Returns:
atom indexes of the fused aromatic rings in the molecule
Since:
version 5.2

getFusedAromaticRings

public int[][] getFusedAromaticRings(int size)
Identifies fused aromatic rings (SSSR smallest set of smallest aromatic rings) in the molecule having the given size (number of atoms).

Parameters:
size - size of the fused aromatic rings to count
Returns:
atom indexes of the fused aromatic rings in the molecule
Since:
version 5.2

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

getRingSystemCount

public int getRingSystemCount(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.2

getRingSystemCountOfSize

public int getRingSystemCountOfSize(int size)
Deprecated. Use getRingSystemCount(int)

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

getLargestRing

public int[] getLargestRing()
Identifies the atoms of the largest ring (number of atoms) in the molecule.

Returns:
atom indexes of the largest ring in the molecule (null when acyclic)
Since:
version 5.2

getLargestRingSystem

public int[] getLargestRingSystem()
Identifies the atoms of the largest ring system (number of rings) in the molecule.

Returns:
atom indexes of the largest ring system in the molecule (null when acyclic)
Since:
version 5.2

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

getAsymmetricAtoms

public int[] getAsymmetricAtoms()
Determines the asymmetric atoms.

Returns:
indexes of asymmetric atoms
Since:
Marvin 5.3

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

getChiralCenters

public int[] getChiralCenters()
Determines the chiral center atoms.

Returns:
indexes of chiral center atoms
Since:
Marvin 5.3

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.

getStereo

public java.lang.String getStereo(int a)
Calculates absolute stereo configuration of the given atom. Returns "R" or "S" correspondingly, if the atom is stereo, otherwise it returns an empty string,

Parameters:
a - index of the atom
Returns:
the absolute stereo configuration of the atom
Since:
Marvin 5.2.1

getStereo

public java.lang.String getStereo(int a1,
                                  int a2)
Calculates absolute stereo configuration of the given double bond. Returns "E" or "Z" correspondingly, if the bond is a stereo double bond, otherwise it returns an empty string. Double bonds in small rings are not considered stereo bonds.

Parameters:
a1 - index of the atom at one end of the double bond
a2 - index of the atom at the other end of the double bond
Returns:
the absolute stereo configuration of the atom
Since:
Marvin 5.2.1

getStereoDoubleBondCount

public int getStereoDoubleBondCount()
Calculates the number of stereo double bonds.

Returns:
number of stereo double bonds atoms
Since:
Marvin 5.2.1

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

getRingCount

public int getRingCount(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
Since:
Marvin 5.2

getRingCountOfSize

public int getRingCountOfSize(int size)
Deprecated. Use getRingCount(int)

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

getRings

public int[][] getRings()
Identifies the rings in the molecule.

Returns:
rings of the molecule (null if the molecule is acyclic)
Since:
version 5.2

getRings

public int[][] getRings(int size)
Identifies rings in the molecule having a given size.

Parameters:
size - size of the ring systems to return
Returns:
rings of the molecule having the given size (null if the molecule is acyclic or contains different rings only)
Since:
version 5.2

getRingSystems

public int[][] getRingSystems()
Identifies the ring systems in the molecule. Fused and spiro rings belong to one ring system.

Returns:
ring systems in the molecule (null if the molecule is acyclic)
Since:
version 5.2

getRingSystems

public int[][] getRingSystems(int size)
Indentifies the ring systems in the molecule having a given size (number of rings). Fused and spiro rings belong to one ring system.

Parameters:
size - size of the ring systems to return
Returns:
ring systems in the molecule having the given size (null if the molecule is acyclic or contains different rings only)
Since:
version 5.2

getSmallestRing

public int[] getSmallestRing()
Identifies the smallest ring (number of stoms) in the molecule.

Returns:
atom indexes of the smallest ring in the molecule (null when acyclic)
Since:
version 5.2

getSmallestRingSystem

public int[] getSmallestRingSystem()
Identifies the smallest ring system (number of rings) in the molecule.

Returns:
atom indexes of the smallest ring system in the molecule (null when acyclic)
Since:
version 5.2

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: see TopologyAnalyserPlugin class header (data 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)
Expands sgroups.

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