[Debian-med-packaging] [devteam-bioc] Problems with test suite of new verison of Rsamtools

Morgan, Martin Martin.Morgan at RoswellPark.org
Tue Nov 3 17:20:39 UTC 2015


> -----Original Message-----
> From: Andreas Tille [mailto:tille at debian.org]
> Sent: Tuesday, November 03, 2015 11:51 AM
> To: Morgan, Martin
> Cc: Debian Med Packaging Team; Bioconductor Package Maintainer
> Subject: Re: [devteam-bioc] Problems with test suite of new verison of
> Rsamtools
> 
> [sorry for my last empty mail - please ignore]
> 
> On Tue, Nov 03, 2015 at 04:23:43PM +0000, Morgan, Martin wrote:
> > >
> > > I tried this:
> > >
> > > > Rsamtools::indexBam(fl)
> > > [bam_index_core] the alignment is not sorted (EAS218_4:1:9:206:901):
> > > 2-th chr > 1-th chr [bam_index_build2] fail to index the BAM file.
> >
> > the messages above are not being reported as warnings, just messages (on
> stderr, I guess)...
> 
> I was just copying the output after starting R from a terminal - no idea
> whether this was stderr or some other stream.
> 
> > >
> > > Trying to reproduce:
> > >
> > > > warn <- FALSE
> > > > tryCatch(Rsamtools::indexBam(fl), warning=function(msg) warn <<-
> > > > TRUE)
> > > [bam_index_core] the alignment is not sorted (EAS218_4:1:9:206:901):
> > > 2-th chr > 1-th chr [bam_index_build2] fail to index the BAM file.
> > > Error in FUN(X[[i]], ...) : failed to build index
> > >   file:
> > > /usr/lib/R/site-library/Rsamtools/unitTests/cases/ex1_unsort.bam
> > > > warn
> > > [1] FALSE
> > >
> > >
> > > > Have you set some R option related to warning and error handlers?
> > >
> > > No, no special handlers applied here.  I think the problem is to
> > > write a file to a non-writeable dir.
> 
> Could you please comment on my assumption that the test tries to write to a
> non-writeable dir?

by adding tempfile() to the indexBam() function below, the test would not try to write to a non-writeable directory. I do not think that is the problem.


> 
> > the test could be written as
> >
> > warn <- FALSE
> > tryCatch(Rsamtools::indexBam(fl, tempfile()), warning=function(msg)
> > warn <<- TRUE) warn
> >
> > (expecting the value of warn changed to TRUE).
> >
> > If the test above is not successful, then can you please provide the
> > transcript of the package installation? Rsamtools re-directs fprintf
> > calls in the samtools library, and I believe that some compiler flags
> > will prohibit this re-direction. This is what Rsamtools tries to
> > impose (from src/Makevars.common)
> >
> > DFLAGS = -D_USE_KNETFILE -D_FILE_OFFSET_BITS=64 \
> >   -U_FORTIFY_SOURCE -DBGZF_CACHE \
> >   -Dfprintf=_samtools_fprintf \
> >   -Dexit=_samtools_exit \
> >   -Dabort=_samtools_abort
> 
> I have attached the full build log of the Debian package which contains all
> flags.

The compiler output show that Rsamtools tries to turn off _FORTIFY_SOURCE (which is on by default) by undefining the symbol with the flag

   -U_FORTIFY_SOURCE

but that you then over-write this with

  -D_FORTIFY_SOURCE=2

_FORTIFY_SOURCE=2 does not allow fprintf to be re-directed, so the error message from samtools is not treated as a warning in Rsamtools, and the unit test fails. Did you specify _FORTIFY_SOURCE=2 when you built R?

I'm not sure what path forward to take.

Martin

> 
> Hope this helps
> 
>       Andreas.
> 
> --
> http://fam-tille.de


This email message may contain legally privileged and/or confidential information.  If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited.  If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.



More information about the Debian-med-packaging mailing list