1
/* $Revision: 6228 $ $Author: egonw $ $Date: 2006-05-11 18:34:42 +0200 (Thu, 11 May 2006) $
3
* Copyright (C) 2006-2007 Miguel Rojas <miguel.rojas@uni-koeln.de>
5
* Contact: cdk-devel@lists.sourceforge.net
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (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 General Public License for more details.
17
* You should have received a copy of the GNU General Public License along
18
* with this program; if not, write to the Free Software Foundation, Inc.,
19
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
package org.openscience.cdk.qsar.descriptors.atomic;
23
import java.util.Iterator;
24
import java.util.List;
26
import org.openscience.cdk.AtomContainerSet;
27
import org.openscience.cdk.CDKConstants;
28
import org.openscience.cdk.aromaticity.HueckelAromaticityDetector;
29
import org.openscience.cdk.exception.CDKException;
30
import org.openscience.cdk.graph.invariant.ConjugatedPiSystemsDetector;
31
import org.openscience.cdk.interfaces.IAtom;
32
import org.openscience.cdk.interfaces.IAtomContainer;
33
import org.openscience.cdk.interfaces.IBond;
34
import org.openscience.cdk.interfaces.IMolecule;
35
import org.openscience.cdk.interfaces.IMoleculeSet;
36
import org.openscience.cdk.interfaces.IReaction;
37
import org.openscience.cdk.interfaces.IReactionSet;
38
import org.openscience.cdk.qsar.DescriptorSpecification;
39
import org.openscience.cdk.qsar.DescriptorValue;
40
import org.openscience.cdk.qsar.IAtomicDescriptor;
41
import org.openscience.cdk.qsar.descriptors.bond.BondPartialSigmaChargeDescriptor;
42
import org.openscience.cdk.qsar.descriptors.bond.ResonancePositiveChargeDescriptor;
43
import org.openscience.cdk.qsar.result.DoubleArrayResult;
44
import org.openscience.cdk.qsar.result.DoubleResult;
45
import org.openscience.cdk.reaction.IReactionProcess;
46
import org.openscience.cdk.reaction.type.ElectronImpactNBEReaction;
49
* This class returns the ionization potential of an atom containg lone
50
* pair electrons. It is
51
* based on a decision tree which is extracted from Weka(J48) from
52
* experimental values. Up to now is only possible predict for
53
* Cl,Br,I,N,P,O,S Atoms and they are not belong to
54
* conjugated system or not adjacent to an double bond.
56
* <p>This descriptor uses these parameters:
61
* <td>Description</td>
66
* <td>no parameters</td>
70
* @author Miguel Rojas
71
* @cdk.created 2006-05-26
73
* @cdk.set qsar-descriptors
74
* @cdk.dictref qsar-descriptors:ionizationPotential
77
public class IPAtomicDescriptor implements IAtomicDescriptor {
79
private IReactionSet reactionSet;
82
* Constructor for the IPAtomicDescriptor object
84
public IPAtomicDescriptor() {
87
* Gets the specification attribute of the IPAtomicDescriptor object
89
*@return The specification value
91
public DescriptorSpecification getSpecification() {
92
return new DescriptorSpecification(
93
"http://www.blueobelisk.org/ontologies/chemoinformatics-algorithms/#ionizationPotential",
94
this.getClass().getName(),
95
"$Id: IPAtomicDescriptor.java 6171 2006-5-22 19:29:58Z egonw $",
96
"The Chemistry Development Kit");
99
* This descriptor does have any parameter.
101
public void setParameters(Object[] params) throws CDKException {
106
* Gets the parameters attribute of the IPAtomicDescriptor object.
108
*@return The parameters value
109
* @see #setParameters
111
public Object[] getParameters() {
115
* This method calculates the ionization potential of an atom.
117
*@param chemObj The IAtom to ionize.
118
*@param container Parameter is the IAtomContainer.
119
*@return The ionization potential. Not possible the ionization.
120
*@exception CDKException Description of the Exception
122
public DescriptorValue calculate(IAtom atom, IAtomContainer atomContainer) throws CDKException{
123
IAtomContainer localClone;
125
localClone= (IAtomContainer) atomContainer.clone();
126
} catch (CloneNotSupportedException e) {
127
throw new CDKException("Error during clone");
129
IAtom clonedAtom = localClone.getAtom(atomContainer.getAtomNumber(atom));
131
reactionSet = localClone.getBuilder().newReactionSet();
133
double resultD = -1.0;
134
boolean isTarget = false;
135
boolean isConjugated = false;
136
double[] resultsH = null;
138
/*control if it is into an aromatic or conjugated system*/
139
HueckelAromaticityDetector.detectAromaticity(localClone,true);
140
AtomContainerSet conjugatedPi = ConjugatedPiSystemsDetector.detect(localClone);
141
Iterator acI = conjugatedPi.atomContainers();
142
while(acI.hasNext()){
143
IAtomContainer ac = (IAtomContainer) acI.next();
144
if(ac.contains(clonedAtom)){
146
if(localClone.getMaximumBondOrder(clonedAtom) == 1 && localClone.getConnectedLonePairsCount(clonedAtom) > 0){
147
resultsH = calculateHeteroAtomConjugatedDescriptor(clonedAtom, localClone,ac);
148
resultD = getTreeHeteroConjAtom(resultsH);
155
if(atom.getFlag(CDKConstants.ISAROMATIC))
158
int count = localClone.getConnectedLonePairsCount(clonedAtom);
160
if(localClone.getMaximumBondOrder(clonedAtom) > 1 && localClone.getConnectedLonePairsCount(clonedAtom) > 0){
161
resultsH = calculateCarbonylDescriptor(clonedAtom, localClone);
162
resultD = getTreeDoubleHetero(resultsH);
165
}else if(localClone.getConnectedLonePairsCount(clonedAtom) > 0 && !isConjugated){
166
resultsH = calculateHeteroAtomDescriptor(clonedAtom, localClone);
167
resultD = getTreeHeteroAtom(resultsH);
174
/* inizate reaction*/
175
if(localClone.getConnectedLonePairsCount(clonedAtom) > 0){
177
IMoleculeSet setOfReactants = localClone.getBuilder().newMoleculeSet();
178
setOfReactants.addMolecule((IMolecule) localClone);
179
IReactionProcess type = new ElectronImpactNBEReaction();
180
atom.setFlag(CDKConstants.REACTIVE_CENTER,true);
181
Object[] params = {Boolean.TRUE};
182
type.setParameters(params);
183
IReactionSet nbe = type.initiate(setOfReactants, null);
184
Iterator it = nbe.reactions();
186
IReaction reaction = (IReaction)it.next();
187
reaction.setProperty("IonizationEnergy", new Double(resultD));
188
reactionSet.addReaction(reaction);
192
return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(resultD));
195
* tree desicion for the carbonyl atoms
197
* @param resultsH Array which contains the results of each descriptor
200
private double getTreeHeteroConjAtom(double[] resultsH) {
202
double SE_1 = resultsH[0];
203
double SE_2 = resultsH[1];
204
double EE_1 = resultsH[2];
205
double RES_c2 = resultsH[3];
207
if (SE_1 <= -0.069065)
209
if (SE_1 <= -0.138994)
211
if (EE_1 <= 0.676304)
213
if (SE_1 <= -2.022267) { result = 07.7; /* 2.0 */}
214
else if (SE_1 > -2.022267) { result = 08.2; /* 4.0/2.0 */}
218
if (SE_1 <= -2.514435) { result = 08.0; /* 3.0/1.0 */}
219
else if (SE_1 > -2.514435) { result = 09.5; /* 4.0/2.0 */}
222
if (SE_1 > -0.138994)
224
if (EE_1 <= 0.032157)
226
if (EE_1 <= 0.026958)
228
if (EE_1 <= 0.023022) { result = 08.1; /* 2.0/1.0 */}
229
else if (EE_1 > 0.023022)
231
if (SE_1 <= -0.074747) { result = 08.6; /* 3.0/1.0 */}
232
else if (SE_1 > -0.074747) { result = 08.9; /* 3.0 */}
237
if (SE_2 <= 0.081676) { result = 08.3; /* 2.0/1.0 */}
238
else if (SE_2 > 0.081676) { result = 08.0; /* 6.0/1.0 */}
243
if (EE_1 <= 0.045671) { result = 08.6; /* 5.0/2.0 */}
244
else if (EE_1 > 0.045671)
246
if (SE_1 <= -0.137681) { result = 08.1; /* 2.0/1.0 */}
247
else if (SE_1 > -0.137681) { result = 08.4; /* 5.0/2.0 */}
252
if (SE_1 > -0.069065)
254
if (SE_1 <= -0.061906)
256
if (RES_c2 <= 0.006978) { result = 07.4; /* 15.0/10.0 */}
257
else if (RES_c2 > 0.006978)
259
if (SE_1 <= -0.063064) { result = 07.5; /* 8.0/5.0 */}
260
else if (SE_1 > -0.063064) { result = 07.3; /* 2.0/1.0 */}
263
if (SE_1 > -0.061906)
265
if (RES_c2 <= 0.003398)
267
if (SE_1 <= 0.051565)
269
if (EE_1 <= 0.007932)
271
if (SE_1 <= -0.023796) { result = 08.7; /* 4.0/2.0 */}
272
else if (SE_1 > -0.023796)
274
if (EE_1 <= -0.003129) { result = 07.3; /* 2.0/1.0 */}
275
else if (EE_1 > -0.003129) { result = 07.4; /* 4.0/2.0 */}
282
if (SE_1 <= -0.02952) { result = 08.0; /* 2.0/1.0 */}
283
else if (SE_1 > -0.02952) { result = 07.8; /* 2.0/1.0 */}
285
if (SE_1 > -0.0252) { result = 07.7; /* 4.0/1.0 */}
290
if (RES_c2 <= -0.003572) { result = 08.5; /* 4.0/2.0 */}
291
else if (RES_c2 > -0.003572)
293
if (SE_1 <= 0.126992) { result = 07.6; /* 2.0/1.0 */}
294
else if (SE_1 > 0.126992) { result = 08.2; /* 2.0/1.0 */}
298
if (RES_c2 > 0.003398)
300
if (SE_1 <= -0.031039)
302
if (RES_c2 <= 0.005076) { result = 08.1; /* 9.0/5.0 */}
303
else if (RES_c2 > 0.005076)
305
if (SE_1 <= -0.061705) { result = 08.2; /* 2.0 */}
306
else if (SE_1 > -0.061705)
308
if (SE_1 <= -0.060998) { result = 08.3; /* 2.0 */}
309
else if (SE_1 > -0.060998) { result = 08.0; /* 2.0/1.0 */}
313
if (SE_1 > -0.031039)
315
if (SE_1 <= -0.023566)
317
if (SE_1 <= -0.028788) { result = 07.9; /* 2.0 */}
318
else if (SE_1 > -0.028788) { result = 09.3; /* 2.0/1.0 */}
320
if (SE_1 > -0.023566)
322
if (RES_c2 <= 0.004518) { result = 08.2; /* 2.0/1.0 */}
323
else if (RES_c2 > 0.004518) { result = 08.7; /* 4.0/2.0 */}
333
* tree desicion for the carbonyl atoms
335
* @param resultsH Array which contains the results of each descriptor
338
private double getTreeDoubleHetero(double[] resultsH) {
340
double SE_c = resultsH[0];
341
double PCH_c = resultsH[1];
342
double SB = resultsH[2];
343
double SE_x = resultsH[3];
344
double PCH_x = resultsH[4];
345
double RES_c = resultsH[5];
347
if (PCH_c <= 0.045111)
349
if (PCH_x <= -0.041368)
351
if (SE_c <= 7.471265)
353
if (RES_c <= 0.182146)
357
if (RES_c <= 0.181878) { result = 08.4; /* 3.0/1.0 */}
358
else if (RES_c > 0.181878) { result = 09.2; /* 4.0/1.0 */}
362
if (SE_c <= 6.758953) { result = 09.0; /* 2.0 */}
363
else if (SE_c > 6.758953) { result = 09.6; /* 2.0/1.0 */}
366
if (RES_c > 0.182146)
368
if (RES_c <= 0.371342)
370
if (PCH_c <= 0.019491) { result = 09.3; /* 9.0/3.0 */}
371
else if (PCH_c > 0.019491)
373
if (SE_c <= 6.683097) { result = 09.7; /* 3.0 */}
374
else if (SE_c > 6.683097) { result = 09.6; /* 4.0/2.0 */}
377
if (RES_c > 0.371342)
379
if (PCH_c <= 0.019061) { result = 08.7; /* 3.0/1.0 */}
380
else if (PCH_c > 0.019061)
382
if (SE_c <= 6.689165) { result = 09.9; /* 2.0/1.0 */}
383
else if (SE_c > 6.689165) { result = 09.5; /* 4.0/1.0 */}
390
if (SE_x <= 13.191725)
394
if (PCH_x <= -0.045111) { result = 10.2; /* 4.0/2.0 */}
395
else if (PCH_x > -0.045111) { result = 09.8; /* 2.0/1.0 */}
399
if (SE_c <= 7.571876) { result = 10.0; /* 4.0/2.0 */}
400
else if (SE_c > 7.571876) { result = 09.6; /* 4.0/1.0 */}
403
if (SE_x > 13.191725)
405
if (PCH_c <= 0.010584) { result = 09.5; /* 3.0/1.0 */}
406
else if (PCH_c > 0.010584) { result = 09.4; /* 2.0/1.0 */}
410
if (PCH_x > -0.041368)
412
if (PCH_c <= 0.029565)
416
if (PCH_c <= 0.02228) { result = 08.6; /* 3.0/1.0 */}
417
else if (PCH_c > 0.02228) { result = 07.4; /* 2.0/1.0 */}
421
if (SE_x <= 9.633713)
423
if (SE_c <= 8.750164) { result = 08.4; /* 2.0/1.0 */}
424
else if (SE_c > 8.750164) { result = 09.4; /* 3.0/1.0 */}
430
if (SE_c <= 7.010887) { result = 09.1; /* 2.0/1.0 */}
431
else if (SE_c > 7.010887) { result = 08.6; /* 3.0/2.0 */}
435
if (SE_c <= 8.852704)
439
if (PCH_c <= 0.000059) { result = 08.5; /* 2.0 */}
440
else if (PCH_c > 0.000059)
442
if (SE_c <= 8.779599) { result = 08.6; /* 4.0/1.0 */}
443
else if (SE_c > 8.779599) { result = 08.5; /* 2.0/1.0 */}
446
if (SB > 0.473847) { result = 08.2; /* 2.0/1.0 */}
448
if (SE_c > 8.852704) { result = 08.2; /* 3.0/2.0 */}
453
if (PCH_c > 0.029565)
455
if (SE_x <= 12.990697)
457
if (PCH_c <= 0.039387)
459
if (RES_c <= 1.086882)
461
if (SE_x <= 9.519079) { result = 10.0; /* 2.0 */}
462
else if (SE_x > 9.519079)
464
if (SE_c <= 8.798893) { result = 09.8; /* 3.0/1.0 */}
465
else if (SE_c > 8.798893) { result = 09.2; /* 3.0/2.0 */}
468
if (RES_c > 1.086882) { result = 08.9; /* 3.0/1.0 */}
470
if (PCH_c > 0.039387)
472
if (SE_c <= 10.049963) { result = 09.3; /* 13.0/7.0 */}
473
else if (SE_c > 10.049963)
475
if (PCH_c <= 0.039719) { result = 09.1; /* 25.0/13.0 */}
476
else if (PCH_c > 0.039719)
478
if (SE_c <= 10.079873) { result = 09.3; /* 2.0/1.0 */}
479
else if (SE_c > 10.079873) { result = 08.9; /* 2.0/1.0 */}
484
if (SE_x > 12.990697)
486
if (PCH_c <= 0.039882)
488
if (RES_c <= 0.913891)
490
if (SE_x <= 12.995039)
492
if (SE_c <= 10.112309) { result = 09.0; /* 8.0/4.0 */}
493
else if (SE_c > 10.112309) { result = 08.8; /* 3.0/1.0 */}
495
if (SE_x > 12.995039)
497
if (SE_c <= 10.117785) { result = 08.7; /* 2.0/1.0 */}
498
else if (SE_c > 10.117785) { result = 09.0; /* 2.0/1.0 */}
501
if (RES_c > 0.913891) { result = 08.9; /* 3.0/1.0 */}
503
if (PCH_c > 0.039882) { result = 08.8; /* 7.0/4.0 */}
508
if (PCH_c > 0.045111)
510
if (SE_c <= 7.915887)
512
if (RES_c <= 0.699389)
514
if (PCH_c <= 1.979715) { result = 11.1; /* 4.0/2.0 */}
515
else if (PCH_c > 1.979715) { result = 08.9; /* 3.0/2.0 */}
517
if (RES_c > 0.699389) { result = 08.5; /* 2.0 */}
523
if (PCH_c <= 0.582583)
525
if (PCH_c <= 0.576351) { result = 08.3; /* 3.0/1.0 */}
526
else if (PCH_c > 0.576351) { result = 07.5; /* 2.0/1.0 */}
528
if (PCH_c > 0.582583)
530
if (PCH_c <= 1.296286) { result = 08.4; /* 2.0/1.0 */}
531
else if (PCH_c > 1.296286) { result = 09.4; /* 3.0/2.0 */}
536
if (SE_x <= 12.940799)
538
if (SB <= 0.421092) { result = 09.9; /* 2.0 */}
539
else if (SB > 0.421092)
541
if (PCH_c <= 0.045325) { result = 09.7; /* 5.0/3.0 */}
542
else if (PCH_c > 0.045325) { result = 09.6; /* 4.0/2.0 */}
545
if (SE_x > 12.940799) { result = 09.5; /* 6.0/3.0 */}
553
* tree desicion for the Heteroatom
555
* @param resultsH Array which contains the results of each descriptor
558
private double getTreeHeteroAtom(double[] resultsH) {
560
double SE = resultsH[0];
561
double SCH = resultsH[1];
562
double EE = resultsH[2];
563
double PE = resultsH[3];
569
if (SCH <= -0.315373)
575
if (SCH <= -0.330239) { result = 06.2; /* 3.0/2.0 */}
576
else if (SCH > -0.330239)
578
if (SE <= 8.120134) { result = 08.5; /* 2.0/1.0 */}
579
else if (SE > 8.120134) { result = 09.0; /* 2.0/1.0 */}
586
if (EE <= 5.00775) { result = 08.6; /* 7.0/3.0 */}
587
else if (EE > 5.00775) { result = 08.5; /* 4.0/1.0 */}
589
if (SCH > -0.32534) { result = 08.1; /* 3.0/2.0 */}
594
if (SCH <= -0.321973)
596
if (SE <= 8.1475) { result = 08.4; /* 3.0/1.0 */}
597
else if (SE > 8.1475) { result = 08.5; /* 2.0/1.0 */}
601
if (EE <= 6.102) { result = 07.9; /* 2.0/1.0 */}
602
else if (EE > 6.102) { result = 08.0; /* 3.0/1.0 */}
608
if (PE <= 4.873452) { result = 09.2; /* 15.0/10.0 */}
609
else if (PE > 4.873452)
611
if (SCH <= -0.139567)
613
if (EE <= 1.438) { result = 09.8; /* 3.0/1.0 */}
616
if (SE <= 8.60319) { result = 09.1; /* 6.0/2.0 */}
617
else if (SE > 8.60319) { result = 08.6; /* 2.0/1.0 */}
622
if (SE <= 7.833611) { result = 09.3; /* 3.0/2.0 */}
623
else if (SE > 7.833611) { result = 08.5; /* 3.0/1.0 */}
640
if (SCH <= -0.315888) { result = 07.8; /* 2.0/1.0 */}
641
else if (SCH > -0.315888) { result = 08.0; /* 3.0 */}
645
if (SCH <= -0.315373) { result = 07.6; /* 2.0/1.0 */}
646
else if (SCH > -0.315373) { result = 08.3; /* 3.0/1.0 */}
651
if (SCH <= -0.310518)
653
if (SCH <= -0.310845) { result = 07.9; /* 5.0/3.0 */}
654
else if (SCH > -0.310845) { result = 08.5; /* 2.0/1.0 */}
658
if (SCH <= -0.305857)
660
if (EE <= 7.07075) { result = 07.6; /* 2.0/1.0 */}
661
else if (EE > 7.07075)
663
if (SE <= 8.357012) { result = 08.3; /* 6.0/3.0 */}
664
else if (SE > 8.357012) { result = 07.8; /* 3.0/2.0 */}
669
if (SE <= 8.360428) { result = 07.7; /* 3.0 */}
670
else if (SE > 8.360428) { result = 07.9; /* 2.0/1.0 */}
681
if (SE <= 8.376288) { result = 08.0; /* 4.0/1.0 */}
682
else if (SE > 8.376288) { result = 07.5; /* 2.0 */}
684
if (EE > 7.994375) { result = 07.6; /* 3.0 */}
688
if (SCH <= -0.303186) { result = 07.7; /* 2.0/1.0 */}
689
else if (SCH > -0.303186) { result = 08.0; /* 4.0 */}
697
if (EE <= 8.326844) { result = 07.9; /* 5.0/1.0 */}
698
else if (EE > 8.326844)
700
if (SCH <= -0.301277) { result = 08.1; /* 5.0/2.0 */}
701
else if (SCH > -0.301277) { result = 07.7; /* 2.0/1.0 */}
706
if (SCH <= -0.299978)
708
if (SE <= 8.391832) { result = 07.0; /* 4.0/2.0 */}
709
else if (SE > 8.391832) { result = 07.8; /* 2.0 */}
713
if (SE <= 8.289405) { result = 07.7; /* 2.0 */}
714
else if (SE > 8.289405) { result = 07.9; /* 3.0 */}
725
if (EE <= 6.99075) { result = 08.6; /* 5.0/2.0 */}
726
else if (EE > 6.99075)
728
if (SE <= 8.672826) { result = 08.5; /* 4.0/2.0 */}
729
else if (SE > 8.672826)
731
if (SE <= 8.724731) { result = 08.6; /* 3.0/1.0 */}
732
else if (SE > 8.724731) { result = 08.4; /* 2.0/1.0 */}
740
if (SCH <= -0.16701) { result = 08.7; /* 4.0/2.0 */}
741
else if (SCH > -0.16701) { result = 08.4; /* 9.0/2.0 */}
747
if (SE <= 8.75386) { result = 08.3; /* 2.0 */}
748
else if (SE > 8.75386) { result = 08.1; /* 2.0/1.0 */}
750
if (EE > 8.4175) { result = 07.9; /* 3.0/2.0 */}
758
if (SE <= 8.460227) { result = 07.7; /* 3.0/1.0 */}
759
else if (SE > 8.460227) { result = 08.3; /* 4.0/2.0 */}
765
if (EE <= 9.24575) { result = 08.2; /* 2.0/1.0 */}
766
else if (EE > 9.24575) { result = 08.1; /* 3.0/1.0 */}
768
if (EE > 9.536) { result = 07.8; /* 6.0/3.0 */}
782
if (SCH <= -0.395706)
784
if (SCH <= -0.398947) { result = 12.6; /* 3.0/1.0 */}
785
else if (SCH > -0.398947)
787
if (SCH <= -0.395985) { result = 09.1; /* 2.0/1.0 */}
788
else if (SCH > -0.395985)
790
if (EE <= 3.795813) { result = 09.2; /* 4.0/2.0 */}
791
else if (EE > 3.795813) { result = 10.4; /* 3.0/1.0 */}
797
if (EE <= 3.566) { result = 07.5; /* 3.0/2.0 */}
800
if (EE <= 3.795813) { result = 09.3; /* 2.0/1.0 */}
801
else if (EE > 3.795813) { result = 10.0; /* 5.0/3.0 */}
807
if (SCH <= -0.382949)
811
if (EE <= 4.509125) { result = 09.8; /* 5.0/2.0 */}
812
else if (EE > 4.509125) { result = 09.7; /* 3.0 */}
816
if (SCH <= -0.388693)
818
if (SE <= 9.323245) { result = 09.6; /* 2.0 */}
819
else if (SE > 9.323245)
821
if (EE <= 4.509125) { result = 09.5; /* 2.0 */}
822
else if (EE > 4.509125) { result = 09.9; /* 4.0/2.0 */}
825
if (SCH > -0.388693) { result = 09.7; /* 2.0 */}
830
if (SCH <= -0.371513) { result = 09.6; /* 4.0/2.0 */}
831
else if (SCH > -0.371513) { result = 09.4; /* 3.0/2.0 */}
841
if (SCH <= -0.389218)
845
if (SE <= 9.325385) { result = 09.2; /* 2.0/1.0 */}
846
else if (SE > 9.325385) { result = 09.1; /* 5.0/3.0 */}
850
if (EE <= 5.422063) { result = 09.0; /* 2.0/1.0 */}
851
else if (EE > 5.422063)
853
if (EE <= 5.559375) { result = 09.6; /* 3.0/1.0 */}
854
else if (EE > 5.559375) { result = 09.0; /* 2.0/1.0 */}
862
if (EE <= 5.295125) { result = 09.4; /* 9.0/5.0 */}
863
else if (EE > 5.295125) { result = 09.2; /* 6.0/3.0 */}
869
if (SCH <= -0.38064) { result = 09.3; /* 5.0/1.0 */}
870
else if (SCH > -0.38064) { result = 09.4; /* 4.0/2.0 */}
874
if (EE <= 6.050813) { result = 09.2; /* 2.0 */}
875
else if (EE > 6.050813) { result = 09.3; /* 3.0/1.0 */}
882
if (SCH <= -0.387072) { result = 09.4; /* 2.0 */}
883
else if (SCH > -0.387072)
885
if (SE <= 9.208068) { result = 09.3; /* 2.0/1.0 */}
886
else if (SE > 9.208068)
890
if (SCH <= -0.374181)
892
if (EE <= 6.764188) { result = 09.2; /* 11.0/4.0 */}
893
else if (EE > 6.764188) { result = 09.1; /* 7.0/2.0 */}
895
if (SCH > -0.374181) { result = 09.2; /* 4.0 */}
897
if (EE > 8.617) { result = 09.1; /* 5.0 */}
906
if (SCH <= -0.143549)
908
if (EE <= 5.479375) { result = 09.8; /* 3.0/2.0 */}
909
else if (EE > 5.479375)
911
if (EE <= 5.709125) { result = 09.0; /* 2.0 */}
912
else if (EE > 5.709125) { result = 09.3; /* 2.0/1.0 */}
917
if (SCH <= -0.139872)
919
if (EE <= 6.331813) { result = 10.1; /* 4.0/1.0 */}
920
else if (EE > 6.331813) { result = 10.0; /* 7.0/3.0 */}
922
if (SCH > -0.139872) { result = 09.9; /* 4.0/1.0 */}
929
if (SE <= 10.12694) { result = 08.8; /* 2.0/1.0 */}
930
else if (SE > 10.12694) { result = 09.7; /* 3.0/1.0 */}
932
if (SE > 10.155788) { result = 09.2; /* 4.0/2.0 */}
943
if (SE <= 10.475336) { result = 10.8; /* 3.0/1.0 */}
944
else if (SE > 10.475336) { result = 10.2; /* 4.0/2.0 */}
950
if (SE <= 10.47544) { result = 10.1; /* 2.0 */}
951
else if (SE > 10.47544) { result = 10.7; /* 2.0 */}
955
if (SE <= 10.510052) { result = 09.7; /* 2.0/1.0 */}
956
else if (SE > 10.510052) { result = 10.1; /* 2.0/1.0 */}
962
if (SCH <= -0.080603) { result = 09.0; /* 6.0/1.0 */}
963
else if (SCH > -0.080603)
965
if (SE <= 9.271976) { result = 08.9; /* 6.0/1.0 */}
966
else if (SE > 9.271976) { result = 08.7; /* 3.0 */}
974
* Get the reactions obtained with ionization.
975
* The energy is set as property
977
* @return The IReactionSet value
979
public IReactionSet getReactionSet() throws CDKException{
983
* Calculate the necessary descriptors for Heteratom atoms
984
* @param atomContainer The IAtomContainer
985
* @return Array with the values of the descriptors.
986
* @throws CDKException
988
private double[] calculateHeteroAtomConjugatedDescriptor(IAtom atom, IAtomContainer atomContainer, IAtomContainer conjugatedSys) throws CDKException {
989
double[] results = new double[4];
995
/*calculation of the atomic descriptors*/
996
Iterator atomIt = conjugatedSys.atoms();
997
while(atomIt.hasNext()){
998
IAtom atomsss = (IAtom) atomIt.next();
1000
if(atomContainer.getConnectedLonePairsCount(atomsss) == 0){
1001
PartialPiChargeDescriptor descriptor1 = new PartialPiChargeDescriptor();
1003
result1 = ((DoubleResult)descriptor1.calculate(atomsss,atomContainer).getValue()).doubleValue();
1006
if(result1 > results[0])
1007
results[0] = result1;
1010
PartialPiChargeDescriptor descriptor1 = new PartialPiChargeDescriptor();
1011
double result1 = ((DoubleResult)descriptor1.calculate(atomsss,atomContainer).getValue()).doubleValue();
1012
results[1] = result1;
1015
SigmaElectronegativityDescriptor descriptor2 = new SigmaElectronegativityDescriptor();
1016
double result2 = ((DoubleResult)descriptor2.calculate(atomsss,atomContainer).getValue()).doubleValue();
1017
results[3] += result2;
1020
/*calculation of the bond descriptors*/
1021
Iterator bondIt = conjugatedSys.bonds();
1022
while(bondIt.hasNext()){
1023
IBond bondsss = (IBond) bondIt.next();
1025
ResonancePositiveChargeDescriptor descriptor5 = new ResonancePositiveChargeDescriptor();
1026
DoubleArrayResult dar;
1028
dar = ((DoubleArrayResult)descriptor5.calculate(bondsss,atomContainer).getValue());
1029
double result1 = dar.get(0);
1030
double resutt2 = dar.get(1);
1031
double result12 = (result1+resutt2);
1035
resultT = result12/2;
1037
results[2] += resultT;
1041
results[2] = results[1]/conjugatedSys.getAtomCount();
1044
results[3] = results[2]/conjugatedSys.getAtomCount();
1051
* Calculate the necessary descriptors for Heteratom atoms
1052
* @param atomContainer The IAtomContainer
1053
* @return Array with the values of the descriptors.
1054
* @throws CDKException
1056
private double[] calculateHeteroAtomDescriptor(IAtom atom, IAtomContainer atomContainer) throws CDKException {
1057
double[] results = new double[4];
1058
SigmaElectronegativityDescriptor descriptor1 = new SigmaElectronegativityDescriptor();
1059
PartialSigmaChargeDescriptor descriptor2 = new PartialSigmaChargeDescriptor();
1060
EffectiveAtomPolarizabilityDescriptor descriptor3 = new EffectiveAtomPolarizabilityDescriptor();
1061
PiElectronegativityDescriptor descriptor4 = new PiElectronegativityDescriptor();
1063
results[0]= ((DoubleResult)descriptor1.calculate(atom,atomContainer).getValue()).doubleValue();
1064
results[1]= ((DoubleResult)descriptor2.calculate(atom,atomContainer).getValue()).doubleValue();
1065
results[2]= ((DoubleResult)descriptor3.calculate(atom,atomContainer).getValue()).doubleValue();
1066
results[3]= ((DoubleResult)descriptor4.calculate(atom,atomContainer).getValue()).doubleValue();
1071
* Calculate the necessary descriptors for Carbonyl group
1072
* @param atomContainer The IAtomContainer
1073
* @return Array with the values of the descriptors.
1075
private double[] calculateCarbonylDescriptor(IAtom atom, IAtomContainer atomContainer) {
1077
double[] results = new double[6];
1078
IAtom positionX = atom;
1079
IAtom positionC = null;
1080
List listAtoms = atomContainer.getConnectedAtomsList(atom);
1081
for(Iterator it = listAtoms.iterator(); it.hasNext();){
1082
IAtom atom2 = (IAtom)it.next();
1083
if(((IBond)atomContainer.getBond(atom, atom2)).getOrder() > 1)
1087
IBond bond = atomContainer.getBond(positionX, positionC);
1089
AtomContainerSet conjugatedPi = ConjugatedPiSystemsDetector.detect(atomContainer);
1091
if(conjugatedPi.getAtomContainerCount() == 1){
1092
IAtomContainer conjugatedSy = conjugatedPi.getAtomContainer(0);
1093
Iterator atomIt = conjugatedSy.atoms();
1094
while(atomIt.hasNext()){
1095
IAtom atomsss = (IAtom) atomIt.next();
1096
if(atomsss.getSymbol().equals("C")){
1097
PartialPiChargeDescriptor descriptor1 = new PartialPiChargeDescriptor();
1098
double result1 = ((DoubleResult)descriptor1.calculate(atomsss,atomContainer).getValue()).doubleValue();
1100
if(result1 > results[1])
1101
results[1] = result1;
1103
SigmaElectronegativityDescriptor descriptor2 = new SigmaElectronegativityDescriptor();
1104
double result2 = ((DoubleResult)descriptor2.calculate(atomsss,atomContainer).getValue()).doubleValue();
1105
results[0] += result2;
1109
results[0] = results[0]/conjugatedSy.getAtomCount();
1112
results[1] = results[1]/conjugatedSy.getAtomCount();
1116
SigmaElectronegativityDescriptor descriptor1 = new SigmaElectronegativityDescriptor();
1117
results[0] = ((DoubleResult)descriptor1.calculate(positionC,(IAtomContainer) atomContainer).getValue()).doubleValue();
1119
}catch(Exception e){
1122
// System.out.println("symbolC: "+atomContainer.getAtom(positionC).getSymbol());
1123
// System.out.println("symbolX: "+atomContainer.getAtom(positionX).getSymbol());
1127
PartialPiChargeDescriptor descriptor2 = new PartialPiChargeDescriptor();
1128
results[1] = ((DoubleResult)descriptor2.calculate(positionC,(IAtomContainer) atomContainer).getValue()).doubleValue();
1129
}catch(Exception e){
1135
BondPartialSigmaChargeDescriptor descriptor3 = new BondPartialSigmaChargeDescriptor();
1136
results[2] = ((DoubleResult)descriptor3.calculate(bond,(IAtomContainer) atomContainer).getValue()).doubleValue();
1137
}catch(Exception e){
1142
SigmaElectronegativityDescriptor descriptor4 = new SigmaElectronegativityDescriptor();
1143
results[3] = ((DoubleResult)descriptor4.calculate(positionX,(IAtomContainer) atomContainer).getValue()).doubleValue();
1144
}catch(Exception e){
1149
PartialPiChargeDescriptor descriptor5 = new PartialPiChargeDescriptor();
1150
results[4] = ((DoubleResult)descriptor5.calculate(positionX,(IAtomContainer) atomContainer).getValue()).doubleValue();
1151
}catch(Exception e){
1156
ResonancePositiveChargeDescriptor descriptor6 = new ResonancePositiveChargeDescriptor();
1157
DoubleArrayResult dar = ((DoubleArrayResult)descriptor6.calculate(bond,atomContainer).getValue());
1159
if((new Double(dar.get(0))).toString().equals("Infinity")||
1160
(new Double(dar.get(1))).toString().equals("Infinity")){}
1161
else if(dar.get(0) == 0 && dar.get(1) == 0){}
1163
datT = (dar.get(0)+dar.get(1))/2;
1165
}catch(Exception e){
1169
} catch (CDKException e) {
1170
e.printStackTrace();
1175
* Gets the parameterNames attribute of the IPAtomicDescriptor object.
1177
* @return The parameterNames value
1179
public String[] getParameterNames() {
1180
return new String[0];
1185
* Gets the parameterType attribute of the IPAtomicDescriptor object.
1187
* @param name Description of the Parameter
1188
* @return An Object of class equal to that of the parameter being requested
1190
public Object getParameterType(String name) {