Hi all,

  This may interest anyone trying to get jCompoundMapper to work with a newer 
version of CDK.

Because of the recent J. Cheminf. paper "Effectiveness of molecular 
fingerprints for exploring the chemical space of natural products" at 
https://jcheminf.biomedcentral.com/articles/10.1186/s13321-024-00830-3 I 
decided to look more into the jCompoundMapper package, available at 
https://jcompoundmapper.sourceforge.net and released in 2012.

There are two jar files:

   jCMapperCLI.jar - includes the jCompoundMapper package, an old version of 
CDK, and
     the other components needed to make a standalone executable

   jCMapperLibOnly.jar - only the jCompoundMapper package

Neither are compatible with modern CDK. Doing so (through the JPype Python/Java 
adapter) gives me the exception:

*** java.lang.java.lang.ClassCastException: java.lang.ClassCastException: class 
org.openscience.cdk.AtomContainer2$BaseAtomRef cannot be cast to class 
org.openscience.cdk.Atom (org.openscience.cdk.AtomContainer2$BaseAtomRef and 
org.openscience.cdk.Atom are in unnamed module of loader 'app')

In a private exchange with John he pointed out that CDK has a backwards 
compatibility option, by including the following when starting the JVM:

   -DCdkUseLegacyAtomContainer=t

With this I was able to get cdk-2.9 and jCMapper working together.

Though do note, very few of the other CDK fingerprint types work with the 
legacy atom container - this is very much a one-or-the-other solution.

Coming from the Python world, where most Python releases come with an ABI 
change, I am very impressed that a 12 year old package still works, and can be 
combined with a <1 year old cdk release.

Best regards,

                                        Andrew
                                        da...@dalkescientific.com



_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to