readGAlignments + BamViews not working in BioC-Devel
5
0
Entering edit mode
Arne Muller ▴ 20
@arne-muller-8308
Last seen 8.5 years ago
United States

Hi All,

I'm wondering why the code below throws an error. I'm using R-devel (3.3.0) + BioC-devel. Is this a bug or did I miss something.

From the GenomicAlignments help:

## With a BamViews object:
fls <- system.file("extdata", "ex1.bam", package="Rsamtools",
                    mustWork=TRUE)
bv <- BamViews(fls,
               bamSamples=DataFrame(info="test", row.names="ex1"),
               auto.range=TRUE)
## Note that the "readGAlignments" method for BamViews objects
## requires the ShortRead package to be installed.
aln <- readGAlignments(bv)
Error in readGAlignments(bv) : 
  Assertion on 'more.args' failed: Vector must be named
> sessionInfo()
R Under development (unstable) (2015-07-07 r68639)
Platform: x86_64-unknown-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.6 (Santiago)
locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] GenomicAlignments_1.5.11   Rsamtools_1.21.13         
 [3] Biostrings_2.37.2          XVector_0.9.1             
 [5] SummarizedExperiment_0.3.2 Biobase_2.29.1            
 [7] GenomicRanges_1.21.16      GenomeInfoDb_1.5.8        
 [9] IRanges_2.3.14             S4Vectors_0.7.10          
[11] BiocGenerics_0.15.3        BatchJobs_1.6             
[13] BiocParallel_1.3.34        BiocInstaller_1.19.8      

loaded via a namespace (and not attached):
 [1] magrittr_1.5         zlibbioc_1.15.0      brew_1.0-6          
 [4] sendmailR_1.2-1      stringr_1.0.0        tools_3.3.0         
 [7] fail_1.2             checkmate_1.6.0      DBI_0.3.1           
[10] lambda.r_1.1.7       futile.logger_1.4.1  digest_0.6.8        
[13] bitops_1.0-6         base64enc_0.1-2      futile.options_1.0.0
[16] RSQLite_1.0.0        stringi_0.5-5        BBmisc_1.9          

regards,
Arne

genomicalignments rsamtools • 2.6k views
ADD COMMENT
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 9 weeks ago
United States

Note that Bioc-devel packages are only tested against R-release

http://bioconductor.org/checkResults/devel/bioc-LATEST/

This will be the case until the next release of bioc, at which point bioc devel will test against R-devel.

 

0
Entering edit mode
Arne Muller ▴ 20
@arne-muller-8308
Last seen 8.5 years ago
United States

Hi - the error also occurs with R-3.2.0 and BiocDevel:

aln <- readGAlignments(bv)
Error in readGAlignments(bv) : 
  Assertion on 'more.args' failed: Vector must be named

Enter a frame number, or 0 to exit   

 1: readGAlignments(bv)
 2: readGAlignments(bv)
 3: Rsamtools:::.BamViews_delegate("readGAlignments", file, fun)
 4: bplapply(idx, fun, bamViews, ...)
 5: bplapply(idx, fun, bamViews, ...)
 6: bplapply(X, FUN, ..., BPREDO = BPREDO, BPPARAM = BPPARAM)
 7: bplapply(X, FUN, ..., BPREDO = BPREDO, BPPARAM = BPPARAM)
 8: suppressMessages(batchMap(reg, fun = FUN, X, more.args = list(...)))
 9: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessag
10: batchMap(reg, fun = FUN, X, more.args = list(...))
11: checkMoreArgs(more.args)
12: assertList(more.args, names = "strict")
13: makeAssertion(res, vname(x, .var.name))
14: mstop("Assertion on '%s' failed: %s", var.name, msg)

Seems there's a problem passing arguments from or to bplapply. Strange that this isn't picked up by the tests.

Arne

> sessionInfo()
R version 3.2.1 Patched (2015-07-06 r68635)
Platform: x86_64-unknown-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.6 (Santiago)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:

 [1] GenomicAlignments_1.5.11   Rsamtools_1.21.13         
 [3] Biostrings_2.37.2          XVector_0.9.1             
 [5] SummarizedExperiment_0.3.2 Biobase_2.29.1            
 [7] GenomicRanges_1.21.16      GenomeInfoDb_1.5.8        
 [9] IRanges_2.3.14             S4Vectors_0.7.10          
[11] BiocGenerics_0.15.3        BatchJobs_1.6             
[13] BiocParallel_1.3.34        BiocInstaller_1.19.8      

