Molecule formats changes between 5.6 and 5.12

User 7a902f260f

26-04-2013 21:26:31

 


Hi all,


Was there a change in the molecule export format for SMARTS between 5.6 and 5.12?  After I upgraded, the following code is giving me different output values between 5.6 and 5.12:


final Molecule molecule = MolImporter.importMol("CC(C)[C@@]12C[C@@H]1[C@@H](C)C(=O)C2");
System.out.println(molecule.toFormat("smarts"));

For 5.12, I tried the non-deprecated exportToFormat() call but that is still giving me a different output as the one from 5.6:


System.out.println(MolExporter.exportToFormat(molecule, "smarts"));  

For 5.6, the output produced is this:


[#6]C([#6])[C@@]12C[C@@H]1[C@@H]([#6])C(=O)C2


While for 5.12:


[#6]-[#6](-[#6])[C@@]12[#6]-[#6@@H]1-[#6@@H](-[#6])-[#6](=O)-[#6]2


 


This is obviously causing all  our unit tests to break... and on a related subject, the following code is now throwing an exception for 5.12 when it worked fine for 5.6


final Molecule molecule = MolImporter.importMol("CC(C)[C@@]12C[C@@H]1[C@@H](C)C(=O)C2");
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
final MolExporter molExporter = new MolExporter(outputStream, String.format("jpeg:w%d,h%d,#%s", 200, 100, "FFFFFF"), null);

molExporter.write(molecule);

Any ideas on the cause for both of the above?

ChemAxon 25dcd765a3

29-04-2013 09:46:08

 


Was there a change in the molecule export format for SMARTS between 5.6 and 5.12?

Yes, our smarts export was too implicit and we wanted to avoid ambiguity. So the ambiguous bonds are now exported explicitly:


[#6]C([#6])[C@@]12C[C@@H]1[C@@H]([#6])C(=O)C2


is exported as :


[#6]-[#6](-[#6])[C@@]12[#6]-[#6@@H]1-[#6@@H](-[#6])-[#6](=O)-[#6]2


As you can se the single bonds are exported explicitly.


This is obviously causing all  our unit tests to break...

If you compare SMARTS strings explicitly then the junit test will fail, however the chemical molecule object remained the same.


 the following code is now throwing an exception for 5.12 when it worked fine for 5.6

If so, than you may have found a bug, but I cannot reproduce this problem.


Here is my code which works well for me in 5.12:


	final Molecule molecule = MolImporter.importMol("CC(C)[C@@]12C[C@@H]1[C@@H](C)C(=O)C2");
String smarts = molecule.toFormat("smarts");
System.out.println(smarts);
final Molecule molecule2 = MolImporter.importMol(smarts);
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
final MolExporter molExporter = new MolExporter(outputStream, String.format("jpeg:w%d,h%d,#%s", 200, 100, "FFFFFF"), null);
molExporter.write(molecule);
molExporter.write(molecule2);
molExporter.close();

User 7a902f260f

29-04-2013 18:03:54

Hi volfi,


Thanks for the response.  Is there an option to display the old smarts format?


As for the MolExporter problem, it looks like the problem roots from the fact that I have the woodstox library in my application, and JChem is picking it up.  I guess JChem is incompatible with that XML processing library...

User 7a902f260f

29-04-2013 20:17:19

Hi volfi,


Just to clarify more on the MolExporter issue... it seems like adding woodstox (a third party xml parser library) in the classpath is causing JChem 5.12 to fail and throw exceptions.  These exceptions did not occur on JChem 5.6.  As woodstox is a common library used by many other third party libraries (ex. webservice libraries), I am thinking this is a bug?



Here are the steps to recreate:

1. Download JChem 5.12 (http://www.chemaxon.com/download/jchem/jchem-for-java/ - Platform Independent)

2. Download woodstox-core-asl-4.2.0.jar: http://wiki.fasterxml.com/WoodstoxDownload

3. Download stax2-api-3.1.1.jar: http://wiki.fasterxml.com/WoodstoxDownload

4. Add both jars in your classpath

5. Run msketch (make sure it picks up the jars in the classpath you just added)

6. Notice the a MolExporter/XML exception stacktrace appears in the console.

7. Sketch something in msketch, copy, then paste

8. Notice a similar MolExporter/XML exception stacktrace in the console.


 

ChemAxon 25dcd765a3

30-04-2013 07:13:25

 


 Is there an option to display the old smarts format?

No, we try to avoid this ambiguity as it needs guessing at the import side.


I could reproduce the issue. It is definitely a bug. We fix this asap.



User 7a902f260f

30-04-2013 21:25:41

Glad to hear that you can reproduced the problem.  As for the fix, is there a rough timeframe as to when it will be available and will a patch be made available? 

ChemAxon 25dcd765a3

02-05-2013 07:23:00

Part one: we will start to fix it in the next week, so I guess it will be ready in few days. 


Part two: 6.0 beta version commit deadline is over, we cannot commit anything there it is already in testing phase so hopefully will come out in few weeks. So the soonest is 6.0.1 for which we don't have the planned  release date yet.


How urgent is it for you?

User 7a902f260f

02-05-2013 14:37:11

We were able to find a workaround by using Xerces instead of Woodstox.  The third party library that was dependent on woodstox seems to work fine with it (as far as we can tell).  With that said, it will be nice to have a patch if that was possible.


If the fix won't be available until 6.0.1, then we will just go with our workaround.  

ChemAxon 25dcd765a3

03-05-2013 07:01:11

OK I let you know if the fix is ready, and in which version will contain thi fix. Hopefully in the next week.

ChemAxon 712bc8fcf4

10-05-2013 09:09:33

Hi Arthur,


We fixed the problem and it will be available in Marvin 6.0.1, the release date is not known yet.


Regards,
Mate 

ChemAxon d26931946c

13-06-2013 11:14:31

Hi Arthur,


I would like to inform you that we're planning to release 6.0.1 containig this fix next week.


BRs,


Peter