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

Andreas Tille tille at debian.org
Tue Nov 3 16:03:11 UTC 2015


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/cases/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.
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.

Kind regards

      Andreas.

-- 
http://fam-tille.de



More information about the Debian-med-packaging mailing list