loaded via a namespace (and not attached):
 [1] magrittr_1.5         zlibbioc_1.15.0      brew_1.0-6          
 [4] sendmailR_1.2-1      stringr_1.0.0        tools_3.2.1         
 [7] fail_1.2             checkmate_1.6.0      DBI_0.3.1           
[10] lambda.r_1.1.7       futile.logger_1.4.1  digest_0.6.8        
[13] bitops_1.0-6         base64enc_0.1-2      futile.options_1.0.0
[16] RSQLite_1.0.0        stringi_0.5-5        BBmisc_1.9          
ADD COMMENT
0
Entering edit mode

Hmm, looks like you're using BatchJobsParam() ? Can you provide a little detail on what you've done before this?

ADD REPLY
0
Entering edit mode
@valerie-obenchain-4275
Last seen 2.9 years ago
United States

Hi Arne,

I can't reproduce this error in release or devel.

As Vince mentioned, this cycle we're using R 3.2.1 in both release and devel. You can see the R info at the top of the build reports, currently 3.2.1 (2015-06-18) -- "World-Famous Astronaut" in both.

http://www.bioconductor.org/checkResults/devel/bioc-LATEST/

http://www.bioconductor.org/checkResults/release/bioc-LATEST/

To checkout the patched version ...

svn co https://svn.r-project.org/R/branches/R-3-2-branch/

Valerie

ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 4 months ago
United States

Thanks, this was a bug in Rsamtools dispatch to BatchJobs back-end. It was introduced earlier in the 1.21.* series, and is fixed in version 1.21.14. For the record, the problem was reproducible with

library(GenomicAlignments)
library(BiocParallel)
register(BatchJobsParam())
fls <- system.file("extdata", "ex1.bam", package="Rsamtools", mustWork=TRUE)
bv <- BamViews(fls, bamSamples=DataFrame(info="test", row.names="ex1"),
               auto.range=TRUE)
aln <- readGAlignments(bv)

 

 

ADD COMMENT
0
Entering edit mode
Arne Muller ▴ 20
@arne-muller-8308
Last seen 8.5 years ago
United States

Hi - thanks for this fix in Rsamtools, but this only fixes the problem in one place, there's another (and possibly more) in GenomicAlignments::summarizeOverlaps:

  mapq_filter <- function(features, reads, algorithm,
                             ignore.strand, inter.feature)
     { 
         require(GenomicAlignments) # needed for parallel evaluation
         Union(features, reads[mcols(reads)$mapq >= 20], algorithm,
               ignore.strand, inter.feature) 
     }

     genes <- GRanges("seq1", IRanges(seq(1, 1500, by=200), width=100))
     param <- ScanBamParam(what="mapq")
     fl <- system.file("extdata", "ex1.bam", package="Rsamtools")
     se <- summarizeOverlaps(genes, fl, mode=mapq_filter, param=param) 

Error in summarizeOverlaps(genes, fl, mode = mapq_filter, param = param) : 
  Assertion on 'more.args' failed: Vector must be named

To me it looks like bplapply has changed it's interface and all the consumers of it that do not use names arguments now fail.

regards,

  Arne

ADD COMMENT
0
Entering edit mode

I'm not sure whether it was a change in BatchJobs / BiocParallel or just that this code wasn't used with BatchJobsParam(). But it seems like a better solution is to find a way to enable BiocParallel to pass this simple test case:

> bplapply(1:4, function(...) {}, "foo", BPPARAM=BatchJobsParam())
Error in bplapply(1:4, function(...) { : 
  Assertion on 'more.args' failed: Vector must be named

 

ADD REPLY
0
Entering edit mode

Now fixed in BiocParallel 1.3.45 and 1.2.17.

Valerie

ADD REPLY
0
Entering edit mode

I spoke too soon - sorry. More testing needed.

Valerie

ADD REPLY
0
Entering edit mode

OK, let's try again with 1.3.46 and 1.2.18. Let me know if you run into problems.

Valerie

ADD REPLY
0
Entering edit mode

Hi - I think there's still a problem. Bioc-Release still uses 1.2.9 whereas in the svn there's' already 1.2.18 for release (note, the build/check report says there's a timeout for 1.2.18).

ADD REPLY
0
Entering edit mode

Just wanted to let you know I saw this and we are working on it.

ADD REPLY
0
Entering edit mode

1.2.20 built today and should be available via biocLite().

http://www.bioconductor.org/checkResults/release/bioc-LATEST/

ADD REPLY

Login before adding your answer.

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