Issues installing bcftools with GNU Scientific Library
1
0
Entering edit mode
5.7 years ago
user31888 ▴ 150

I am trying to compile the latest bcftools (version 1.9) with the GNU Scientific Library, in order to be able to use the polysomy algorithm.

I'm not sudo on the shared system, so I installed zlib-1.2.11 in my home directory.

Then in the bcftools directory I tried:

./configure --enable-libgsl CPPFLAGS="-l/my_home/lib/zlib-1.2.11"

Output:

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for grep that handles long lines and -e... /bin/grep
checking for C compiler warning flags... -Wall
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking location of HTSlib source tree... htslib-1.9
checking shared library type... plain .so
checking for library containing dlopen... -ldl
checking if the compiler accepts -rdynamic... yes
checking for zlib.h... yes
checking for inflate in -lz... no
configure: error: zlib development files not found

BCFtools uses compression routines from the zlib library <http://zlib.net>.
Building bcftools requires zlib development files to be installed on the build
machine; you may need to ensure a package such as zlib1g-dev (on Debian or
Ubuntu Linux) or zlib-devel (on RPM-based Linux distributions) is installed.

FAILED.  This error must be resolved in order to build bcftools successfully.

What is "inflate"? A library? A command? What is "lz"?

bcftools zlib • 4.0k views
ADD COMMENT
0
Entering edit mode

An easy workaround would be to install bcftools via a package manager such as conda.

ADD REPLY
0
Entering edit mode

Yes, I tried installing the GNU Scientific Library, then bcftools with conda. Both installations worked, but the GSL is not integrated/linked and thus I cannot get polysomy.

ADD REPLY
0
Entering edit mode

I found that adding the following to your bashrc solved most of these issues. I would install zlib (but not bcftools) with conda, then add the flags below to bashrc and then see if you can compile bcftools with that.

export LDFLAGS="-L$HOME/anaconda3/lib"
export CFLAGS="-I$HOME/anaconda3/include"
export CPATH="$HOME/anaconda3/include"
ADD REPLY
0
Entering edit mode

Try adding /include to your configure command and also adding LDFLAGS, maybe that would help

./configure --enable-libgsl CPPFLAGS="-I/my_home/lib/zlib-1.2.11/include" LDFLAGS="-L/my_home/lib/zlib-1.2.11/lib"
ADD REPLY
3
Entering edit mode
5.7 years ago
ATpoint 87k

Devon Ryan was (as usual) very helpful and updated the conda recipe for bcftools to include the polysomy subcommand. You should now be able to pull a bcftools version from conda that includes that subcommand. Be sure that your ~/.condarc lists the channels in this order:

channels:
  - conda-forge
  - bioconda

to make sure that the correct versions of e.g. openssl is pulled. Works fine on my machine:

$ bcftools polysomy

About:   Detect number of chromosomal copies from Illumina's B-allele frequency (BAF)
Usage:   bcftools polysomy [OPTIONS] <file.vcf>

General options:
    -o, --output-dir <path>        
    -r, --regions <region>         restrict to comma-separated list of regions
    -R, --regions-file <file>      restrict to regions listed in a file
    -s, --sample <name>            sample to analyze
    -t, --targets <region>         similar to -r but streams rather than index-jumps
    -T, --targets-file <file>      similar to -R but streams rather than index-jumps
    -v, --verbose                  

Algorithm options:
    -b, --peak-size <float>        minimum peak size (0-1, larger is stricter) [0.1]
    -c, --cn-penalty <float>       penalty for increasing CN (0-1, larger is stricter) [0.7]
    -f, --fit-th <float>           goodness of fit threshold (>0, smaller is stricter) [3.3]
    -i, --include-aa               include the AA peak in CN2 and CN3 evaluation
    -m, --min-fraction <float>     minimum distinguishable fraction of aberrant cells [0.1]
    -p, --peak-symmetry <float>    peak symmetry threshold (0-1, larger is stricter) [0.5]
ADD COMMENT
0
Entering edit mode

Hi, do you happen to know which version contains this subcommand? The current version (or most up to date) doesn't recognize the polysomy command.

$ bcftools polysomy [E::main] unrecognized command 'polysomy'

thank you!

ADD REPLY
1
Entering edit mode

Use bcftools --version or conda list bcftools to find out what version of bcftools you have actually installed. Also use which bcftools to check that the copy of bcftools that you are running is the one you think you are.

Any version of the bioconda bcftools package that depends on the gsl package will include the polysomy command. In particular, all bioconda builds of the current version, 1.21, have been built this way (as have the preceding versions for several years).

If yours does not include polysomy probably you will find that it is a much older version. The usual way people get such old versions via bioconda is that they do not have the conda-forge channel activated. Set up your conda installation according to the Bioconda instructions.

ADD REPLY
0
Entering edit mode

thank you! although I had the current version of bcftools, I don't think my conda installation was fully set up.

ADD REPLY
0
Entering edit mode

What did which bcftools and bcftools --version say?

ADD REPLY
0
Entering edit mode

Looks like one needs to compile bcftools to include GNU Scientific library to get that subcommand : https://samtools.github.io/bcftools/howtos/cnv-calling.html

ADD REPLY
0
Entering edit mode

oh, so are you suggesting to locally install bcftools instead of going through conda? i have attempted local installation but i was having some issues with the makefile

ADD REPLY
0
Entering edit mode

Hilariously @GenoMax you are doing much the same thing that other moderators five years ago did in their comments on this question. As the answer you are commenting on states, for over five years the Bioconda build of bcftools has indeed been built to include the GNU Scientific Library and the bcftools subcommands that that enables.

ADD REPLY
0
Entering edit mode

I was not sure if @nitya had already tried to install using conda since they were saying that the command was not recognized. So I was just pointing out that GSL was required in case they were trying to build locally.

ADD REPLY

Login before adding your answer.

Traffic: 3446 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6