[go: up one dir, main page]

Menu

#1288 AtomTypeManipulator error is not sufficiently descriptive (IAtomType was null)

cdk-1.4.x
open
nobody
1
2016-08-10
2013-01-06
No

AtomTypeManipulator:62 throws IllegalArgumentException("The IAtomType was null.").
Potentially AtomContainerManipulator is not sufficient.
A test file with 256 molecules from ChEMBL where this issue occurs is attached.

Any way to clarify why? Which atoms are not assigned? Anything helping with drilling down?

1 Attachments

Discussion

  • John May

    John May - 2013-01-06

    Hi Joerg,

    How are you using the code? That error makes sense if you're calling it directly.

    :::java
    IAtom atom = ...; // non-null instance
    AtomTypeManipulator.configure(atom, null); // exception -> atom type was null
    

    The AtomTypeManipulator is probably a bit low level for usual atom typing try the AtomContainerMaipulator. The following works without error for me on the test molecules from ChEMBL.

    Note: IteratingSDFReader = IteratingMDLReader on 1.4.x

    :::java
    
    IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance();
    String path = "/Users/johnmay/Downloads/cdk_issues.sdf";
    
    IteratingSDFReader sdf = new IteratingSDFReader(new FileReader(path),
                                                    builder,
                                                    true); 
    while (sdf.hasNext()) {
        IAtomContainer container = sdf.next();
        AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(container);
    }
    
     
  • Egon Willighagen

    Joerg, you can discover that in your code with a try/catch... just see what the value of the passed atom was?