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

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 • 3.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
4.7 years ago
ATpoint 81k

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
  - defaults

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

Login before adding your answer.

Traffic: 2668 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