ggbio icon indicating copy to clipboard operation
ggbio copied to clipboard

tracks(xlim) doesn't work with GRanges input

Open lcolladotor opened this issue 4 years ago • 3 comments

Hi,

derfinderPlot::plotCluster() is currently failing https://bioconductor.org/checkResults/release/bioc-LATEST/derfinderPlot/nebbiolo2-buildsrc.html and I traced it back to ggbio. Here's a small reproducible example that shows that tracks(xlim) fails if you pass it a GRanges object.

Best, Leo

library("ggbio")
data("hg19IdeogramCyto", package = "biovizBase", envir = environment())
p.ideogram <- plotIdeogram(hg19IdeogramCyto, "chr21")
p.ideogram
tracks(p.ideogram, xlim = GenomicRanges::GRanges("chr21:47409355-47409855"))
# Error in do.call(PlotList, PlotList) : 
#   'what' must be a function or character string
traceback()
# 3: do.call(PlotList, PlotList)
# 2: do.call(PlotList, PlotList)
# 1: ggbio::tracks(p.ideogram, xlim = GenomicRanges::GRanges("chr21:47409355-47409855"))

options(width = 120)
sessioninfo::session_info()
# - Session info  ------------------------------------------------------------------------------------------------------
#  hash: flag: Zimbabwe, twelve o’clock, grinning face
# 
#  setting  value
#  version  R version 4.1.2 (2021-11-01)
#  os       Windows 10 x64 (build 19042)
#  system   x86_64, mingw32
#  ui       RStudio
#  language (EN)
#  collate  English_United States.1252
#  ctype    English_United States.1252
#  tz       America/New_York
#  date     2021-11-22
#  rstudio  2021.09.1+372 Ghost Orchid (desktop)
#  pandoc   NA
# 
# - Packages -----------------------------------------------------------------------------------------------------------
#  package              * version  date (UTC) lib source
#  AnnotationDbi          1.56.2   2021-11-09 [1] Bioconductor
#  AnnotationFilter       1.18.0   2021-10-26 [1] Bioconductor
#  assertthat             0.2.1    2019-03-21 [1] CRAN (R 4.1.2)
#  backports              1.3.0    2021-10-27 [1] CRAN (R 4.1.1)
#  base64enc              0.1-3    2015-07-28 [1] CRAN (R 4.1.1)
#  Biobase                2.54.0   2021-10-26 [1] Bioconductor
#  BiocFileCache          2.2.0    2021-10-26 [1] Bioconductor
#  BiocGenerics         * 0.40.0   2021-10-26 [1] Bioconductor
#  BiocIO                 1.4.0    2021-10-26 [1] Bioconductor
#  BiocManager            1.30.16  2021-06-15 [1] CRAN (R 4.1.2)
#  BiocParallel           1.28.1   2021-11-18 [1] Bioconductor
#  biomaRt                2.50.0   2021-10-26 [1] Bioconductor
#  Biostrings             2.62.0   2021-10-26 [1] Bioconductor
#  biovizBase             1.42.0   2021-10-26 [1] Bioconductor
#  bit                    4.0.4    2020-08-04 [1] CRAN (R 4.1.2)
#  bit64                  4.0.5    2020-08-30 [1] CRAN (R 4.1.2)
#  bitops                 1.0-7    2021-04-24 [1] CRAN (R 4.1.1)
#  blob                   1.2.2    2021-07-23 [1] CRAN (R 4.1.2)
#  BSgenome               1.62.0   2021-10-26 [1] Bioconductor
#  cachem                 1.0.6    2021-08-19 [1] CRAN (R 4.1.2)
#  callr                  3.7.0    2021-04-20 [1] CRAN (R 4.1.2)
#  checkmate              2.0.0    2020-02-06 [1] CRAN (R 4.1.2)
#  cli                    3.1.0    2021-10-27 [1] CRAN (R 4.1.2)
#  cluster                2.1.2    2021-04-17 [1] CRAN (R 4.1.2)
#  colorspace             2.0-2    2021-06-24 [1] CRAN (R 4.1.2)
#  crayon                 1.4.2    2021-10-29 [1] CRAN (R 4.1.2)
#  curl                   4.3.2    2021-06-23 [1] CRAN (R 4.1.2)
#  data.table             1.14.2   2021-09-27 [1] CRAN (R 4.1.2)
#  DBI                    1.1.1    2021-01-15 [1] CRAN (R 4.1.2)
#  dbplyr                 2.1.1    2021-04-06 [1] CRAN (R 4.1.2)
#  DelayedArray           0.20.0   2021-10-26 [1] Bioconductor
#  desc                   1.4.0    2021-09-28 [1] CRAN (R 4.1.2)
#  devtools             * 2.4.2    2021-06-07 [1] CRAN (R 4.1.2)
#  dichromat              2.0-0    2013-01-24 [1] CRAN (R 4.1.1)
#  digest                 0.6.28   2021-09-23 [1] CRAN (R 4.1.2)
#  dplyr                  1.0.7    2021-06-18 [1] CRAN (R 4.1.1)
#  ellipsis               0.3.2    2021-04-29 [1] CRAN (R 4.1.2)
#  ensembldb              2.18.2   2021-11-08 [1] Bioconductor
#  fansi                  0.5.0    2021-05-25 [1] CRAN (R 4.1.2)
#  farver                 2.1.0    2021-02-28 [1] CRAN (R 4.1.2)
#  fastmap                1.1.0    2021-01-25 [1] CRAN (R 4.1.2)
#  filelock               1.0.2    2018-10-05 [1] CRAN (R 4.1.2)
#  foreign                0.8-81   2020-12-22 [1] CRAN (R 4.1.2)
#  Formula                1.2-4    2020-10-16 [1] CRAN (R 4.1.1)
#  fs                     1.5.0    2020-07-31 [1] CRAN (R 4.1.2)
#  generics               0.1.1    2021-10-25 [1] CRAN (R 4.1.2)
#  GenomeInfoDb           1.30.0   2021-10-26 [1] Bioconductor
#  GenomeInfoDbData       1.2.7    2021-11-22 [1] Bioconductor
#  GenomicAlignments      1.30.0   2021-10-26 [1] Bioconductor
#  GenomicFeatures        1.46.1   2021-10-27 [1] Bioconductor
#  GenomicRanges          1.46.1   2021-11-18 [1] Bioconductor
#  GGally                 2.1.2    2021-06-21 [1] CRAN (R 4.1.2)
#  ggbio                * 1.42.0   2021-11-02 [1] Bioconductor
#  ggplot2              * 3.3.5    2021-06-25 [1] CRAN (R 4.1.2)
#  glue                   1.5.0    2021-11-07 [1] CRAN (R 4.1.2)
#  graph                  1.72.0   2021-10-26 [1] Bioconductor
#  gridExtra              2.3      2017-09-09 [1] CRAN (R 4.1.2)
#  gtable                 0.3.0    2019-03-25 [1] CRAN (R 4.1.2)
#  Hmisc                  4.6-0    2021-10-07 [1] CRAN (R 4.1.2)
#  hms                    1.1.1    2021-09-26 [1] CRAN (R 4.1.2)
#  htmlTable              2.3.0    2021-10-12 [1] CRAN (R 4.1.2)
#  htmltools              0.5.2    2021-08-25 [1] CRAN (R 4.1.2)
#  htmlwidgets            1.5.4    2021-09-08 [1] CRAN (R 4.1.2)
#  httr                   1.4.2    2020-07-20 [1] CRAN (R 4.1.2)
#  IRanges                2.28.0   2021-10-26 [1] Bioconductor
#  jpeg                   0.1-9    2021-07-24 [1] CRAN (R 4.1.1)
#  KEGGREST               1.34.0   2021-10-26 [1] Bioconductor
#  knitr                  1.36     2021-09-29 [1] CRAN (R 4.1.2)
#  lattice                0.20-45  2021-09-22 [1] CRAN (R 4.1.2)
#  latticeExtra           0.6-29   2019-12-19 [1] CRAN (R 4.1.2)
#  lazyeval               0.2.2    2019-03-15 [1] CRAN (R 4.1.2)
#  lifecycle              1.0.1    2021-09-24 [1] CRAN (R 4.1.2)
#  lubridate              1.8.0    2021-10-07 [1] CRAN (R 4.1.2)
#  magrittr               2.0.1    2020-11-17 [1] CRAN (R 4.1.2)
#  Matrix                 1.3-4    2021-06-01 [1] CRAN (R 4.1.2)
#  MatrixGenerics         1.6.0    2021-10-26 [1] Bioconductor
#  matrixStats            0.61.0   2021-09-17 [1] CRAN (R 4.1.2)
#  memoise                2.0.0    2021-01-26 [1] CRAN (R 4.1.2)
#  munsell                0.5.0    2018-06-12 [1] CRAN (R 4.1.2)
#  nnet                   7.3-16   2021-05-03 [1] CRAN (R 4.1.2)
#  OrganismDbi            1.36.0   2021-10-26 [1] Bioconductor
#  pillar                 1.6.4    2021-10-18 [1] CRAN (R 4.1.2)
#  pkgbuild               1.2.0    2020-12-15 [1] CRAN (R 4.1.2)
#  pkgconfig              2.0.3    2019-09-22 [1] CRAN (R 4.1.2)
#  pkgload                1.2.3    2021-10-13 [1] CRAN (R 4.1.2)
#  plyr                   1.8.6    2020-03-03 [1] CRAN (R 4.1.2)
#  png                    0.1-7    2013-12-03 [1] CRAN (R 4.1.1)
#  prettyunits            1.1.1    2020-01-24 [1] CRAN (R 4.1.2)
#  processx               3.5.2    2021-04-30 [1] CRAN (R 4.1.2)
#  progress               1.2.2    2019-05-16 [1] CRAN (R 4.1.2)
#  ProtGenerics           1.26.0   2021-10-26 [1] Bioconductor
#  ps                     1.6.0    2021-02-28 [1] CRAN (R 4.1.2)
#  purrr                  0.3.4    2020-04-17 [1] CRAN (R 4.1.2)
#  R6                     2.5.1    2021-08-19 [1] CRAN (R 4.1.2)
#  rappdirs               0.3.3    2021-01-31 [1] CRAN (R 4.1.2)
#  RBGL                   1.70.0   2021-10-26 [1] Bioconductor
#  RColorBrewer           1.1-2    2014-12-07 [1] CRAN (R 4.1.1)
#  Rcpp                   1.0.7    2021-07-07 [1] CRAN (R 4.1.2)
#  RCurl                  1.98-1.5 2021-09-17 [1] CRAN (R 4.1.1)
#  remotes                2.4.1    2021-09-29 [1] CRAN (R 4.1.2)
#  reshape                0.8.8    2018-10-23 [1] CRAN (R 4.1.2)
#  reshape2               1.4.4    2020-04-09 [1] CRAN (R 4.1.2)
#  restfulr               0.0.13   2017-08-06 [1] CRAN (R 4.1.2)
#  rjson                  0.2.20   2018-06-08 [1] CRAN (R 4.1.1)
#  rlang                  0.4.12   2021-10-18 [1] CRAN (R 4.1.2)
#  rpart                  4.1-15   2019-04-12 [1] CRAN (R 4.1.2)
#  rprojroot              2.0.2    2020-11-15 [1] CRAN (R 4.1.2)
#  Rsamtools              2.10.0   2021-10-26 [1] Bioconductor
#  RSQLite                2.2.8    2021-08-21 [1] CRAN (R 4.1.2)
#  rsthemes               0.3.1    2021-11-22 [1] Github (gadenbuie/rsthemes@bbe73ca)
#  rstudioapi             0.13     2020-11-12 [1] CRAN (R 4.1.2)
#  rtracklayer            1.54.0   2021-10-26 [1] Bioconductor
#  S4Vectors              0.32.2   2021-11-07 [1] Bioconductor
#  scales                 1.1.1    2020-05-11 [1] CRAN (R 4.1.2)
#  sessioninfo            1.2.1    2021-11-02 [1] CRAN (R 4.1.2)
#  stringi                1.7.5    2021-10-04 [1] CRAN (R 4.1.1)
#  stringr                1.4.0    2019-02-10 [1] CRAN (R 4.1.2)
#  SummarizedExperiment   1.24.0   2021-10-26 [1] Bioconductor
#  suncalc                0.5.0    2019-04-03 [1] CRAN (R 4.1.2)
#  survival               3.2-13   2021-08-24 [1] CRAN (R 4.1.2)
#  testthat             * 3.1.0    2021-10-04 [1] CRAN (R 4.1.2)
#  tibble                 3.1.6    2021-11-07 [1] CRAN (R 4.1.2)
#  tidyselect             1.1.1    2021-04-30 [1] CRAN (R 4.1.2)
#  usethis              * 2.1.3    2021-10-27 [1] CRAN (R 4.1.2)
#  utf8                   1.2.2    2021-07-24 [1] CRAN (R 4.1.2)
#  VariantAnnotation      1.40.0   2021-10-26 [1] Bioconductor
#  vctrs                  0.3.8    2021-04-29 [1] CRAN (R 4.1.2)
#  withr                  2.4.2    2021-04-18 [1] CRAN (R 4.1.2)
#  xfun                   0.28     2021-11-04 [1] CRAN (R 4.1.2)
#  XML                    3.99-0.8 2021-09-17 [1] CRAN (R 4.1.1)
#  xml2                   1.3.2    2020-04-23 [1] CRAN (R 4.1.2)
#  XVector                0.34.0   2021-10-26 [1] Bioconductor
#  yaml                   2.2.1    2020-02-01 [1] CRAN (R 4.1.1)
#  zlibbioc               1.40.0   2021-10-26 [1] Bioconductor
# 
#  [1] C:/R/R-4.1.2bioc3.14/library

----------------------------------------------------------------------------------------------------------------------

lcolladotor avatar Nov 23 '21 00:11 lcolladotor

Hi @sanchit-saini , should I merge #160 to fix this?

lawremi avatar Jan 25 '22 14:01 lawremi

It seems it's failing against the GitHub Action might be related to some memory constraint not sure tho. To validate, I ran tests locally it was fine. So, Yes it should be fine to merge it.

sanchit-saini avatar Jan 25 '22 14:01 sanchit-saini

Hi. It appears that this bug is still not fixed in version 1.42, when will you update the package with the correction?

SheliO avatar May 09 '22 11:05 SheliO