Adding your own tool into BioExtract

A local tool is a program on your own computer. The tool itself is not uploaded to BioExtract Server. Rather, the BioExtract Server uses the information given about the tool to execute it on your own system. Once the tool has been added, it can be used like any of the other tools in the BioExtract Server and can even be included in workflows.

The tool must meet the following criteria:

If the tool meets the criteria above, the following information is required to add the tool:

Example

Suppose we have a fictional tool called "mutate", which takes a file containing one or more gene sequences as input, performs a handful of random mutations on the sequences, and writes the mutated sequences to an output file.

First, click the Tools tab, then select Add a New Tool from the menu that appears on the left. Select Add a Local Tool, then click New Local Tool. A new tool form opens in the right panel. Click the Edit link next to New Tool.

Once this information is entered, click the Save link near the top of the form.

Inputs

Data from the BioExtract Server is given to the local tool by using one or more input files, which are created on your computer when BioExtract Server runs the tool. The data sent to each input file can come from one of four sources, selected when the tool is used:

  1. The current data extract
  2. A previous tool's output
  3. An input file uploaded from your computer
  4. Text typed or pasted directly into a text box
Sources of input

Not all tools require input files, so you may not need to add one at all. Our example tool "mutate" requires a single input file containing a gene sequence. Let's go through the steps for adding it:

Outputs

The interface for defining output files is very similar to the one used to define input files. As with input files, output files are optional and need only be defined if you would like to use the output of the tool as input to other tools on BioExtract Server.

Physical Name, Logical Name, Description, File Name, and Include in Command Line behave exactly the same as they do for Input files.

Record Number Limit, Description File Name, and Modify Current Extract are not used for local tool output files and can be ignored.

Command Line Parameters/Arguments

Most tools have a set of options whose values are given by arguments on the command line. Specifying the input and output files for the program are just one example of such arguments. For our purposes here, the terms "argument" and "parameter" are identical.

The BioExtract Server uses the information given about each parameter to add an element in the completed tool's interface where the value for the parameter can be given. This is the interface shown for mutate's parameters:

Mutate Parameters

Before adding a Parameter, you must first add a Parameter Group. Multiple parameter groups are allowed and can be used to keep related parameters together. For example, a tool may have a set of parameters that affect the appearance of the tool's output. These parameters could be placed within a group called "Output Options", and will be displayed together in the menu used to run the tool from BioExtract Server.

Our example tool "mutate" has a set of basic mutation operations that can be performed on points (single nucleotides), codons, or both. The operations include insertion, deletion, duplication, etc. The severity level of the mutations is given by a number between 1 and 10. So, if we wanted to delete a few random codons in the input sequence, the command would be: mutate -i in_seq.txt -o out_seq.txt -codon deletions -s 2

If we wanted to generate severe mutations, we can ask mutate to delete random codons and insert random nucleotides, specifying a severity level of 9. mutate -i in_seq.txt -o out_seq.txt -codon deletions -point insertions -s 9

To add parameters, begin by clicking the Create New link next to "Parameter Groupings". Then, click Edit next to "New Grouping". Assign a name to this parameter grouping.

Mutate has only one group of parameters, all having to do with mutation operations, so the name "Mutation Options" fits well here.

Now, click Create New next to Parameters, then click the Edit link next to "New Parameter". Below is a description of each field required to define a parameter. After describing these fields in general, we will demonstrate how they were used to add parameters for the mutate tool.

This is the completed "-codon" parameter for mutate:

codon parameter
Saving

Once all of the necessary inputs, outputs, and parameters have been defined, click the Save Tool button at the bottom of the form. Please note that all of the "subforms" opened for each input, output and parameter must be saved before clicking "Save Tool". If any of the subforms are still open, the following error message will be displayed:

You must click save
	at the top of the form...then click Save Tool Changes to complete the process.
Running a Local Tool

Once the tool is saved, it will appear under the "My Tools" group in the Available Tools list on the Tools page.

My Tools

When you select the tool, the interface presented is the same one used by all BioExtract Server tools. Please consult Executing Tools for additional information.

A few moments after clicking "Execute", a popup window should appear, followed by another one that looks like this:

The application's digital signature
	cannot be verified. Do you want to run the application?

This is normal. A Java applet is used to execute the local tool, and applets cannot execute programs or write files without permission, which can only be granted if the applet is placed in a digitally signed .jar file. Since we have signed the file ourselves without using a certificate from one of the third-party Certificate Authorities, the browser reports that the signature cannot be verified.

Once you click "Run", the applet will download the input files from the server, execute the tool, and upload the output files, displaying a short message for each step. Once it is finished, you may close the applet window.