Question: bio::db::sam installation error
0
gravatar for ramesh.8v
3.1 years ago by
ramesh.8v200
United States
ramesh.8v200 wrote:

I installed bioperl in ubuntu 14 by

sudo apt-get install bioperl

Then installed samtools by sudo apt-get install samtools . Then I tried installing bio::db::sam perl module but I couldn't trace bam.h or libbam.a. So I installed samtools from source in home/ramesh8v/samtools-1.3.1, then I added this directory to environmental variable and I confirmed this by echo $PATH.
Now, I'm trying to install bio::db::sam by typing sudo cpan bio::db::sam but I'm running into this error,

Reading '/home/ramesh8v/.cpan/Metadata'
  Database was generated on Thu, 22 Sep 2016 04:17:02 GMT
Running install for module 'Bio::DB::Sam'
Running make for L/LD/LDS/Bio-SamTools-1.43.tar.gz
Checksum for /home/ramesh8v/.cpan/sources/authors/id/L/LD/LDS/Bio-SamTools-1.43.tar.gz ok

  CPAN.pm: Building L/LD/LDS/Bio-SamTools-1.43.tar.gz

This module requires samtools 0.1.10 or higher samtools.sourceforge.net).
Please enter the location of the bam.h and compiled libbam.a files: /home/ramesh8v/samtools-1.3.1

Found /home/ramesh8v/samtools-1.3.1/bam.h and /home/ramesh8v/samtools-1.3.1/libbam.a.
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Bio-SamTools' version '1.43'
Building Bio-SamTools
cc -I/home/ramesh8v/samtools-1.3.1 -Ic_bin -I/usr/lib/perl/5.18/CORE -fPIC -D_IOLIB=2 -D_FILE_OFFSET_BITS=64 -Wformat=0 -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -o c_bin/bam2bedgraph.o c_bin/bam2bedgraph.c
cc -I/home/ramesh8v/samtools-1.3.1 -Ic_bin -I/usr/lib/perl/5.18/CORE -DXS_VERSION="1.43" -DVERSION="1.43" -fPIC -D_IOLIB=2 -D_FILE_OFFSET_BITS=64 -Wformat=0 -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -o lib/Bio/DB/Sam.o lib/Bio/DB/Sam.c
lib/Bio/DB/Sam.xs: In function ‘XS_Bio__DB__Bam__Alignment_l_aux’:
lib/Bio/DB/Sam.xs:575:8: error: ‘bam1_t’ has no member named ‘l_aux’
       b->l_aux = SvIV(ST(1));
        ^
lib/Bio/DB/Sam.xs:576:13: error: ‘bam1_t’ has no member named ‘l_aux’
     RETVAL=b->l_aux;
             ^
lib/Bio/DB/Sam.c: In function ‘XS_Bio__DB__Bam__Index_coverage’:
lib/Bio/DB/Sam.xs:1008:20: warning: ignoring return value of ‘bgzf_seek’, declared with attribute warn_unused_result [-Wunused-result]
           bgzf_seek(bfp,0,0);
                    ^
In file included from lib/Bio/DB/Sam.xs:28:0:
lib/Bio/DB/Sam.c: In function ‘XS_Bio__DB__Bam_seek’:
/home/ramesh8v/samtools-1.3.1/bam.h:57:41: warning: ignoring return value of ‘bgzf_seek’, declared with attribute warn_unused_result [-Wunused-result]
 #define bam_seek(fp, pos, dir) bgzf_seek(fp, pos, dir)
                                         ^
lib/Bio/DB/Sam.xs:380:5: note: in expansion of macro ‘bam_seek’
     bam_seek(bam,pos,dir);
     ^
lib/Bio/DB/Sam.c: In function ‘XS_Bio__DB__Bam_header_write’:
lib/Bio/DB/Sam.xs:356:16: warning: ignoring return value of ‘bgzf_seek’, declared with attribute warn_unused_result [-Wunused-result]
       bgzf_seek(bam,0,0);
                ^
error building lib/Bio/DB/Sam.o from 'lib/Bio/DB/Sam.c' at /usr/share/perl/5.18/ExtUtils/CBuilder/Base.pm line 177.
  LDS/Bio-SamTools-1.43.tar.gz
  ./Build -- NOT OK
Running Build test
  Can't test without successful make
Running Build install
  Make had returned bad status, install seems impossible
samtools bioperl • 3.9k views
ADD COMMENTlink modified 3.1 years ago by Charles Plessy2.7k • written 3.1 years ago by ramesh.8v200

Can you check what version of samtools was installed by apt-get (samtools --version)? I assume that is in your $PATH.

ADD REPLYlink written 3.1 years ago by genomax73k

samtools --version gives me

samtools 1.3.1
Using htslib 1.3.1
Copyright (C) 2016 Genome Research Ltd.

Yes. it's in my path. I could able to use samtools without any problem.

ADD REPLYlink modified 3.1 years ago • written 3.1 years ago by ramesh.8v200
1

README file for bio::db:sam says following.

This is a Perl interface to the SAMtools sequence alignment interface. It ONLY works on versions of Samtools up to 0.1.17. It does not work on version 1.0 or higher due to major changes in the library structure.

ADD REPLYlink written 3.1 years ago by genomax73k

Many thanks for pointing that out

ADD REPLYlink written 3.1 years ago by ramesh.8v200

Aside from the version issue, you probably only installed the samtools binary and the Perl module needs the library files to compile against. So, I'm certain this won't work because there is possibly no library available and it would be the wrong version if it could be found.

ADD REPLYlink written 3.1 years ago by SES8.2k
6
gravatar for SES
3.1 years ago by
SES8.2k
Vancouver, BC
SES8.2k wrote:

To save some space, I'll just point you to StackOverflow where I've answered this a couple of times. It is important that you compile samtools correctly, make sure it can be found by the Perl module, and use a version that the Perl module was designed to work with.

That will solve the question, but the problem you may be creating for yourself is that neither of these packages are being developed now. I recommend you use Bio::DB::HTS instead, which is based on Bio::DB::Sam. Bio::DB::HTS provides bindings to HTSlib and is a safer bet to support formats and operations currently in use.

ADD COMMENTlink modified 3.1 years ago • written 3.1 years ago by SES8.2k
1

Thanks a ton... Finally, I installed :)

ADD REPLYlink modified 3.1 years ago • written 3.1 years ago by ramesh.8v200

Hey, your other useful comment got deleted. Sorry about that.

ADD REPLYlink written 3.1 years ago by ramesh.8v200
0
gravatar for Charles Plessy
3.1 years ago by
Charles Plessy2.7k
Japan
Charles Plessy2.7k wrote:

How about sudo apt install libbio-samtools ?

ADD COMMENTlink written 3.1 years ago by Charles Plessy2.7k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 751 users visited in the last hour