This is still work in progress (January 2003).
The purpose of this work is to provide a means for dealing with files of chemical subtypes interactively with autoview within the pager and separately from the attachment menu. The idea is to take full advantage of these two distinct ways of "viewing" the attachment, which appear to be unique to mutt.
The autoview scripts should do two things:-
Mutt in conjunction with the mailcap file allows two different options in the attachment menu. The use of "test=RunningX" in the mailcap entry allows a choice of action depending whether XWindows is running or not. For many chemical types this choice is insufficient so we use a wrapper script to display a menu of more than two choices.
pdb files as attachments.
pdb files are one of the most extensively used subtypes of the chemical type. They can be "viewed" by many different applications such as Rasmol, xmol or more easily with the pluggin Chime that works for both Netscape and Internet Explorer. However Chime is not widely available for unix systems, in fact only for Silicon Graphics (and I believe that is now history!).
I now support pdb files in the autoview output by a script called pdb_handler. This script is just a bunch of echo commands that write out a message explaining about different types of pdb files. Note that:-
In the attachment menu, I currently point the mailcap entry to a bash script called view_pdb which has the menu items in the table below. Note that the first entry is the same as the pager action, as it will be for all attachment menu scripts making these useful where only one mailcap entry can be used. They are also useful for mailers where you only get one hit at the attachment. One such mailer is pine and here are some comparisions between mutt and pine for viewing chemical attachments.
| view_pdb bash script | ||
|---|---|---|
| Action required | Script used | Script details |
| Display general information and header of file |
pdb_handler | Bash script |
| Handle remotely on PC using Samba | remote_use | Bash script |
| Display molecule using Rasmol | /usr/users/qchem/bin/rasmol $1 | Rasmol |
| Display molecule using xmol | /usr/local/bin/xmol -readFormat pdb $1 | Xmol |
| Display molecule using netscape with chime plugin | /usr/local/bin/netscape -remote 'openFile($1)' or /usr/local/bin/netscape $1 depending whether netscape running | Chime |
Gaussian input files as attachments.
Gaussian input files normally have the extension "com", but it has become accepted that the correct extension in the mime.types file is "gau". There is some confusion whether the type/subtype is chemical/x-gaussian or chemical/x-gaussian-input. We will use the latter. These files can be "viewed" by xmol or Rasmol. In the pager, I use a simple script called gau_handler that gives some information and then prints the top 10 lines of the input file.
In the attachment menu we use a bash script called view_g94input to allow the choices in the table below.
| view_g94input bash script | ||
|---|---|---|
| Action required | Script used | Script details |
| List summary to screen as in pager | gau_handler | Bash script |
| List input file to screen | less | GNU utility |
| Submit input file to queue | sub_gau | Perl script |
| Handle remotely on PC using Samba | remote_use | Bash script |
| Display molecule using Rasmol | /usr/local/bin/rasmol $1 | Rasmol |
| Display molecule using xmol | /usr/local/bin/xmol -readFormat gaussin $1 | Xmol |
| Display molecule using netscape with chime plugin | /usr/local/bin/netscape -remote 'openFile($1)' or /usr/local/bin/netscape $1 depending whether netscape running | Chime |
The script called sub_gau copies the file to a designated work directory and submits the job for running in a NQS queue. The work directory and various queue parameters are set in the sub_gau script which is written in perl.
Gaussian output files as attachments.
Gaussian output files ("log files") can be quite long. They can be read by xmol to give an animation of the steps towards finding an optimised structure and perhaps other "viewers". In the pager, I use a perl script called gaussian_output that prints the title (of the first step, if a multi-step job), the number of lines, and the archive section (for all steps if a multi-step job).
In the attachment menu the mailcap entry is a bash script called view_g94output which offers a menu of the choices in the table below.
| view_g94output bash script | ||
|---|---|---|
| Action required | Script used | Script details |
| Get summary as in pager | gaussian_output | Perl script |
| Save output file | save_g94log | Perl script |
| List output file to screen | less | GNU utility |
| Convert optimisation output to xyz for xmol animations | g94opt2xyz.f followed by /usr/local/bin/xmol -readFormat xyz 'xyz file' |
Fortran |
| Convert frequency output to xyz for xmol animations | xvibs.c followed by /usr/local/bin/xmol -readFormat xyz 'xvibs file' |
Jan Labanowski's C program (1997 version) |
| Convert IRC output to xyz for xmol animations | g94irc2xyz.f followed by /usr/local/bin/xmol -readFormat xyz 'xyz file' |
Fortran |
| Display molecule using xmol | /usr/local/bin/xmol -readFormat gaussout $1 | Xmol |
The third option is a little more complex than the others. The Fortran program (I have this very strange notion that code for parsing Gaussian output should be written in Fortran!) creates a temporary xyz file:-
ln -s $1 link
/usr/local/bin/g94opt2xyz > /tmp/tt$$.xyz
which is then feed to xmol with:-
xmol -readFormat xyz /tmp/tt$$.xyz
"link" and the temporary file are then deleted. For some reason I could not get normal piping to work here.
The forth option is even more complex. This uses Jan Labanowski's improvement to the xvibs program, which takes a G94 output file from a frequency run as input and produces several xyz files (one for each vibration). The script generates a menu of these xyz files so you can select a particular vibration for viewing as a xmol animation.
Mopac input files as attachments.
Mopac input can be handled in a similar way to Gaussian input, but there are some differences that must be taken into account. Mopac input allows, as does Gaussian, the use of internal Z-matrix coordinates or cartesian coordinates. Internal coordinates can be in the Mopac form or the Gaussian form. The problem is that some applications may read only one of these forms or need different flags to read different forms of input.
Mopac input files normally have the extension "dat", but it has become accepted that the correct extension in the mime.types file is "mop". There is some confusion whether the type/subtype is chemical/x-mopac or chemical/x-mopac-input. We will use the latter. These files can be "viewed" by xmol or Rasmol. In the pager, I use a simple script called mop_handler that gives some information and then prints the top 12 lines of the input file.
In the attachment menu we use a bash script called view_mopinput to allow the choices in the table below.
| view_mopinput bash script | ||
|---|---|---|
| Action required | Script used | Script details |
| List summary to screen as in pager | mop_handler | Bash script |
| List input file to screen | less | GNU utility |
| Submit input file to queue | sub_mop_mime | Perl script |
| Handle remotely on PC using Samba | remote_use | Bash script |
| Display molecule using xmol - internal coordinates | /usr/local/bin/xmol -readFormat mopii $1 | Xmol |
| Display molecule using xmol - cartesian coordinates | /usr/local/bin/xmol -readFormat mopic $1 | Xmol |
| Display molecule using netscape with chime plugin | /usr/local/bin/netscape -remote 'openFile($1)' or /usr/local/bin/netscape $1 depending whether netscape running | Chime |
Note: It appears that xmol does not actually accept cartesian coordinates, but the mopic flag will do exactly what the mopii flag does - accept mopac style internal coordinates.
The netscape option is untested, but may work on SGI if Chime is installed.
Mopac output files as attachments.
This Mopac section is under construction.
Mopac output files can come in a confusingly large variety of forms and it is quite common for Mopac scripts to actually delete some of the output files that are generated. There have been several MIME subtypes suggested as illustrated by these entries from an example mailcap file:-
chemical/x-mopac-out; xmol -readFormat mopo %s
chemical/x-mopac-den; eyemopacview %s
chemical/x-mopac-esp; eyemopacesp %s
chemical/x-mopac-vib; eyemopacvib %s
None of these have had wide use or acceptability. We therefore use a generic script that can be set in the mailcap against any mopac subtype. It uses tests as appropriate for the file extensions in the attachment menu scripts. Currently we only support files with the *.out extension as chemical/x-mopac-out.
chemical/x-pdb; view_pdb %s
chemical/x-pdb; pdb_handler '%s' ; copiousoutput
chemical/x-gaussian-input; view_g94input %s
chemical/x-gaussian-input; gau_handler %s; copiousoutput
chemical/x-gaussian-log; view_g94output %s
chemical/x-gaussian-log; gaussian_output %s; copiousoutput
chemical/x-mopac-input; view_mopinput %s
chemical/x-mopac-input; mop_handler %s; copiousoutput
chemical/x-mopac-out; view_mopoutput %s
chemical/x-mopac-out; mopac_output %s; copiousoutput
The scripts that mutt uses in the attachment menu can also be used in the pine mailer.
Return to the "Chemistry Friendly Mutt and his mates" page.
Return to the Computational Chemistry Research Group page.