BIRCH BIRCH - BioLegato menus
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 bioLegato window for other jobs. Important: see "insave/outsave" below.

Command line - The command specified in the shell variable 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 - BioLegato is real convenience for the user, because the person who wrote each BioLegato 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 BioLegato menus items call readseq to convert between different sequence file formats.

insave/outsave - or not? - BioLegato 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, BioLegato 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 bioLegato 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 - BioLegato uses the  system default shell (usually bash shell) to execute commands. Therefore, your shell command must comply with the syntactic quirks of  the system shell. In a future version of BioLegato, the system shell will be replaced with a Java shell, called TurtleShell. Turtleshell implements a subset of the bash shell.


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