10.2. Wrappers and Ports

There are two basic approaches for incorporating third party applications. You can write a "wrapper" to an application or you can port the application source code itself. A wrapper is merely a program whose primary purpose is to call another program, the latter is usually (but not always) not native to EMBOSS. In contrast, a "port" is where the source code of the application being incorporated is modified such that it's suitable for the native system (EMBOSS).

Basic methods are outlined below for wrapping and porting applications. It is pointless being too prescriptive as what's required very much depends on the application in question. The pros and cons of wrapping and porting applications are summarised. The methods used, and C source code and ACD files, are illustrated based on experience of incorporating the HMMER package into EMBOSS.

In case you're not already familiar with it, the HMMER package is a collection of tools for hidden Markov model analysis of protein sequences written by Sean Eddy. Version 2.2.1 was ported into EMBOSS as the HMMER EMBASSY package during ISMB, back in 2001. HMMER is under the GPL licence so there were no licensing issues to consider when modifying the source code. This version proved hard to maintain, however, so for the latest release, version 2.3.2, an EMBASSY package (HMMERNEW) of application wrappers was developed.

When porting an application it's necessary to identify the functions that read input from the user, write an ACD file that defines the same values, then add code to pick up the values from the ACD file instead of processing them as in the original.

When wrapping an application an ACD file is still needed and this is usually written to closely follow the original interface. There are drawbacks in the naming of parameters as you'll see later. The wrapper must construct an appropriate command line based on the user specifications. The main difficulty is ensuring that sequences and other data are in the format required by the third party application. The wrapper may need to read the input and convert it as necessary before the underlying program is launched.

In both cases any output files may be left in whatever format is produced by the original application or, in addition, the data might be converted into a format specified by the user. For a port this could involve modifying the original source code and replacing the output function with appropriate calls to the EMBOSS libraries. Alternatively, and this is the approach taken when developing some wrappers, temporary files may be used to achieve the conversion.

It's worth saying at this point that a few shortcuts were taken with HMMER because its two alignment formats (Selex and Stockholm) were made available as options in the AJAX library. Those routines could be revised transparently during the update as the formats are not normally invoked by EMBOSS users.