Sunday, June 23, 2013

Installing Samtools and BEDTools

Trouble comes as a package when you start your lab. In my effort to resurrect our old database Eumicrobedb.org, I face new challenges every day. What earlier seemed to a be a cake walk, does not look that easy. I have installed so many open source programs in my last stint that I lost count of it. When running this software, I realize that many more dependencies need to be installed. Not to mention my troubles dealing with a crashed server and subsequent loss of all installations:((((

recently I was stuck with easy installations samtools-0.1.19 and bedtools-2.17.0 for more than 3 days. Earlier versions compiled fine in my SUSE linux machine but the same sources give trouble in Red Hat Linux.

While compiling BEDTools, it complained about "undefined reference to `gzopen64'". Searching the forums I figured out that it is complaining about zlib. I checked, it was there in my server and also in the path. However, finally changing the makefile with the following compiled the program.

Look for the line in Makefile 'export LIBS'

and add the following: export LIBS = YOUR_PATH/libz.so.1.2.7 -lzdo a make clean and do makeIt should compile fine.Samtools:With Samtools My problem lasted for a very long time. It always exited with errorsamtools error bam_import.c:76: undefined reference to gzopen64I tried re-installing zlib, added zlib path to LD_LIBRARY_PATH, installed latest version zlib, nothing worked.Finally I changed the line in Makefile that says :CFLAGS= -g -Wall -O2 toCFLAGS= -g -Wall -O2 -L /usr/local/lib (This is where my zlib libraries are located)viola.... It got installed.NOTE: Install as regular user. May be later you can copy the binary files to the system directories.