chemaxon.calculations
Class TopologyAnalyser

java.lang.Object
  extended bychemaxon.calculations.TopologyAnalyser

public class TopologyAnalyser
extends java.lang.Object

Central class for accessing functions analysing the topology of a molecule.

Since:
Marvin 3.5
Version:
1.0, 06/05/2004

Constructor Summary
TopologyAnalyser()
           
 
Method Summary
 int aliphaticAtomCount()
          Calculates the number of all aliphatic atoms in the molecule excluding hydrogens.
 int aliphaticBondCount()
          Calculates the number of all aliphatic bonds in the molecule excluding bonds connected to hydrogens.
 int aliphaticRingCount()
          Calculates the number of aliphatic ring systems of the molecule.
 int aromaticAtomCount()
          Calculates the number of all aromatic atoms in the molecule.
 int aromaticBondCount()
          Calculates the number of all aromatic bonds in the molecule.
 int aromaticRingCount()
          Calculates the number of all aromatic ring systems in the molecule (SSSR).
 int asymmetricAtomCount()
          Calculates the number of asymmetric atoms.
 int atomCount()
          Calculates the number of atoms in the molecule including implicit hydrogens.
 double balabanIndex()
          Calculates the Balaban distance connectivity of the molecule, which is the average distance sum connectivity.
 int bondCount()
          Calculates the number of bonds in the molecule including bonds of implicit hydrogens.
 int bondType(int b)
          Determine the type of a bond (aromatic bonds are automatically recognized)
 int carboaromaticRingCount()
          Calculates the number of aromatic carbocyclic rings in the molecule (aromatic rings containing carbon atoms only).
 int carboRingCount()
          Calculates the number of carbocyclic rings in the molecule (rings containing carbon atoms only).
 int chainAtomCount()
          Calculates the number of chain atoms in the molecule excluding hydrogens.
 int chainBondCount()
          Calculates the number of chain bonds in the molecule excluding bonds of hydrogen atoms.
 int chiralCenterCount()
          Calculates the number of tetrahedral stereogenic centers.
 int cyclomaticNumber()
          Calculates the smallest number of graph edges which must be removed such that no circuit remains.
 int distanceCount(int a, int d)
          Counts the given value in a row of the distance matrix.
 int distanceDegree(int a)
          Calculates the distance degree of an atom, which is the sum of the corresponding row values in the distance matrix.
 int eccentricity(int a)
          Calculates the eccentricity of an atom, which is the greatest value in the corresponding row of the distance matrix.
 int fusedAliphaticRingCount()
          Calculates the number of fused aliphatic rings (SSSR smallest set of smallest aliphatic rings) in the molecule.
 int fusedAromaticRingCount()
          Calculates the number of fused aromatic rings (SSSR smallest set of smallest aromatic rings) in the molecule.
 int fusedRingCount()
          Calculates the number of fused rings (SSSR smallest set of smallest rings) in the molecule.
 MoleculeGraph getMolecule()
          Retrieves the input molecule
 int[] graphInvariant()
           
 double hararyIndex()
          Calculates the Harary index which is the half-sum of the off-diagonal elements of the reciprocal molecular distance matrix of the molecule.
 int heteroaromaticRingCount()
          Calculates the number of aromatic heterocyclic rings in the molecule (aromatic rings containing non-carbon atoms).
 int heteroRingCount()
          Calculates the number of heterocyclic rings in the molecule (rings containing non-carbon atoms.
 int hyperWienerIndex()
          Calculates the hyper Wiener index of the molecule.
 boolean isAliphaticAtom(int a)
          Determines if an atom is a member of an aromatic ring or not.
 boolean isAromaticAtom(int a)
          Determines if an atom is a member of an aromatic ring or not.
 boolean isAsymmetricAtom(int a)
          Determines if an atom is asymmetric or not.
 boolean isChainAtom(int a)
          Determines if an atom a ring bond or a chain bond.
 boolean isChainBond(int b)
          Determines if a bond is a ring bond or a chain bond.
 boolean isChiralCenter(int a)
          Determines if an atom can be a tetrahedral stereogenic center.
 boolean isConnected()
          Determines if the molecule is a connected graph or not.
 boolean isConnected(int atom1, int atom2)
          Determines if two atoms are members of a connected graph or not.
 boolean isRingAtom(int a)
          Determines if an atom a ring bond or a chain bond.
 boolean isRingBond(int b)
          Determines if a bond is a ring bond or a chain bond.
 boolean isRotatableBond(int b)
          Determines if a bond is a rotatable or not
 int largestRingSize()
          Calculates the size of the largest ring in the molecule (SSSR based).
 int largestRingSizeOfAtom(int a)
          Calculates the size of the largest ring an atom is a member of (SSSR based).
 int plattIndex()
          Calculates the Platt index of the molecule which is equal to the total sum of the edge degrees of a molecular graph.
 double randicIndex()
          Calculates the Randic index or molecular connectivity index as the harmonic sum of the geometric means of the node degrees for each edge.
 int ringAtomCount()
          Calculates the number of ring atoms in the molecule.
 int ringBondCount()
          Calculates the number of ring bonds in the molecule.
 int ringCount()
          Calculates the number of rings (SSSR smallest set of smallest rings) in the molecule.
 int ringCount(int size)
          Calculates the number of rings (SSSR smallest set of smallest rings) of a given size in the molecule.
 int ringCountOfAtom(int a)
          Calculates the number of rings (SSSR smallest set of smallest rings) an atom is part of.
 int rotatableBondCount()
          Calculates the number of rotatable bonds in the molecule.
 void setMolecule(MoleculeGraph mol)
          Specifies a molecule to calculate with.
 void setMolecule(MoleculeGraph mol, int aromatizationMode)
          Specifies a molecule to calculate with.
 int shortestPath(int atom1, int atom2)
          Calculates the shortest topological path (number of bonds) between two atoms.
 int smallestRingSize()
          Calculates the size of the smallest ring in the molecule.
 int smallestRingSizeOfAtom(int a)
          Calculates the size of the smallest ring an atom is a member of.
 double stericEffectIndex(int a)
          Calculates topological steric effect index (TSEI) of an atom from covalent radii values and topological distances.
 int szegedIndex()
          Calculates the Szeged index of the molecule.
 int wienerIndex()
          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 wienerPolarity()
          Calculates the Wiener polarity number of the molecule, which is the number of 3 bond length distances in the molecule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopologyAnalyser

public TopologyAnalyser()
Method Detail

getMolecule

public MoleculeGraph getMolecule()
Retrieves the input molecule

Returns:
the molecule to calculate with

setMolecule

public void setMolecule(MoleculeGraph mol)
Specifies a molecule to calculate with.

Parameters:
mol - the molecule to calculate with

setMolecule

public void setMolecule(MoleculeGraph mol,
                        int aromatizationMode)
Specifies a molecule to calculate with.

Parameters:
mol - the molecule to calculate with
aromatizationMode - specifies the algorithm for aromatization. Possible values:
  • MoleculeGraph.AROM_BASIC - Basic aromatization
  • MoleculeGraph.AROM_GENERAL - General aromatization (modified Huckel rule)

aliphaticAtomCount

public int aliphaticAtomCount()
Calculates the number of all aliphatic atoms in the molecule excluding hydrogens.

Returns:
number of aliphatic atoms in the molecule

aliphaticBondCount

public int aliphaticBondCount()
Calculates the number of all aliphatic bonds in the molecule excluding bonds connected to hydrogens.

Returns:
number of aliphatic bonds in the molecule

aliphaticRingCount

public int aliphaticRingCount()
Calculates the number of aliphatic ring systems of the molecule. Any ring containing an aliphatic atom/bond is considered aliphatic. Thus, aliphatic rings can contain some aromatic bonds too.

Returns:
number of aliphatic rings in the molecule

aromaticAtomCount

public int aromaticAtomCount()
Calculates the number of all aromatic atoms in the molecule.

Returns:
number of aromatic atoms in the molecule

aromaticBondCount

public int aromaticBondCount()
Calculates the number of all aromatic bonds in the molecule.

Returns:
number of aromatic bonds in the molecule

aromaticRingCount

public int aromaticRingCount()
Calculates the number of all aromatic ring systems in the molecule (SSSR). Sometimes, aromatic rings are not part of the standard SSSR ring set. Thus, the sum of the aliphatic and aromatic rings can be greater than the number of rings.

Returns:
number of aromatic rings in the molecule

asymmetricAtomCount

public int asymmetricAtomCount()
Calculates the number of asymmetric atoms. Asymmetric atoms have four different ligands.

Returns:
number of asymmetric atoms

atomCount

public int atomCount()
Calculates the number of atoms in the molecule including implicit hydrogens.

Returns:
number of atoms in the molecule

balabanIndex

public double balabanIndex()
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)

