Question: Error running table() on an RleList returned by coverage()
gravatar for Rory Stark
4.2 years ago by
Rory Stark2.6k
CRUK, Cambridge, UK
Rory Stark2.6k wrote:

Our package build is breaking on a call to table() with the results of a call to coverage(). We pass in a GRanges and get back a RleList. This used to work.

Easiest way to reproduce is using the example from the GenomicRanges::coverage man page:

gr <- GRanges(
        seqnames=Rle(c("chr1", "chr2", "chr1", "chr3"), c(1, 3, 2, 4)),
        ranges=IRanges(1:10, end=10),
        strand=Rle(strand(c("-", "+", "*", "+", "-")), c(1, 2, 2, 3, 2)),
        seqlengths=c(chr1=11, chr2=12, chr3=13))
cvg <- coverage(gr)

What used to happen:

> table(cvg)
     0 1 2 3 4
chr1 1 4 1 5 0
chr2 3 1 1 7 0
chr3 9 1 1 1 1

What happens now:

> table(cvg)
Error in as.vector(x, mode) : invalid 'mode' argument

Can anyone help? I see that GenomicRanges is broken right now in the development build, perhaps this will be fixed when that is...




ADD COMMENTlink modified 4.2 years ago by Hervé Pagès ♦♦ 13k • written 4.2 years ago by Rory Stark2.6k
gravatar for Hervé Pagès
4.2 years ago by
Hervé Pagès ♦♦ 13k
United States
Hervé Pagès ♦♦ 13k wrote:

Hi Rory,

I fixed that bug yesterday in IRanges 1.99.31 but the fix won't propagate to the public repos until tomorrow. In the mean time you can get IRanges 1.99.31 directly from svn:

  svn co

user: readonly, password: readonly




ADD COMMENTlink written 4.2 years ago by Hervé Pagès ♦♦ 13k

Excellent, thanks Hervé!


ADD REPLYlink written 4.2 years ago by Rory Stark10
Please log in to add an answer.


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