Discussion:
[BlueObelisk-discuss] OpenBabel question
Robert Hanson
2012-05-18 03:03:46 UTC
Permalink
OK, I'm stumped. How does one get to Rule d? Does anyone know if this code
was ever tested?

03131 if (b->GetBond
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBAtom.html#a1383e1d49338b8ee6784b8b9ef889ba4>(c)->IsAromatic
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBBond.html#a737ac5dd55e68e9d29f6d368b403c7b1>())
{03132 double Ub, Uc, pi_bc, beta;03133 Ub =
GetUParam <http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#a4dd261dbea68ff31a17a777e3a9efc8f>(b);03134
Uc = GetUParam
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#a4dd261dbea68ff31a17a777e3a9efc8f>(c);03135
03136 if (!HasPilpSet
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#a01072db9ce803fb91ff6b73cd62ac03a>(type_b)
&& !HasPilpSet <http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#a01072db9ce803fb91ff6b73cd62ac03a>(type_c))03137
pi_bc = 0.5;03138 else03139 pi_bc =
0.3;03140 03141 if (((GetVal
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#adf66fb6159cb5cfb695ef10ea85f9c43>(type_b)
== 3) && (GetVal
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#adf66fb6159cb5cfb695ef10ea85f9c43>(type_c)
== 4)) ||03142 ((GetVal
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#adf66fb6159cb5cfb695ef10ea85f9c43>(type_b)
== 4) && (GetVal
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#adf66fb6159cb5cfb695ef10ea85f9c43>(type_c)
== 3)))03143 beta = 3.0;03144 else03145
beta = 6.0;03146 03147 torsioncalc.v1
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBFFTorsionCalculationMMFF94.html#a56e54b9521cb38b2eaec90d6530ca46b>
= 0.0;03148 torsioncalc.v2
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBFFTorsionCalculationMMFF94.html#af5a97920571660315ee3a8bbbd8c90a0>
= beta * pi_bc * sqrt(Ub * Uc);03149 torsioncalc.v3
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBFFTorsionCalculationMMFF94.html#a2cf47c38afaedf54148e8ff0eae629f8>
= 0.0;03150 found_rule = true;03151 } else {03152
// rule (c) page 63103153 double Ub, Uc, pi_bc,
beta;03154 Ub = GetUParam
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#a4dd261dbea68ff31a17a777e3a9efc8f>(b);03155
Uc = GetUParam
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#a4dd261dbea68ff31a17a777e3a9efc8f>(c);03156
03157 if (((GetMltb
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#a8d8291470b39dfecb4c66362b5e302c4>(type_b)
== 2) && (GetMltb
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#a8d8291470b39dfecb4c66362b5e302c4>(type_c)
== 2)) && a->GetBond
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBAtom.html#a1383e1d49338b8ee6784b8b9ef889ba4>(b)->IsDouble
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBBond.html#a51a42be9b514d0250330eb4204276d35>())03158
pi_bc = 1.0;03159 else03160 pi_bc =
0.4;03161 03162 beta = 6.0;03163 torsioncalc.v1
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBFFTorsionCalculationMMFF94.html#a56e54b9521cb38b2eaec90d6530ca46b>
= 0.0;03164 torsioncalc.v2
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBFFTorsionCalculationMMFF94.html#af5a97920571660315ee3a8bbbd8c90a0>
= beta * pi_bc * sqrt(Ub * Uc);03165 torsioncalc.v3
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBFFTorsionCalculationMMFF94.html#a2cf47c38afaedf54148e8ff0eae629f8>
= 0.0;03166 found_rule = true;03167 }03168 03169
// rule (d) page 63203170 if (!found_rule)03171
if (((GetCrd <http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#a7c08f7eff3b784428708f49582334a5c>(type_b)
== 4) && (GetCrd
<http://fossies.org/dox/openbabel-2.3.1/classOpenBabel_1_1OBForceFieldMMFF94.html#a7c08f7eff3b784428708f49582334a5c>(type_c)
== 4))) {03172 double Vb, Vc;03173
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
Tim Vandermeersch
2012-05-19 15:29:03 UTC
Permalink
Hi,

This is obviously a bug, I'll try to correct this in the following
week unless you beat me to it.

Tim
Post by Robert Hanson
OK, I'm stumped. How does one get to Rule d? Does anyone know if this code
was ever tested?
03131 if (b->GetBond(c)->IsAromatic()) {
03132 double Ub, Uc, pi_bc, beta;
03133 Ub = GetUParam(b);
03134 Uc = GetUParam(c);
03135
03136 if (!HasPilpSet(type_b) && !HasPilpSet(type_c))
03137 pi_bc = 0.5;
03138 else
03139 pi_bc = 0.3;
03140
03141 if (((GetVal(type_b) == 3) && (GetVal(type_c) == 4)) ||
03142 ((GetVal(type_b) == 4) && (GetVal(type_c) == 3)))
03143 beta = 3.0;
03144 else
03145 beta = 6.0;
03146
03147 torsioncalc.v1 = 0.0;
03148 torsioncalc.v2 = beta * pi_bc * sqrt(Ub * Uc);
03149 torsioncalc.v3 = 0.0;
03150 found_rule = true;
03151 } else {
03152 // rule (c) page 631
03153 double Ub, Uc, pi_bc, beta;
03154 Ub = GetUParam(b);
03155 Uc = GetUParam(c);
03156
03157 if (((GetMltb(type_b) == 2) && (GetMltb(type_c) == 2)) &&
a->GetBond(b)->IsDouble())
03158 pi_bc = 1.0;
03159 else
03160 pi_bc = 0.4;
03161
03162 beta = 6.0;
03163 torsioncalc.v1 = 0.0;
03164 torsioncalc.v2 = beta * pi_bc * sqrt(Ub * Uc);
03165 torsioncalc.v3 = 0.0;
03166 found_rule = true;
03167 }
03168
03169 // rule (d) page 632
03170 if (!found_rule)
03171 if (((GetCrd(type_b) == 4) && (GetCrd(type_c) == 4))) {
03172 double Vb, Vc;
03173
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Blueobelisk-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/blueobelisk-discuss
Robert Hanson
2012-05-19 15:40:12 UTC
Permalink
Hi, Tim, what are you up to these days?

Please take a look at the code I just checked in for Jmol --
org.jmol.minimize.forcefieldsForceFieldMMFF.java

http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol/src/org/jmol/minimize/forcefield/ForceFieldMMFF.java?view=markup

private Integer applyEmpiricalRules(MinObject o, double[] ddata, int
ktype)

I think I simplified that logic considerably. Also, I would appreciate it
if you would take a look at

private static double getRuleBondLength(MinAtom a, MinAtom b, int boAB,
boolean isAromatic)

Seems odd, and there are so few examples that I can't be sure what the
issue is. It validates, but...

Bob

On Sat, May 19, 2012 at 10:29 AM, Tim Vandermeersch <
Post by Tim Vandermeersch
Hi,
This is obviously a bug, I'll try to correct this in the following
week unless you beat me to it.
Tim
Post by Robert Hanson
OK, I'm stumped. How does one get to Rule d? Does anyone know if this
code
Post by Robert Hanson
was ever tested?
03131 if (b->GetBond(c)->IsAromatic()) {
03132 double Ub, Uc, pi_bc, beta;
03133 Ub = GetUParam(b);
03134 Uc = GetUParam(c);
03135
03136 if (!HasPilpSet(type_b) && !HasPilpSet(type_c))
03137 pi_bc = 0.5;
03138 else
03139 pi_bc = 0.3;
03140
03141 if (((GetVal(type_b) == 3) && (GetVal(type_c) == 4)) ||
03142 ((GetVal(type_b) == 4) && (GetVal(type_c) == 3)))
03143 beta = 3.0;
03144 else
03145 beta = 6.0;
03146
03147 torsioncalc.v1 = 0.0;
03148 torsioncalc.v2 = beta * pi_bc * sqrt(Ub * Uc);
03149 torsioncalc.v3 = 0.0;
03150 found_rule = true;
03151 } else {
03152 // rule (c) page 631
03153 double Ub, Uc, pi_bc, beta;
03154 Ub = GetUParam(b);
03155 Uc = GetUParam(c);
03156
03157 if (((GetMltb(type_b) == 2) && (GetMltb(type_c) == 2)) &&
a->GetBond(b)->IsDouble())
03158 pi_bc = 1.0;
03159 else
03160 pi_bc = 0.4;
03161
03162 beta = 6.0;
03163 torsioncalc.v1 = 0.0;
03164 torsioncalc.v2 = beta * pi_bc * sqrt(Ub * Uc);
03165 torsioncalc.v3 = 0.0;
03166 found_rule = true;
03167 }
03168
03169 // rule (d) page 632
03170 if (!found_rule)
03171 if (((GetCrd(type_b) == 4) && (GetCrd(type_c) == 4))) {
03172 double Vb, Vc;
03173
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Post by Robert Hanson
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Blueobelisk-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/blueobelisk-discuss
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
Loading...