Hello again Tengfei and BioC list,

I am encountering a new error when using autoplot() on a GRanges and an
annotation data base.

I suspect that there is no annotation on the region I selected. For now I
believe I can use a tryCatch() to pick up the error and avoid plotting this
track on situations like this. But well, it would be nice if ggbio handled
this error or maybe the cause it something else.



> suppressMessages(library("ggbio"))
> suppressMessages(library("GenomicRanges"))
> suppressMessages(library("TxDb.Hsapiens.UCSC.hg19.knownGene"))
> txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
> wh <- GRanges("chr21", IRanges(47409355, 47409855))
> autoplot(txdb, which = wh, names.expr = "tx_name(gene_id)")
Aggregating TranscriptDb...
Parsing exons...
Parsing cds...
Parsing transcripts...
Parsing utrs and aggregating...
Error in DataFrame(...) : different row counts implied by arguments
> traceback()
14: stop("different row counts implied by arguments")
13: DataFrame(...)
12: newGRanges("GRanges", seqnames = seqnames, ranges = ranges, strand =
strand,
        mcols = DataFrame(...), seqlengths = seqlengths, seqinfo = seqinfo)
11: GRanges(seqnms, ir.utrs, tx_id = .nms, tx_name = .tx.nms, gene_id =
.gid.nms,
        type = "utr")
10: .local(obj, ...)
9: crunch(object, which, truncate.gaps = truncate.gaps, truncate.fun =
truncate.fun,
       ratio = ratio)
8: crunch(object, which, truncate.gaps = truncate.gaps, truncate.fun =
truncate.fun,
       ratio = ratio)
7: .local(data, ...)
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(gene_id)", label = TRUE,
       which = <S4 object of class "GRanges">, list())
5: (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(gene_id)", label = TRUE,
       which = <S4 object of class "GRanges">, list())
4: do.call(geom_alignment, args.res)
3: .local(object, ...)
2: autoplot(txdb, which = wh, names.expr = "tx_name(gene_id)")
1: autoplot(txdb, which = wh, names.expr = "tx_name(gene_id)")
> sessionInfo()
R version 3.0.2 (2013-09-25)
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] TxDb.Hsapiens.UCSC.hg19.knownGene_2.10.1 GenomicFeatures_1.14.2
            AnnotationDbi_1.24.0
 [4] Biobase_2.22.0                           GenomicRanges_1.14.3
            XVector_0.2.0
 [7] IRanges_1.20.5                           BiocGenerics_0.8.0
            ggbio_1.10.8
[10] ggplot2_0.9.3.1

loaded via a namespace (and not attached):
 [1] biomaRt_2.18.0          Biostrings_2.30.1       biovizBase_1.10.3
  bitops_1.0-6            BSgenome_1.30.0
 [6] cluster_1.14.4          colorspace_1.2-4        DBI_0.2-7
  dichromat_2.0-0         digest_0.6.3
[11] grid_3.0.2              gridExtra_0.9.1         gtable_0.1.2
 Hmisc_3.12-2            labeling_0.2
[16] lattice_0.20-24         MASS_7.3-29             munsell_0.4.2
  plyr_1.8                proto_0.3-10
[21] RColorBrewer_1.0-5      RCurl_1.95-4.1          reshape2_1.2.2
 rpart_4.1-3             Rsamtools_1.14.1
[26] RSQLite_0.11.4          rtracklayer_1.22.0      scales_0.2.3
 stats4_3.0.2            stringr_0.6.2
[31] tools_3.0.2             VariantAnnotation_1.8.6 XML_3.95-0.2
 zlibbioc_1.8.0
>


Thank you!

Leonardo Collado Torres, PhD student
Department of Biostatistics
Johns Hopkins University
Bloomberg School of Public Health
Website: http://www.biostat.jhsph.edu/~lcollado/<http://bit.ly/LColladoTorres>
Blog: http://lcolladotor.github.io/ <http://bit.ly/FellBit>

	[[alternative HTML version deleted]]

