Compiling Nikolaus Rajewsky’s Ahab on OSX

No Comments
Posted 11 Mar 2009 in genome bioinformatics, OSX hacks, regulatory sequences

One of the most challenging areas of genome bioinformatics is the de novo prediction of regulatory sequences that control gene expression. This is especially true for fully functional cis-regulatory elements that can act far from their target gene, such as enhancers. The most frequently used approach to predict enhancers is to find regions of the genome with a high density of matches to the recognition sequences of known transcription factors. There are a large number of papers describing bioinformatics methods for enhancer prediction using this strategy, including Martin Frith‘s pioneering method Cister.

One of the most efficient and easy to use command line programs for detecting clusters of transcription factor binding sites is Nikolaus Rajewsky‘s program Ahab, which you can obtain by contacting Nikolaus directly.

I had trouble getting Ahab to run on OSX, partly because in the distribution Nikolaus sent there was no Makefile provided, but found that it can be compiled with the following modifications. The underlying cause of the problem is a conflict between a system wide definition of fmin and that provided by the Numerical Recipes in C nr.h file (see discussion here). To fix this and compile, our sysadmin Nick Gresham has developed the following solution:

1) change line 182 and line 640 in the file source/nr.h from:

float fmin(float x[]);
float fmin();
float nr_fmin(float x[]);
float nr_fmin();

2) create a Makefile with the following commands and make.

ALL_PROGRAMS = module_fit module_prof

FIT_OBJS = dbrent.o df1dim.o dlinmin.o f1dim.o frprmn.o mnbrak.o Wtmx.o readFas.o
PROF_OBJS = Profile.o readFas.o


.PHONY : all

module_fit : $(FIT_OBJS)

$(LD) $(LDFLAGS) $^ $(LIBS) -o $@

module_prof : $(PROF_OBJS)

$(LD) $(LDFLAGS) $^ $(LIBS) -o $@


rm -rf *.o $(ALL_PROGRAMS)

3) change the $exec and $exec_profile variables in perl/ to ‘module_fit’ & ‘module_prof’, respectively.

Notes: This solution works on a 2.4 Ghz Intel Core 2 Duo Macbook running Mac OS 10.5.6 using i686-apple-darwin9-gcc-4.0.1. Tabs in the makefile have been faked using the indentation function in the wordpress editor.

Add Your Comment