1
/* $Revision: 5855 $ $Author: egonw $ $Date: 2006-03-29 10:27:08 +0200 (Wed, 29 Mar 2006) $
3
* Copyright (C) 2006-2007 The Chemistry Development Kit (CDK) project
5
* Contact: cdk-devel@lists.sourceforge.net
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public License
9
* as published by the Free Software Foundation; either version 2.1
10
* of the License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21
package org.openscience.cdk.qsar.descriptors.atomic;
23
import org.openscience.cdk.charges.MMFF94PartialCharges;
24
import org.openscience.cdk.exception.CDKException;
25
import org.openscience.cdk.interfaces.IAtom;
26
import org.openscience.cdk.interfaces.IAtomContainer;
27
import org.openscience.cdk.qsar.AbstractAtomicDescriptor;
28
import org.openscience.cdk.qsar.DescriptorSpecification;
29
import org.openscience.cdk.qsar.DescriptorValue;
30
import org.openscience.cdk.qsar.result.DoubleResult;
33
* The calculation of total partial charges of an heavy atom is based on MMFF94 model.
35
* <p>This descriptor uses these parameters:
40
* <td>Description</td>
45
* <td>no parameters</td>
50
* @author Miguel Rojas
51
* @cdk.created 2006-04-11
52
* @cdk.module builder3d
53
* @cdk.set qsar-descriptors
54
* @cdk.dictref qsar-descriptors:partialTChargeMMFF94
55
* @see MMFF94PartialCharges
57
public class PartialTChargeMMFF94Descriptor extends AbstractAtomicDescriptor {
59
private MMFF94PartialCharges mmff;
63
* Constructor for the PartialTChargeMMFF94Descriptor object
65
public PartialTChargeMMFF94Descriptor() {
66
mmff = new MMFF94PartialCharges();
71
* Gets the specification attribute of the PartialTChargeMMFF94Descriptor object
73
*@return The specification value
75
public DescriptorSpecification getSpecification() {
76
return new DescriptorSpecification(
77
"http://www.blueobelisk.org/ontologies/chemoinformatics-algorithms/#partialTChargeMMFF94",
78
this.getClass().getName(),
79
"$Id: PartialTChargeMMFF94Descriptor.java 5855 2006-03-29 10:27:08 +0200 (Wed, 29 Mar 2006) egonw $",
80
"The Chemistry Development Kit");
85
* This descriptor does not have any parameter to be set.
87
public void setParameters(Object[] params) throws CDKException {
93
* Gets the parameters attribute of the PartialTChargeMMFF94Descriptor
96
*@return The parameters value
99
public Object[] getParameters() {
105
* The method returns partial charges assigned to an heavy atom through MMFF94 method.
106
* It is needed to call the addExplicitHydrogensToSatisfyValency method from the class tools.HydrogenAdder.
108
*@param atom The IAtom for which the DescriptorValue is requested
109
*@param ac AtomContainer
110
*@return an array of doubles with partial charges of [heavy, proton_1 ... proton_n]
111
*@exception CDKException Possible Exceptions
113
public DescriptorValue calculate(IAtom atom, IAtomContainer ac) throws CDKException {
114
DoubleResult aphaPartialCharge;
116
mmff.assignMMFF94PartialCharges(ac);
118
aphaPartialCharge = new DoubleResult(((Double)target.getProperty("MMFF94charge")).doubleValue());
119
} catch (Exception ex1) {
120
throw new CDKException("Problems with assignMMFF94PartialCharges due to " + ex1.toString(), ex1);
122
return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), aphaPartialCharge);
127
* Gets the parameterNames attribute of the PartialTChargeMMFF94Descriptor
130
* @return The parameterNames value
132
public String[] getParameterNames() {
133
return new String[0];
138
* Gets the parameterType attribute of the PartialTChargeMMFF94Descriptor
141
*@param name Description of the Parameter
142
*@return The parameterType value
144
public Object getParameterType(String name) {