No announcement yet.

Problem setting samtools up

  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem setting samtools up


    so I have downloaded samtools-1.3 to an ubuntu computer and I want to use it to manipulate the output from my bwa mem.

    I enter the samtools-1.3 folder in the terminal and type "make" to set it up. It starts to run encounters an error as follows:

    bam_tview_curses.o bam_tview_curses.c
    bam_tview_curses.c:41:20: fatal error: curses.h: No such file or directory
    #include <curses.h>
    compilation terminated.
    make: *** [bam_tview_curses.o] Error 1

    My initial response (after searching the Internet) was that curses was not installed, and I tried to remedy that using sudo (apparently my user was not in the list of sudoers though.

    So I tried to see if curses was already installed, after consulting the Internet I tried

    ldconfig -p | grep ncurses
    which gave the output: (libc6,x86-64) => /lib/x86_64-linux-gnu/ (libc6,x86-64) => /lib/x86_64-linux-gnu/

    I took this as curses was installed. But that leaves me at a loss what could have happened. But this should at least mean that curses are there right? I'm not very experianced using ubuntu or C programs (I took a smaller course in C long ago and whil I've used linux computers quite some I've mostly used the terminal for navigation)

    Happy for Help!

  • #2
    You are missing libncurses5-dev library. Install it using software center/yum or whichever mechanism you use on your flavor of linux.


    • #3
      Thanks for the answer. The only suggestion for installing ncurses have been to use sudo, but since my account is not a sudoer it doesn't work. Do you know if there is a way install it without using sudo, or will I have to talk to the administrator to fix that for me?

      Also when I wrote

      ldconfig -p | grep ncurses

      I got (libc6,x86-64) => /lib/x86_64-linux-gnu/ (libc6,x86-64) => /lib/x86_64-linux-gnu/

      out which I took as ncurses were there (although I have to admit I only vaguely knew what I was doing)


      • #4
        It may sound odd, but you can use anaconda (the python distribution) to install samtools with all of its dependencies. samtools is in the "bioconda" channel, so "conda install -c bioconda samtools". This is a convenient way to install many bioinformatics tools without needing sudo privileges.


        • #5
          First just ask you system administrator to install ncurses developmental package. (You'll want it when you have to compile that specific version R to make your obscure TICKETTOSTOCKHOLM biostat package work anyway. Why? To prove those MUC and OR genes cause cancer, of course.).

          Second, the easiet thing to do is check the samtools INSTALL instructions. You can bypass curses.

          (from samtools file called "INSTALL" ; the one I'm using is from samtools version 1.1)
          " If you do not have this library installed,
          you can still compile the rest of SAMtools by manually changing:
          `-D_CURSES_LIB=1' to `-D_CURSES_LIB=0' at the line starting with `DFLAGS=', and
          comment out the line starting with `LIBCURSES='.
          Note that on some systems the library is available as -lcurses while on others
          as -lnurses. This can be set in Makefile by setting LIBCURSES= -lcurses vs

          Thirdly ... in desperation ... you can download the ncurses source, compile it and "point to" it.

          Instructions here: ; pick up the recipe at instruction #2.

          The following is more commentary than fool proof ...

          Edit the makefile.

          check the LDFLAGS = and LDLIBS = lines.

          There are many ways to skin a cat in this case and just hardwiring in the right place can provide equivalent solutions.

          By "point to" it you'll probably have to do two things when you edit the Makefile to configure the C compiler to look in the "INCLUDE" directory; this involves the -I paramteer for gcc; which you will have to carefully edit. See gcc documentation for the "-I" parameter. You must also properly link to the libcurses library. There are two types of libraries. You can use 1) shared object link or 2) static link the libcurses library. Static linking is probably the easiest way; just put the libcurses ".a" (dot a) file in the link ("link") command. Makefiles can be a little scary and great care and typing must be done to get it right. Shared object style linink in trickier as you'll have to provide the LD_LIBRARY_PATH environmental variable to point to the shared library at samtools run time.

          The finer points of specifying Include files and linking are bit of learning curve; so ask a local gcc expert to help out as it should be a trivial edit session on Makefile for them.
          If you do it yourself, you'll need to understand the gcc's -I ( dash eye) parameter and how to append the path to the libcurses library (either the full path or using the -L (dash elle) parmeter for the "link" comand which IS HIDDEN by the gcc command which does the actual call to link. In this case; some makefiles have explicit link instruction.
          Last edited by Richard Finney; 02-07-2016, 09:46 AM.


          • #6
            Thank you very much! That is really helpful.


            • #7
              The information Richard quoted from samtools 1.1 has been superseded in samtools 1.3.

              First off, system packages like the ncurses development package libncurses5-dev are non-science-related standard software for a development machine that your system administrators should have no qualms about installed. (Frankly, they should already be installed on a development machine!) So instructing your administrators to install this package and other system packages like it will be doing everyone using that development machine a service.

              Otherwise, in samtools 1.3 you can disable the curses-using tview command by configuring with

              ./configure --without-curses