|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.marvin.plugin.CalculatorPlugin
chemaxon.marvin.calculations.TopologyAnalyserPlugin
public class TopologyAnalyserPlugin
Calculates topological data. Data types:
true if two atoms are connected)
true if the molecule graph is connected)
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.
| 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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TopologyAnalyserPlugin()
| Method Detail |
|---|
public boolean isLicensed()
CalculatorPlugintrue if the plugin is licensed. Implement this only if you want to sell your plugin and
protect it with a license key. The default implementation always returns true which means that
the plugin is free: no license key is required. This method returns only information about the licensing,
license checking has to be implemented separately.
isLicensed in interface chemaxon.license.LicensableisLicensed in class CalculatorPlugintrue if the plugin is licensed
public void setParameters(java.util.Properties params)
throws PluginException
true if two atoms are connected)
true if the molecule graph is connected)
type="shortestPath" and bond-type
calculations only, sets the atom pair, used by cxcalc, for internal use only;
API usage: call getShortestPath(int,int) instead.
setParameters in class CalculatorPluginparams - is the parameter table
PluginException - on errorpublic boolean handlesMultiFragmentMolecules()
true if the plugin handles multifragment molecules,
false otherwise. In the latter case the plugin takes the
fragment with more atoms if a multifragment molecule is given as input.
Returns true if parameter "single" is set to "false",
false otherwise (default: false).
handlesMultiFragmentMolecules in class CalculatorPlugin
public void checkMolecule(Molecule mol)
throws PluginException
RxnMolecule
or if the molecule contains R-groups.
checkMolecule in class CalculatorPluginmol - is the input molecule
PluginException - with error message for the user if the molecule is refused
protected void setInputMolecule(Molecule mol)
throws PluginException
setInputMolecule in class CalculatorPluginmol - is the input molecule
PluginException - on errorpublic int getAllAtomCount()
public int getAliphaticAtomCount()
public int getAromaticAtomCount()
public int getBondCount()
public int getAliphaticBondCount()
public int getAromaticBondCount()
public int getFragmentCount()
public int getRingCount()
public int getAliphaticRingCount()
public int getAliphaticRingCountOfSize(int size)
size - size of the ring to count
public int getAromaticRingCount()
public int getAromaticRingCountOfSize(int size)
size - size of the ring to count
public int getHeteroRingCount()
public int getHeteroaromaticRingCount()
public int getCarboRingCount()
public int getCarboaromaticRingCount()
public int getRingAtomCount()
public int getRingBondCount()
public int getChainAtomCount()
public int getChainBondCount()
public int getRotatableBondCount()
public int getSmallestRingSize()
public int getLargestRingSize()
public int getFusedRingCount()
public int getFusedAliphaticRingCount()
public int getFusedAromaticRingCount()
public int getRingSystemCount()
public int getRingSystemCountOfSize(int size)
size - size of the ring to count
public int getLargestRingSystemSize()
public int getSmallestRingSystemSize()
public boolean isAromaticAtom(int index)
true if aromatic atom.
index - is the atom index
true if aromatic atompublic boolean isAliphaticAtom(int index)
true if aliphatic atom.
index - is the atom index
true if aliphatic atompublic boolean isChainAtom(int index)
true if chain atom.
index - is the atom index
true if chain atompublic boolean isRingAtom(int index)
true if ring atom.
index - is the atom index
true if ring atompublic int getSmallestRingSizeOfAtom(int index)
index - is the atom index
public int getLargestRingSizeOfAtom(int index)
index - is the atom index
public int getCyclomaticNumber()
public int getAsymmetricAtomCount()
public boolean isAsymmetricAtom(int index)
true if asymmetric atom.
index - is the atom index
true if asymmetric atompublic int getChiralCenterCount()
public boolean isChiralCenter(int index)
index - is the atom index
true if the atom is stereogenic.
public int getShortestPath(int index1,
int index2)
Integer.MAX_VALUE for
atoms of disconnected structures.
index1 - is the index of the first atomindex2 - is the index of the second atom
public boolean isConnected(int index1,
int index2)
true if two atoms are in the same connected component,
false for atoms of disconnected structures.
public int getPlattIndex()
public double getRandicIndex()
public double getBalabanIndex()
public int getDistanceDegree(int index)
index - atom index
public int getEccentricity(int index)
index - atom index
public double getHararyIndex()
public int getHyperWienerIndex()
public int getSzegedIndex()
public int getWienerIndex()
public int getWienerPolarity()
public double getStericEffectIndex(int index)
index - atom index
public int getBondType(int index)
index - bond index
public int getDistanceCount(int index,
int distance)
index - atom indexdistance - the distance value to count
public boolean isRingBond(int index)
index - bond index
public boolean isChainBond(int index)
index - bond index
public boolean isConnectedGraph()
public boolean isRotatableBond(int index)
index - bond index
public int getRingCountOfAtom(int index)
index - atom index
public int getRingCountOfSize(int size)
size - size of the ring to count
public int getBondIndex(int i1,
int i2)
-1 if the two atoms are not connected by bond.
i1 - the first atom indexi2 - the second atom index
-1 if there is no such bond
public java.lang.Object getResult(java.lang.Object type,
int index)
throws PluginException
getResult in class CalculatorPlugintype - is the result typeindex - is the result index
PluginException - if the result cannot be returnedCalculatorPlugin.getResultTypes()
public java.lang.Object getResult(java.lang.Object type,
java.lang.String arg)
throws PluginException
getResult in class CalculatorPlugintype - is the result type ("shortestPath" or "connected")arg - is the atom string as atom1-atom2 (e.g. "2-3")
PluginException - on errorCalculatorPlugin.getResultTypes()
public java.lang.String getResultAsString(java.lang.Object type,
int index,
java.lang.Object result)
throws PluginException
getResultAsString in class CalculatorPlugintype - is the result typeindex - is the result indexresult - is the result item
PluginException - if an invalid result item is givenpublic int getResultCount(java.lang.Object type)
getResultCount in class CalculatorPlugintype - is the result type
getResultTypes()public int getResultDomain(java.lang.Object type)
CalculatorPlugin.ATOM or CalculatorPlugin.MOLECULE.
getResultDomain in class CalculatorPlugintype - is the result key
getResultTypes()public java.lang.Object[] getResultTypes()
true if two atoms are connected)
true if the molecule graph is connected)
getResultTypes in class CalculatorPluginpublic java.lang.String getTypeString(java.lang.Object type)
getTypeString in class CalculatorPlugintype - is the type object
public boolean run()
throws PluginException
run in class CalculatorPluginPluginException - on errorCalculatorPlugin.getErrorMessage()
public Molecule getResultMolecule()
throws PluginException
MolAtom.getExtraLabel()).
Molecular results are stored in molecule properties
with keys being the result types
(Molecule.getProperty(String)).
getResultMolecule in class CalculatorPluginPluginException - on error
public Molecule[] getResultMolecules()
throws PluginException
getResultMolecules in class CalculatorPluginPluginException - on errorpublic java.lang.String getRemark()
null.
getRemark in class CalculatorPluginpublic void standardize(Molecule mol)
standardize in class CalculatorPluginmol - is the molecule to be standardized
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||