4
* $Date: 2007-02-01 20:46:29 +0100 (Thu, 01 Feb 2007) $
7
* Copyright (C) 2004-2007 The Chemistry Development Kit (CDK) project
9
* Contact: cdk-devel@lists.sourceforge.net
11
* This program is free software; you can redistribute it and/or
12
* modify it under the terms of the GNU Lesser General Public License
13
* as published by the Free Software Foundation; either version 2.1
14
* of the License, or (at your option) any later version.
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Lesser General Public License for more details.
21
* You should have received a copy of the GNU Lesser General Public License
22
* along with this program; if not, write to the Free Software
23
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
25
package org.openscience.cdk.qsar.descriptors.molecular;
27
import org.openscience.cdk.exception.CDKException;
28
import org.openscience.cdk.interfaces.IAtomContainer;
29
import org.openscience.cdk.qsar.DescriptorSpecification;
30
import org.openscience.cdk.qsar.DescriptorValue;
31
import org.openscience.cdk.qsar.IMolecularDescriptor;
32
import org.openscience.cdk.qsar.result.DoubleResult;
33
import org.openscience.cdk.qsar.result.IDescriptorResult;
34
import org.openscience.cdk.tools.MFAnalyser;
37
* Vertex adjacency information (magnitude):
38
* 1 + log2 m where m is the number of heavy-heavy bonds. If m is zero, then zero is returned.
39
* (definition from MOE tutorial on line)
41
* <p>This descriptor uses these parameters:
46
* <td>Description</td>
51
* <td>no parameters</td>
55
* Returns a single value named <i>vAdjMat</i>.
58
* @cdk.created 2004-11-03
60
* @cdk.set qsar-descriptors
61
* @cdk.dictref qsar-descriptors:vAdjMa
63
public class VAdjMaDescriptor implements IMolecularDescriptor {
66
* Constructor for the VAdjMaDescriptor object
68
public VAdjMaDescriptor() { }
72
* Gets the specification attribute of the VAdjMaDescriptor object
74
*@return The specification value
76
public DescriptorSpecification getSpecification() {
77
return new DescriptorSpecification(
78
"http://www.blueobelisk.org/ontologies/chemoinformatics-algorithms/#vAdjMa",
79
this.getClass().getName(),
80
"$Id: VAdjMaDescriptor.java 7844 2007-02-01 19:46:29Z rajarshi $",
81
"The Chemistry Development Kit");
86
* Sets the parameters attribute of the VAdjMaDescriptor object
88
*@param params The new parameters value
89
*@exception CDKException Description of the Exception
91
public void setParameters(Object[] params) throws CDKException {
92
// no parameters for this descriptor
97
* Gets the parameters attribute of the VAdjMaDescriptor object
99
*@return The parameters value
101
public Object[] getParameters() {
102
// no parameters to return
108
* calculates the VAdjMa descriptor for an atom container
110
*@param atomContainer AtomContainer
112
*@exception CDKException Possible Exceptions
114
public DescriptorValue calculate(IAtomContainer atomContainer) throws CDKException {
115
MFAnalyser formula = new MFAnalyser(atomContainer);
116
int magnitude = formula.getHeavyAtoms().size();
119
vadjMa += (Math.log(magnitude) / Math.log(2)) + 1;
121
return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(),
122
new DoubleResult(vadjMa), new String[] {"vAdjMat"});
126
* Returns the specific type of the DescriptorResult object.
128
* The return value from this method really indicates what type of result will
129
* be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result
130
* can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method
131
* allows you to do the same thing, without actually calculating the descriptor.
133
* @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating
134
* the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object
136
public IDescriptorResult getDescriptorResultType() {
137
return new DoubleResult(0.0);
142
* Gets the parameterNames attribute of the VAdjMaDescriptor object
144
*@return The parameterNames value
146
public String[] getParameterNames() {
147
// no param names to return
154
* Gets the parameterType attribute of the VAdjMaDescriptor object
156
*@param name Description of the Parameter
157
*@return The parameterType value
159
public Object getParameterType(String name) {