Greg-
Here is how I fixed the nickel and copper (found this later)
organomettalic compounds within 'atomtyper.cpp':
######### addAtomChargeFlags #####
case 28: // Ni
switch(totalValence){
case 2:
atomKey += "+2";
break;
default:
if(tolerateChargeMismatch) atomKey += "+2";
BOOST_LOG(rdErrorLog) << "UFFTYPER: Unrecognized charge
state for atom: "<< atom->getIdx() << std::endl;
}
break;
case 29: // Cu
switch(totalValence){
case 1:
atomKey += "+1";
break;
case 2:
atomKey += "+2";
break;
default:
if(tolerateChargeMismatch) atomKey += "+1";
BOOST_LOG(rdErrorLog) << "UFFTYPER: Unrecognized charge
state for atom: "<< atom->getIdx() << std::endl;
}
break;
#######################
######## getAtomLabel ########
case 28:
atomKey += '4';
if(atom->getHybridization()!=Atom::SP3D){
BOOST_LOG(rdWarningLog) << "UFFTYPER: Warning:
hybridization set to Square Planar for atom "<< atom->getIdx() <<
std::endl;
}
break;
case 29:
atomKey += '3';
if(atom->getHybridization()!=Atom::SP3){
BOOST_LOG(rdWarningLog) << "UFFTYPER: Warning:
hybridization set to Square Planar for atom "<< atom->getIdx() <<
std::endl;
}
break;
##########################
Now I have found a problem with lead tetraoxide (aka minium or Pb3O4)
http://www.emolecules.com/cgi-bin/more?vid=474486
The initial error was similar to the previous Ni and Cu problems but I
have not found a fix using the same solution strategy:
[15:46:23] UFFTYPER: Unrecognized atom type: Pb3+3 (0)
[15:46:23] UFFTYPER: Unrecognized charge state for atom: 2
[15:46:23] UFFTYPER: Unrecognized atom type: Pb3+3 (2)
[15:46:23] UFFTYPER: Unrecognized charge state for atom: 4
[15:46:23] UFFTYPER: Unrecognized atom type: Pb3+3 (4)
[15:46:23]
****
Pre-condition Violation
bad params pointer
Violation occurred on line 21 in file ForceField/UFF/BondStretch.cpp
Failed Expression: end1Params
****
If there isn't an easy fix, can you suggest a strategy for preventing
RDKit from terminating when encountering these hybridization errors
and just moving to the next molecule, while making a note of the
molecules name to be logged as an error?
For the Ni and Cu additions to AtomTyper.cpp, you told me to come up
with some test cases in $RDBASE/Code/GraphMol/ForceFieldHelpers/
testHelpers.cpp Do you want me to follow the examples in that file
and also submit a bug to sourceforge.net to connect the test case to?
Thanks again!
-Marshall
On Mar 23, 2009, at 11:50 PM, Greg Landrum wrote:
On Tue, Mar 24, 2009 at 7:35 AM, Marshall Levesque
<[email protected]> wrote:
Greg-
Thanks again for the quick replies.
I will try and take a stab at this, but I'm definitely not promising
anything.
Just to double check, your suggestion to take a look at
/Code/GraphMol/ForceFieldHelpers/UFF/AtomTyper.cpp is concerning the
'EmbedMolecule' function correct?
Indirectly. That function uses some UFF parameters to do things like
get bond-lengths.
-greg