Hi :)
I've the following exception thrown whyle calculating the descriptor
Ionization Potential:
Calculating descriptor Ionization Potential
java.lang.ArrayIndexOutOfBoundsException: 25
at
org.openscience.cdk.charges.GasteigerPEPEPartialCharges.assignGasteigerPiPartialCharges(GasteigerPEPEPartialCharges.java:154)
at
org.openscience.cdk.tools.IonizationPotentialTool.getQSARs(IonizationPotentialTool.java:258)
at
org.openscience.cdk.tools.IonizationPotentialTool.predictIP(IonizationPotentialTool.java:82)
at
org.openscience.cdk.qsar.descriptors.molecular.IPMolecularLearningDescriptor.calculatePlus(IPMolecularLearningDescriptor.java:181)
at
org.openscience.cdk.qsar.descriptors.molecular.IPMolecularLearningDescriptor.calculate(IPMolecularLearningDescriptor.java:159)
at
sa2.modules.cdk.descriptors.CdkDescCalculator.calculate(CdkDescCalculator.java:120)
(...)
I simply use the descriptorInstance.calculate(molecule) to calculate
this descriptor, and I use the following preprocessing step on each of
my molecules loaded from a SDF file (I set addH to true each time):
public IMolecule cleanMolecule(IMolecule m, boolean addH)
throws Exception
{
// Keep the largest fragment
if (!ConnectivityChecker.isConnected(m)) {
IMoleculeSet fragments =
ConnectivityChecker.partitionIntoMolecules(m);
int maxID = 0 ; int maxVal = -1 ;
for(int i = 0 ; i < fragments.getMoleculeCount() ; i++) {
if(fragments.getMolecule(i).getAtomCount() > maxVal) {
maxID = i ;
}
}
m = fragments.getMolecule(maxID) ;
}
// Configure the molecule
CDKAtomTypeMatcher matcher =
CDKAtomTypeMatcher.getInstance(m.getBuilder());
for (IAtom atom : m.atoms()) {
if (!(atom instanceof IPseudoAtom)) {
IAtomType matched = matcher.findMatchingAtomType(m, atom);
if (matched != null) {
AtomTypeManipulator.configure(atom, matched);
if(addH) {
CDKHydrogenAdder hAdder =
CDKHydrogenAdder.getInstance(m.getBuilder());
hAdder.addImplicitHydrogens(m, atom);
}
}
else {
// Here the CDK doesn't know the type of atom...
Hmm... Find something to do :)
}
}
}
// Detect aromaticity
CDKHueckelAromaticityDetector.detectAromaticity(m);
return m ;
}
Is it a bug? Or am I doing something wrong? Note that the exception
occured for all my compounds, with a different value for the index
associated with the exception.
Thanks in advance :)
Vincent
--
Vincent Le Guilloux
Phd Student - ICOA - UMR CNRS 6005
Div. of chemoinformatic and molecular modeling.
University of Orléans
Phone: ++33 2 38 49 45 77
Fax : ++33 2 38 41 72 81
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user