Source code: joelib/desc/types/LogP.java
1 ///////////////////////////////////////////////////////////////////////////////
2 // Filename: $RCSfile: LogP.java,v $
3 // Purpose: Calculates the Octanol/Water partition coefficient (logP) or hydrophobicity.
4 // Language: Java
5 // Compiler: JDK 1.4
6 // Authors: Joerg K. Wegner
7 // Version: $Revision: 1.5 $
8 // $Date: 2003/08/19 13:11:25 $
9 // $Author: wegner $
10 //
11 // Copyright (c) Dept. Computer Architecture, University of Tuebingen, Germany
12 //
13 // This program is free software; you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation version 2 of the License.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 ///////////////////////////////////////////////////////////////////////////////
22 package joelib.desc.types;
23
24
25 /*==========================================================================*
26 * IMPORTS
27 *==========================================================================*/
28 import joelib.algo.contribution.GCPredictor;
29 import joelib.algo.contribution.GroupContributions;
30
31 import joelib.data.JOEGroupContribution;
32
33 import joelib.desc.DescriptorHelper;
34 import joelib.desc.DescriptorInfo;
35 import joelib.desc.SimpleDoubleDesc;
36
37 import joelib.molecule.JOEMol;
38
39 import org.apache.log4j.Category;
40
41
42 /*==========================================================================*
43 * CLASS DECLARATION
44 *==========================================================================*/
45
46 /**
47 * Calculates the Octanol/Water partition coefficient (logP) or hydrophobicity.
48 *
49 * @author wegnerj
50 * @license GPL
51 * @cvsversion $Revision: 1.5 $, $Date: 2003/08/19 13:11:25 $
52 * @cite wc99
53 */
54 public class LogP extends SimpleDoubleDesc
55 {
56 //~ Static fields/initializers /////////////////////////////////////////////
57
58 /*-------------------------------------------------------------------------*
59 * public static member variables
60 *------------------------------------------------------------------------- */
61
62 /**
63 * Obtain a suitable logger.
64 */
65 private static Category logger = Category.getInstance(
66 "joelib.desc.types.LogP");
67 public static final String DESC_KEY = "LogP";
68
69 //~ Constructors ///////////////////////////////////////////////////////////
70
71 /*-------------------------------------------------------------------------*
72 * constructor
73 *------------------------------------------------------------------------- */
74 public LogP()
75 {
76 if (logger.isDebugEnabled())
77 {
78 logger.debug("Initialize " + this.getClass().getName());
79 }
80
81 descInfo = DescriptorHelper.generateDescInfo(DESC_KEY, this.getClass(),
82 DescriptorInfo.TYPE_NO_COORDINATES, null,
83 "joelib.desc.result.DoubleResult");
84 }
85
86 //~ Methods ////////////////////////////////////////////////////////////////
87
88 /*-------------------------------------------------------------------------*
89 * public methods
90 *------------------------------------------------------------------------- */
91
92 /**
93 * Gets the defaultAtoms attribute of the NumberOfC object
94 *
95 * @return The defaultAtoms value
96 */
97 public double getDoubleValue(JOEMol mol)
98 {
99 GroupContributions contrib = null;
100 contrib = JOEGroupContribution.instance().getGroupContributions("LogP");
101
102 double logP;
103 logP = GCPredictor.predict(contrib, mol);
104
105 return logP;
106 }
107 }
108 ///////////////////////////////////////////////////////////////////////////////
109 // END OF FILE.
110 ///////////////////////////////////////////////////////////////////////////////