Home » DataWarrior » Cheminformatics » ChemAxon calculated properties (How do I calc chemaxon properties)
Re: ChemAxon calculated properties [message #29 is a reply to message #28] Thu, 04 December 2014 22:55 Go to previous messageGo to previous message
thomas is currently offline  thomas
Messages: 463
Registered: June 2014
Senior Member
DataWarrior is looking for a file name 'capka.jar' in the same directory, where datawarrior.jar is located.
If it finds this file and if it contains the needed Java classes, it will work.

If you want to do that, there are two options:

The easy one: Unpack all ChemAxon jar files into one directory and zip them again into one
big jar that you rename to 'capka.jar'. This should work, but the disadvantage is that
the file will be more than 100Mbyte in size.

The difficult one: Unpack all ChemAxon jar files into one directory, remove the file that
are not needed and zip the rest into one jar that you rename to 'capka.jar'. This works and
results in a file that is less than 1Mbyte. The problem: Locating the unneeded files is
rather cumbersome. I tried with two obfuscators to track dependencies and purge the rest.
This didn't work for various reasons. The approach that worked, is the following:
I wrote a java program that used the ChemAxon API to create a ChemAxon Molecule object
from a molfile, to predict the pKa values, then checked the values and wrote an empty
text file 'OK.txt' to indicate that the ChemAxon API worked correctly. Then, I set the
Java classpath to access the ChemAxon API from the unpacked folder with all ChemAxon class
and data files. Then I used a linux script to stepwise delete one file after another from
the ChemAxon directory with checking whether OK.txt was written. If not I undeleted the
evidently necessary file and went to the next. That gave me the core set of needed files.
The I noticed that different molfile/molecule features required additional classes to work,
which I added manually when the ClassNotFoundException was raised. Evidently, ChemAxon
software uses heavily Class.forName() calls, whenever a molfile contains a specific feature.
If you are brave enough to go through this, I can send you the Linux scripts I used to create
the file.

If you are running Linux or OSX, you have a third option. Put all the ChemAxon jar files in
the directory that contains datawarrior.jar and add all ChemAxon jar file names to the class
path. On linux this is in the file 'datawarrior'. On OSX it is in Info.plist. You can access
that file if you click right mouse on the DataWarrior icon, select 'Show Package Content'
and open the 'Contents' folder.

I am sorry for the cumbersome stuff, but for obvious reasons I cannot send you a copy of the
capka.jar file.

Good luck,

Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Compound properties
Next Topic: Fuzzy Score
Goto Forum:

Current Time: Thu Oct 21 14:13:43 CEST 2021

Total time taken to generate the page: 0.01922 seconds