bondCount

public int bondCount()
Calculates the number of bonds in the molecule including bonds of implicit hydrogens.

Returns:
number of bonds in the molecule

bondType

public int bondType(int b)
Determine the type of a bond (aromatic bonds are automatically recognized)

Parameters:
b - index of the bond
Returns:
type of the bond

carboRingCount

public int carboRingCount()
Calculates the number of carbocyclic rings in the molecule (rings containing carbon atoms only).

Returns:
number of carbocyclic rings

carboaromaticRingCount

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

Returns:
number of aromatic carbocyclic rings

chainAtomCount

public int chainAtomCount()
Calculates the number of chain atoms in the molecule excluding hydrogens.

Returns:
number of chain atoms in the molecule

chainBondCount

public int chainBondCount()
Calculates the number of chain bonds in the molecule excluding bonds of hydrogen atoms.

Returns:
number of chain bonds in the molecule

chiralCenterCount

public int chiralCenterCount()
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

cyclomaticNumber

public int cyclomaticNumber()
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

distanceCount

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

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

distanceDegree

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

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

eccentricity

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

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

fusedAliphaticRingCount

public int fusedAliphaticRingCount()
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

fusedAromaticRingCount

public int fusedAromaticRingCount()
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

fusedRingCount

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

Returns:
number of fused rings in the molecule

