BIRCH
BIRCH - GDEmenus Hints and Tips


Background execution - Most of the time, it is best to run commands in the background by appending the Unix 'ampersand' (&) character to the command. Background execution immediately frees up the GDE window for other jobs. Important: see "insave/outsave" below.

Command line - The command specified in itemmethod can be a very long command, with separate steps. In many, or even most cases, it makes sense to write a script that takes care of most of the intricacies of running your program. That way, the only thing the itemmethod command is doing is passing parameters to the script, and maybe displaying the output.

Comments - Use comments! (#) Explain why you did what you did. Comments can be inserted anywhere in the item file. You can also comment out lines for testing, or for obsolete sections.

External environment variables - In addition to parameters in the item file, any environment variable in the user's environment may also be used in the command line.

File format conversion - GDE is real convenient for the user, because the person who wrote each GDE menu item has taken care of the headache of converting file formats. sed and tr are the two most useful Unix commands for simple conversion, and for working around errors in how some programs produce file formats. Most GDE menus items call readseq to convert between different sequence file formats.

Note that the GenBank format files produced by GDE do NOT strictly comply with the official NCBI standard!

Help files - All help files must be accessed through the $GDE_HELP_DIR. If you need to specify a path to files that are not part of the main BIRCH distribution, you can use the 'root' link,
which resides in all GDE help directories. This points to the root of the directory tree, '/'.
So, for example, to get your GDE item to display the help file found in:

/export/data/programs/emboss/share/EMBOSS/doc/programs/html/prettyplot.html

Add the following lines to the .item file:

itemhelp:root/export/data/programs/emboss/share/EMBOSS/doc/programs/html/prettyplot.html
itemopen:gde_help_viewer.csh

insave/outsave - or not? - GDE will automatically delete all input and output files when the command has been executed. Although convenient, there are some drawbacks. If the command is run in the background, GDE would delete the files as soon as the command has been launched, not when the command is completed. This can cause a failure of files to be read or written to completion, which can be maddening to track down. 

You can inactivate the deletion of input or output files by including insave: or outsave in your GDE menu item. However, if you do that, your menu item must remember to delete these temporary files as part of the command itself.

nice - If your command uses a lot of CPU time, or if there is a significant chance of  bad input causing an endless loop (eg. an interactive program keeps prompting for a response) always run the command at a nice level of 4 or greater.

The shell - GDE uses the BOURNE shell to execute commands. Therefore, your itemmethod must comply with the syntactic quirks of  the BOURNE shell.





Please send suggestions of comments regarding this page to bfristen@shaw.ca