Tasks for Automation

What are some tasks you’d like to be able to script or automate - either in Avogadro (e.g., a script window) - or by Avogadro (i.e., a script that launches and then runs Avogadro)

For example:

  • Load a molecule, set some rendering, and rotate the molecular around while recording a GIF
  • Load a molecule and save a screenshot (e.g., to generate a bunch of images for different molecules)
  • Animate a dynamics simulation
  • Visualize vibrations
  • Generate molecular orbitals
1 Like

The answer depends on how Avogadro positions itself relative to JMol. Are you intending to compete with or supplement JMol?

Probably more “supplement” but probably some of both.

I like Jmol / JSmol … and Bob and I talk off-and-on. I also use Pymol … have used VMD in the past, etc.

All of these are tools - and as such will have different specializations and uses.

For the sake of discussion, let’s say “tasks you might want Avogadro to do instead of Jmol.” (Maybe @Thomas has a different take.)

There is a place for Avogadro, and one for Jmol; there is both some overlap of what the programs and complementary character in what the programs address. For me, one forte of Avogadro is the interface to multiple quantum mechanical computations with many different programs where Jmol provides only one GUI (Gaussian).

Thus, in terms of “automate the boring stuff with Avogadro” (the credit for the seminal line belongs to Al Sweigart) and though I’m not in the business of generating large libraries (like Louis Reymond group/GDB), or screening (like Anatole v Lilienfeld’s chemspacelab) I speculate it would be a nice addition if one could save a pattern for a typical job as a template, e.g., search for equilibrium geometry of molecule X in water with MOPAC at PM7 level of theory.

Currently, one has to click through the options each time from scratch (ab initio) when a new molecule of potential interest crosses the mind. Or to define once a bash script to use OpenBabel to write the input file for e.g., Gaussian with the special parameters set.

With the improvement for Avogadro suggested one could be to either a) load such a molecule into Avogadro, and then invoke a user-defined short-cut (like a chord of Ctrl + Alt + O) to write again such an input file for such an optimization by single click applying this template. Or, b) that one can indicate a folder with molecules of interest; then, by call of a short cut Avogadro would generate for each structure in this set the corresponding input file, ready for submission to the computer lab.

That sounds like you want a button for “Save Template…” instead of “Save Input…”

I’ve talked about this a bit with the developers of pnictogen for example. And yes, you can often use Open Babel in this fashion.

Yes, this would be one example of the automation features.

1 Like

This makes me think of another possible automation. Say you have a _trj.xyz file (just multiple geometries in one file). You can currently open it with Avo2 and it’ll parse it as an animation. It’d be cool for Avo to be able to create an input for each frame of this animation (keywords are the same, only geometry differs) each in a separate folder.

Yes, like following a reaction coordinate. Sadly, I didn’t bookmarked on chemistry.se a more fancier one than for a simple substitution reaction


(image credit to Ivan Neretin in reply to What happens to a molecule while it is reacting? on chemistry.stackexchange.com)

but I get the idea. It goes beyond the simpler “structure fly-around” as in


(image credit to Karsten Theis replying to How can all amino acids point outwards from an alpha helix, if peptides are mostly trans? on chemistry.stackexchange.com).

It’s been a long time, but I can tell you my primary VMD workflow that was reasonably automated. I often wanted high-quality (raytraced) renders of MOs or similar on top of a structure.

  • cd to directory with cube data
  • run a Python script to generate all the Tcl for VMD to
    • define the molecule and surface styles based on my preference,
    • sequentially load each cube file, set the style, then render the scene with Tachyon;
    • it would also generate a shell script for converting each TGA file to PNG, and an HTML file acting as a contact sheet for looking over.
  • run VMD in text-only mode with the base XYZ file as input and the autogenerated script as the commands to execute

I think it was also possible to have a workflow where the orientation could be manually set in the GUI one-by-one if I didn’t know the optimal camera setting to put in the Tcl.