CDX files written with surprising atom charge values.

User af3e34cbec

03-03-2013 00:24:26

Hi,

MarvinSketch exports CDX files with surprising atom charge values.

MarvinSketch 5.3.3 will write the value "6" for uncharged atoms. I would have expected a plain zero instead, or that the charge property would simply have been skipped for uncharged atoms. Can you confirm that you are willfully writing a value of charge "6" for uncharged atoms ?

MarvinSketch 5.11.5 seems to behave just like 5.3.3, but it additionally writes a non-standard 2-byte charge value for each of the uncharged atoms. This gave me an error when I tried to read the file with my own code. I assume that I can ignore these 2-byte (seemingly random ?!) "charge" values? Perhaps MarvinSketch 5.11.5 is actually writing the wrong property tag so these 2-byte values mean something else entirely ?

According to the ChemDraw CDX file format spec, atom charges should be signed INT8 values only - except that ChemDraw 8.0 accidentally wrote INT32 values.


http://www.cambridgesoft.com/services/documentation/sdk/chemdraw/cdx/properties/Atom_Charge.htm


(You may have to use Google's cache to get to the HTML page).


Kind regards


-- Jan Holst Jensen


 


I have attached two CDX files written by MarvinSketch 5.3.3 and 5.11.5 respectively.

ChemAxon d26931946c

04-03-2013 09:39:39

 


Dear Jan Holst, 


 


According to the cdx documentation the constant value for charge is 0x0421. 


The attached files contains this key for only one atom, a Nitrogen with +2 charge.


We are writing out "6" values for with the key 0x0437, which stands for "CIPStereochemistry Property" and means the stereo is Unspecified on that atom. 


Since 5.11.4 we are writing out the implicit Hydrogen count (0x042b, "NumHydrogens") as well, even if has the value "0".


I attach the dumps of the files, created with CambridgeSoft's HexDumper


 


I hope this information helps fixing the problems that you have.


Best regards,


 


Peter

User af3e34cbec

04-03-2013 17:36:22

Dear Peter,


Thank you for the dump. I see now that my failure to read the CDX files was due to an embarrasing code mistake at my end. Sorry for the noise, and thank you for your time.


Kind regards


-- Jan