MarvinSketch XYZ file - how to define 0 origin ?

User 4282a5e392

25-09-2011 16:34:02

Dear ChemAxon users


I am trying to get Cartesian coordinates for atoms of a long-chain branched alkane using MarvinSketch in the following way:


- I draw the molecule in 2D first


- then clean 3D


- then save the resulting structure in XYZ format


In the XYZ file I get, the first carbon has non-zero coordinates.


Is it possible to define the first carbon atom at 0 origin?


Thank you very much in advance.


 

ChemAxon 8b644e6bf4

27-09-2011 10:47:05

Hi,


 


You can import, translate and then export the structure from API. However since the xyz format is quite simple a bash script can be easily constructed to translate the structure.


The attached script (which can be executed under linux or using cygwin under windows) expects the name of an .xyz file as an argument and writes the translated file to the std out.


Usage:


$ ./zeroc.sh file.xyz > file-translated.xyz

Regards,


Gabor

User 4282a5e392

27-09-2011 15:17:22

Many thanks!

ChemAxon 25dcd765a3

27-09-2011 20:07:29

If your molecule is not in xyz format, here is a little program (TranslateOrigin.java) to do the translation from any input format.


Please note that output is going to be in sdf format.