From: Rolf H. <rh...@fl...> - 2008-10-16 14:15:28
|
Zeyar Aung wrote: > Hi All, > > What is the Jmol script command to unload a molecule that is currently in display? > The command is "zap". But this is automatically done if you load a new structure with 'load "filename"'. Only if you use the "APPEND" keyword within the load command the file is loaded additionally and no 'zap' is done. > And what is the script command to quit Jmol? > There is no script command to quit Jmol (as far as I know). For batch processing purposes like you describe it below there is the command-line switch "-x" which will make Jmol exit automatically after the script (provided after the command-line switch "-s") is finished. > I have looked into Jmol documentation (http://chemapps.stolaf.edu/jmol/docs/ <http://chemapps.stolaf.edu/jmol/docs/> ) but could not find the answers. > The documentation on command-line switches available here (http://jmol.sourceforge.net/docs/JmolUserGuide/ch02.html) is unfortunately not up-to-date. It might be a good idea to include the command-line options also into the Jmol scripting documentation because they are relevant for batch scripting and would therefore also fit in there. You can get an overview on the current command-line options by starting the application with the "-h"/"--help" switch: java -jar Jmol.jar -h ======= Help Output =============== usage: Jmol -o,--noconsole no console -- all output to sysout -q,--quality JPG image quality (1-100; default 75) or PNG image compression (0-9; default 2, maximum compression 9) -g,--geometry window width x height, e.g. -g500x500 -x,--exit exit after script (implicit with -n) -D <property=value> supported options are given below -b,--backgroundtransparent transparent background -c,--check check script syntax only -h,--help give this help page -i,--silent silent startup operation -l,--list list commands during script execution -m,--menu menu file to use -n,--nodisplay no display (and also exit when done) -s,--script script file to execute -t,--threaded independent commmand thread -w,--write CLIP or GIF|JPG|JPG64|PNG|PPM:filename For example: Jmol -ions myscript.spt -w JPEG:myfile.jpg > output.txt ======== End of help output (not shown completely here) ======== > What I am trying to do is to write a script file to load a protein, do some visual modifications, save it as an image file, unload it, and the load another protein, and so on. I have hundreds of protein to be processed in this way. After processing them all, I would like to quit Jmol automatically. > I am doing something similar to what you describe for all PDB entries (asymmetric and biological units). This means generating about 100,000 images automatically with Jmol. My first approach was also to generate a single script that contains load structure and write image commands for all entries (or a couple of thousands for parallel processing in a multiprocessor system). But this has several disadvantages: 1) It takes a very long time until processing of the script starts. With several thousands line of Jmol script it took about an hour (as far as I remember). It seems like Jmol is first parsing the whole script (unexpectedly slowly). So if anything goes wrong it will take quite a while until you can notice it. 2) If there occurs an error somewhere within the script, the rest of the script is not executed. So if you are unlucky and there is a problem with file number 10 then you don't get images for the remaining 90 files in your list. 3) It is more difficult to check if everything was generated properly. Therefore I switched to a different approach: starting Jmol for each file individually. This has several advantages: 1) Processing starts immediately. 2) If there is a problem with file number 10 you will have 99 images in the end (instead of 9 with the other method). And you just have to handle the one problematic case. 3) It is much easier to check for processing errors. In my case there ocurred sometimes non-reproducible errors in generating the image. This means that there were no problems with the same PDB entry in a different run or doing the same manually. So now I immediately check if there was generated an image and if it looks right (by comparing it with an empty image of the same size, because the main error was that the generated image was empty). If not I redo the same up to 3 times. This reduced the failure rate considerably. I would also recommend to use the "-o" switch. This will enable you to capture all error mesages and also other messages for error checking or capturing information printed by the script. If there are further questions, don't hesitate to ask them. Regards, Rolf |