EMBOSS is a new package, and can seem difficult at first. If you follow these steps you will find it can be easy.
We start by assuming you want to write a new application. You will need to write the application source code, which will use the EMBOSS libraries, and you also need to add the application to EMBOSS.
This is because EMBOSS can use the application command definition (ACD) file to test all the input for you, without any new source code.
ACD files live in the emboss/acd/ directory with a filename or appname.acd ("appname" is the name of your application).
You will find some files there already which you are welcome to use as templates for your own ACD file.
ACD files usually need:
There are other things you can specify too. All values can have defaults provided in the ACD file, and tests to make sure the values are reasonable. See the ACD documentation for more information.
This lives in emboss/appname.c and to start with you will simply call the startup routines and pick up the values you defined in the ACD file.
#include "emboss.h" AjPSeq seq; AjPFile outfile; int iweight; int main (int argc, char * argv[]) { embInit ("appname", argc, argv); seq = ajAcdGetSeq ("sequence"); outfile = ajAcdGetOutfile ("outfile"); iweight = ajAcdGetInt ("weight"); ajExit(); }
The "embInit" call is exactly what acdc was doing. It will read appname.acd and read everything you need from the command line or by prompting the user.
The next 3 lines pick up the sequence, output file and integer value in the suggested ACD file (you will have your own set of calls here).
Now you are ready to write your code. The sequence is in seq in an internal representation. You can use EMBOSS functions to work with this sequence, or convert it to a string and use the string functions, or convert it to a null-terminated C character string and use the C library functions and C pointers. It does not really matter which you choose.
All output will be written to outfile. You should use the EMBOSS output functions to do this, typically ajFmtPrintF which works just like C's "printf" except that it uses an AJAX file object (AjPFile) and has some extra format options like %S for AJAX strings (AjPStr).
Go to the emboss directory. Edit file Makefile.am and make two changes. Add appname to the list of applications in bin_PROGRAMS and add a new line:
appname_SOURCES = appname.c
Then cd back up to the top directory, and run ./configure which will magically update the makefiles for you. You can then use make to make EMBOSS with your new application.