5
$\begingroup$

I am looking for a free and open-source software written or wrapped for Python that would simply allow me to generate bunch of figures (in eps, jpg, or pdf format) from a set of xyz files, e.g. water clusters of different sizes.

I am aware of PyMol, but it seems a bit complicated to use (it has its own script language) for such a simple task and I guess it does not recognize xyz files, so I'd first need to convert to pdb format, etc.

$\endgroup$
11
  • 2
    $\begingroup$ Just take a look here. There are a lot of relevant Python for Chemists. Or you could just consider to use LaTeX/Tikz for the job? $\endgroup$ Sep 18, 2015 at 21:32
  • 1
    $\begingroup$ How do your XYZ-file looks like anyway? And where do you get it from? If you have an example of how the file looks like and what the result should look like, maybe I can help you better (in Python or in Tikz). Maybe this is what you looked for? $\endgroup$ Sep 18, 2015 at 21:34
  • $\begingroup$ Thanks for the tips, I updated the question with a link to wiki for xyz format. I think rdKit is good for 2D images only, but I will check more. $\endgroup$
    – Armut
    Sep 18, 2015 at 21:58
  • 1
    $\begingroup$ pymolwiki.org/index.php/Get_Coordinates_II $\endgroup$
    – Mithoron
    Sep 18, 2015 at 23:15
  • 1
    $\begingroup$ There's GaussSum, which I believe is written in python gausssum.sourceforge.net $\endgroup$
    – Jan Jensen
    Sep 20, 2015 at 13:12

1 Answer 1

5
$\begingroup$

In case you really need it has to be written in python probably you want to try Atomic Simulation Environment (ASE). It has a GUI that "allows users to visualize, manipulate, and render molecular systems and atoms objects".

Let me add (even when you are asking explicitly for codes written in Python), just in case that what you need is to create images from .xyz files (regardless of the language), Jmol probably will suits you, as it reads .xyz files straightforwardly. For saving your image once it is loaded, you will need to open a console in Jmol and type:

write image 1200 720 jpg 90 "filename.jpg"

where:

  • 1200 and 720 are the width and height of your image (choose the ones you want to)

  • 90 is the quality of the compression

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.