graphInvariant

public int[] graphInvariant()

hararyIndex

public double hararyIndex()
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)

heteroaromaticRingCount

public int heteroaromaticRingCount()
Calculates the number of aromatic heterocyclic rings in the molecule (aromatic rings containing non-carbon atoms).

Returns:
number of aromatic heterocyclic rings

heteroRingCount

public int heteroRingCount()
Calculates the number of heterocyclic rings in the molecule (rings containing non-carbon atoms.

Returns:
number of heterocyclic rings

hyperWienerIndex

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

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

isAliphaticAtom

public boolean isAliphaticAtom(int a)
Determines if an atom is a member of an aromatic ring or not.

Parameters:
a - index of the atom
Returns:
true if the atom is aliphatic.

isAromaticAtom

public boolean isAromaticAtom(int a)
Determines if an atom is a member of an aromatic ring or not.

Parameters:
a - index of the atom
Returns:
true if the atom is aromatic.

isAsymmetricAtom

public boolean isAsymmetricAtom(int a)
Determines if an atom is asymmetric or not. Asymmetric atoms have four different ligands.

Parameters:
a - index of the atom
Returns:
true if the atom is asymmetric.

isChainAtom

public boolean isChainAtom(int a)
Determines if an atom a ring bond or a chain bond.

Parameters:
a - index of the atom
Returns:
true if the atom is a chain atom (has no ring bonds).

isChainBond

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

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

isChiralCenter

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

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

isConnected

public boolean isConnected()
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.

isConnected

public boolean isConnected(int atom1,
                           int atom2)
Determines if two atoms are members of a connected graph or not.

Parameters:
atom1 - index of the first atom
atom2 - index of the second atom
Returns:
True if the two atoms are located on a connected graphs, false if the atoms are disconnected.

isRingAtom

public boolean isRingAtom(int a)
Determines if an atom a ring bond or a chain bond.

Parameters:
a - index of the atom
Returns:
true if the atom is a ring atom (has no ring bonds).

isRingBond

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

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

isRotatableBond

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

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

largestRingSize

public int largestRingSize()
Calculates the size of the largest ring in the molecule (SSSR based).

Returns:
size of the largest ring in the molecule (0 when acylcic)

largestRingSizeOfAtom

public int largestRingSizeOfAtom(int a)
Calculates the size of the largest ring an atom is a member of (SSSR based).

Returns:
size of the largest ring (0 when atom is not a member of a ring)

plattIndex

public int plattIndex()
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

randicIndex

public double randicIndex()
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

ringAtomCount

public int ringAtomCount()
Calculates the number of ring atoms in the molecule.

Returns:
number of ring atoms in the molecule

ringBondCount

public int ringBondCount()
Calculates the number of ring bonds in the molecule.

Returns:
number of ring bonds in the molecule

ringCount

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

Returns:
number of rings in the molecule

ringCount

public int ringCount(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

ringCountOfAtom

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

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

rotatableBondCount

public int rotatableBondCount()
Calculates the number of rotatable bonds in the molecule.

Returns:
number of rotatable bonds in the molecule

shortestPath

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

Parameters:
atom1 - Index of the first atom.
atom2 - Index of the second atom.
Returns:
The shortest path between two atoms.

smallestRingSize

public int smallestRingSize()
Calculates the size of the smallest ring in the molecule.

Returns:
size of the smallest ring in the molecule (0 when acylcic)

smallestRingSizeOfAtom

public int smallestRingSizeOfAtom(int a)
Calculates the size of the smallest ring an atom is a member of.

Returns:
size of the smallest ring (0 when atom is not a member of a ring)

stericEffectIndex

public double stericEffectIndex(int a)
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:
a - index of the atom
Returns:
the topological steric effect index of the atom

szegedIndex

public int szegedIndex()
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

wienerIndex

public int wienerIndex()
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)

wienerPolarity

public int wienerPolarity()
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