[BioC] ggbio 1.12.0 autoplot() with txdb example is broken

Leonardo Collado Torres lcollado at jhsph.edu
Wed Apr 23 06:10:31 CEST 2014


Hello Tengfei + bioc list,

>From http://www.bioconductor.org/packages/release/bioc/vignettes/ggbio/inst/doc/ggbio.pdf
page 4 (complied on april 11 2014), the following example loads to an
error as shown below. I wasn't seeing this error before (aka, last
week). The only guess that comes to mind is the recent update to
GenomicRanges (1.16.2) although that doesn't seem to be related from
the traceback() output, well... maybe it's related to the
ignore.strand = TRUE part as described in the error.

I'll create a GitHub issue just for completeness.

Thank you,
Leonardo

> library(ggbio)
## Removed the output, nothing out of ordinary

> library(TxDb.Hsapiens.UCSC.hg19.knownGene)
## Removed the output

> txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
> data(genesymbol, package = "biovizBase")
> p.txdb <- autoplot(txdb, which = genesymbol["BRCA1"])
Aggregating TranscriptDb...
Parsing transcripts...
Parsing exons...
Parsing cds...
Parsing utrs...
------exons...
------cdss...
------introns...
------utr...
aggregating...
Done
Constructing graphics...
Error in sapply(listData, function(Xi) extends(class(Xi), elementTypeX)) :
  error in evaluating the argument 'X' in selecting a method for
function 'sapply': Error in unlist(range(ranges(x.n, ignore.strand =
TRUE))) :
  error in evaluating the argument 'x' in selecting a method for
function 'unlist': Error in .local(x, ...) : unused argument
(ignore.strand = TRUE)

> traceback()
15: sapply(listData, function(Xi) extends(class(Xi), elementTypeX))
14: .updateCompressedList(X, lapply_CompressedList(X, FUN, ...))
13: endoapply(obj.lst, function(x) {
        if (!is.null(group.name)) {
            if (!group.selfish) {
                x.n <- split(x, values(x)[, group.name])
                irs <- unlist(range(ranges(x.n, ignore.strand = TRUE)))
                irs.new <- resize(irs, fix = fix, width = width(irs) +
                    extend.size)
                irs.new <- sort(irs.new)
                .lvs <- disjointBins(irs.new)
                values(x)$stepping <- .lvs[as.character(values(x)[,
                    group.name])]
                x
            }
            else {
                values(x)$stepping <- as.numeric(as.factor(values(x)[,
                    group.name]))
                x
            }
        }
        else {
            irs <- ranges(x)
            values(x)$stepping <- as.numeric(disjointBins(resize(irs,
                fix = "center", width = width(irs) + extend.size)))
            x
        }
    })
12: endoapply(obj.lst, function(x) {
        if (!is.null(group.name)) {
            if (!group.selfish) {
                x.n <- split(x, values(x)[, group.name])
                irs <- unlist(range(ranges(x.n, ignore.strand = TRUE)))
                irs.new <- resize(irs, fix = fix, width = width(irs) +
                    extend.size)
                irs.new <- sort(irs.new)
                .lvs <- disjointBins(irs.new)
                values(x)$stepping <- .lvs[as.character(values(x)[,
                    group.name])]
                x
            }
            else {
                values(x)$stepping <- as.numeric(as.factor(values(x)[,
                    group.name]))
                x
            }
        }
        else {
            irs <- ranges(x)
            values(x)$stepping <- as.numeric(disjointBins(resize(irs,
                fix = "center", width = width(irs) + extend.size)))
            x
        }
    })
11: .local(obj, ...)
10: addStepping(gr, group.name = "tx_id", group.selfish = FALSE,
        fix = "start", extend.size = es)
9: addStepping(gr, group.name = "tx_id", group.selfish = FALSE,
       fix = "start", extend.size = es)
8: .local(data, ...)
7: (function (data, ...)
   standardGeneric("geom_alignment"))(data = <S4 object of class
"TranscriptDb">,
       truncate.gaps = FALSE, ratio = 0.0025, geom = "alignment",
       stat = "identity", names.expr = "tx_name", label = TRUE,
       which = <S4 object of class "GRanges">, list())
6: (function (data, ...)
   standardGeneric("geom_alignment"))(data = <S4 object of class
"TranscriptDb">,
       truncate.gaps = FALSE, ratio = 0.0025, geom = "alignment",
       stat = "identity", names.expr = "tx_name", label = TRUE,
       which = <S4 object of class "GRanges">, list())
5: do.call(geom_alignment, args.res)
4: do.call(geom_alignment, args.res)
3: .local(object, ...)
2: autoplot(txdb, which = genesymbol["BRCA1"])
1: autoplot(txdb, which = genesymbol["BRCA1"])


> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
 [1] XVector_0.4.0
TxDb.Hsapiens.UCSC.hg19.knownGene_2.14.0 GenomicFeatures_1.16.0
 [4] AnnotationDbi_1.26.0                     Biobase_2.24.0
                GenomicRanges_1.16.2
 [7] GenomeInfoDb_1.0.2                       IRanges_1.22.3
                ggbio_1.12.0
[10] ggplot2_0.9.3.1                          BiocGenerics_0.10.0

loaded via a namespace (and not attached):
 [1] BatchJobs_1.2            BBmisc_1.5
BiocParallel_0.6.0       biomaRt_2.20.0           Biostrings_2.32.0
 [6] biovizBase_1.12.0        bitops_1.0-6             brew_1.0-6
         BSgenome_1.32.0          cluster_1.15.2
[11] codetools_0.2-8          colorspace_1.2-4         DBI_0.2-7
         dichromat_2.0-0          digest_0.6.4
[16] fail_1.2                 foreach_1.4.2            Formula_1.1-1
         GenomicAlignments_1.0.0  grid_3.1.0
[21] gridExtra_0.9.1          gtable_0.1.2             Hmisc_3.14-4
         iterators_1.0.7          labeling_0.2
[26] lattice_0.20-29          latticeExtra_0.6-26      MASS_7.3-31
         munsell_0.4.2            plyr_1.8.1
[31] proto_0.3-10             RColorBrewer_1.0-5       Rcpp_0.11.1
         RCurl_1.95-4.1           reshape2_1.2.2
[36] Rsamtools_1.16.0         RSQLite_0.11.4
rtracklayer_1.24.0       scales_0.2.3             sendmailR_1.1-2
[41] splines_3.1.0            stats4_3.1.0             stringr_0.6.2
         survival_2.37-7          tools_3.1.0
[46] VariantAnnotation_1.10.0 XML_3.98-1.1             zlibbioc_1.10.0
>



More information about the Bioconductor mailing list