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

Andreas Tille tille at debian.org
Tue Nov 3 16:47:26 UTC 2015


On Tue, Nov 03, 2015 at 04:23:43PM +0000, Morgan, Martin wrote:
> > -----Original Message-----
> > From: Andreas Tille [mailto:tille at debian.org]
> > Sent: Tuesday, November 03, 2015 11:03 AM
> > To: Morgan, Martin
> > Cc: Bioconductor Package Maintainer; Debian Med Packaging Team
> > Subject: Re: [devteam-bioc] Problems with test suite of new verison of
> > Rsamtools
> > 
> > Hi Martin,
> > 
> > On Sun, Nov 01, 2015 at 12:05:24PM +0000, Morgan, Martin wrote:
> > > This is strange. When the Rsamtools package is installed then the
> > > following should be true
> > >
> > > > fl <- system.file("unitTests", "cases", "ex1_unsort.bam",
> > > > package="Rsamtools")
> > > > file.exists(fl)
> > > [1] TRUE
> > 
> > OK, I can confirm this:
> > 
> > > library(Rsamtools)
> > Loading required package: S4Vectors
> > Loading required package: stats4
> > Loading required package: BiocGenerics
> > Loading required package: parallel
> > 
> > Attaching package: 'BiocGenerics'
> > 
> > The following objects are masked from 'package:parallel':
> > 
> >     clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
> >     clusterExport, clusterMap, parApply, parCapply, parLapply,
> >     parLapplyLB, parRapply, parSapply, parSapplyLB
> > 
> > The following objects are masked from 'package:stats':
> > 
> >     IQR, mad, xtabs
> > 
> > The following objects are masked from 'package:base':
> > 
> >     Filter, Find, Map, Position, Reduce, anyDuplicated, append,
> >     as.data.frame, as.vector, cbind, colnames, do.call, duplicated,
> >     eval, evalq, get, grep, grepl, intersect, is.unsorted, lapply,
> >     lengths, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
> >     pmin.int, rank, rbind, rownames, sapply, setdiff, sort, table,
> >     tapply, union, unique, unlist, unsplit
> > 
> > Loading required package: IRanges
> > Loading required package: GenomeInfoDb
> > Loading required package: GenomicRanges
> > Loading required package: XVector
> > Loading required package: Biostrings
> > > fl <- system.file("unitTests", "cases", "ex1_unsort.bam",
> > > package="Rsamtools")
> > > file.exists(fl)
> > [1] TRUE
> > 
> > 
> > > the test tries to index the bam file, and should generate an error and
> > > warnings
> > >
> > > > Rsamtools::indexBam(fl)
> > > Error in FUN(X[[i]], ...) : failed to build index
> > >   file:
> > > /home/mtmorgan/R/x86_64-pc-linux-gnu-
> > library/3.3/Rsamtools/unitTests/c
> > > ases/ex1_unsort.bam
> > > In addition: Warning messages:
> > > 1: In FUN(X[[i]], ...) :
> > >   [bam_index_core] the alignment is not sorted (EAS218_4:1:9:206:901):
> > > 2-th chr > 1-th chr
> > > 2: In FUN(X[[i]], ...) : [bam_index_build2] fail to index the BAM file.
> > 
> > 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)...
> 
> > Error in FUN(X[[i]], ...) : failed to build index
> >   file: /usr/lib/R/site-library/Rsamtools/unitTests/cases/ex1_unsort.bam
> > 
> > 
> > and I think I know the problem:  The tests are installed to /usr/lib/...
> > and on a Debian system this is not writable for normal users.  Do you see any
> > chance to rewrite the tests to create any output to a temporary directory?
> > 
> > 
> > > >From your output below it seems like that actually occurs. The
> > > >warnings should be caught by
> > >
> > > > warn <- FALSE
> > > > tryCatch(Rsamtools::indexBam(fl), warning=function(msg) warn <<-
> > > > TRUE) warn
> > > [1] TRUE
> > >
> > > Is this what you see?
> > 
> > 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.
> 
> 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
> 
> Martin
> 
> > 
> > Kind regards
> > 
> >       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.
> 
> _______________________________________________
> Debian-med-packaging mailing list
> Debian-med-packaging at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-packaging
> 

-- 
http://fam-tille.de



More information about the Debian-med-packaging mailing list