From: Noel O'B. <bao...@gm...> - 2007-11-30 10:08:26
|
On 29/11/2007, Jean-Didier Mar=E9chal <jea...@ua...> wrote: > > Glad to hear. Let us know if you have any problems; also, we are > > interested to know what you are using cclib for... > > I have different projects I hope cclib to help me with (Well, once I'll > have understood how to use it (:-)). To get use to your module, the > first thing I want to do is to generate gaussian inputs extracting the > optimized geometry from a previous gaussian output. I know that sounds > ruin but truth is that I work on systems with a lot of conformations and > which size oblige me to optimize in gas phase. So, I want to perform > post calculations separately afterward. Scripting the generation of this > inputs will be of great help for me. > > Thanks a lot, > > JD Although cclib can help you with this, our functionality overlaps a little bit with another Python library, OpenBabel. Here is an example of reading the output file with cclib, and creating a Gaussian input file with OpenBabel: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D import pybel from cclib.parser import ccopen from cclib.bridge import makeopenbabel t =3D ccopen("dvb_gopt.out") d =3D t.parse() obmol =3D makeopenbabel(d.atomcoords[-1], d.atomnos, d.charge, d.mult) mol =3D pybel.Molecule(obmol) print mol.write("gau") =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D However, OpenBabel can also read Gaussian output files, so in this case it's easier just to do: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D import pybel mol =3D pybel.readfile("g03", "dvb_gopt.out").next() print mol.write("gau") =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D cclib has the advantage of giving you access to lots of other information, it can read output files from more computational chemistry packages, and it provides implementations of several computational chemistry algorithms. OpenBabel can read and write a very large number of molecular file formats, and provides access to several algorithms for manipulating chemical structures. It's easy to interconvert data from one to the other, so you can easily use them both. Noel |