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:
Command line - The command
specified in the shell variable can be a very long command, with
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
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 -
real convenience for the user, because the person who wrote each
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
sequence file formats.
insave/outsave - or not? -
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
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
menu item must remember to delete these temporary files as part of the
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
system default shell (usually bash
shell) to execute commands. Therefore, your shell command must comply
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.