lawremi / rtracklayer

R interface to genome annotation files and the UCSC genome browser
Other
28 stars 17 forks source link

`import.bb`: Error when `which=NULL` #77

Open bschilder opened 2 years ago

bschilder commented 2 years ago

Other import.* functions simply ignore the which= arg when it's set to NULL, but import.bb throws an error instead

Reprex

Code

f <- "https://www.encodeproject.org/files/ENCFF096UAE/@@download/ENCFF096UAE.bigBed" 
gr <- rtracklayer::import(con = f, which=NULL)
gr <- rtracklayer::import.bb(con = f, which=NULL)

Console output

Error in as(ranges, "IntegerRangesList") : 
no method or default for coercing “NULL” to “IntegerRangesList”
13.
stop(gettextf("no method or default for coercing %s to %s", dQuote(thisClass), 
dQuote(Class)), domain = NA)
12.
as(ranges, "IntegerRangesList")
11.
initialize(value, ...)
10.
initialize(value, ...)
9.
new("BigBedSelection", ranges = as(ranges, "IntegerRangesList"), 
colnames = colnames)
8.
BigBedSelection(which, ...)
7.
.class1(object)
6.
as(selection, "BigBedSelection")
5.
.local(con, format, text, ...)
4.
import(FileForFormat(con), ...)
3.
import(FileForFormat(con), ...)
2.
rtracklayer::import(con = f, which = NULL)
1.
rtracklayer::import(con = f, which = NULL)

Session info

```R R version 4.2.1 (2022-06-23) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Monterey 12.4 Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib locale: [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8 attached base packages: [1] stats4 stats graphics grDevices utils datasets methods base other attached packages: [1] PeakyFinders_0.99.2 GenomicRanges_1.49.1 GenomeInfoDb_1.33.7 IRanges_2.31.2 [5] S4Vectors_0.35.4 BiocGenerics_0.43.4 MACSdata_1.5.0 dplyr_1.0.10 loaded via a namespace (and not attached): [1] readxl_1.4.1 AnnotationHub_3.5.1 [3] BiocFileCache_2.5.0 BiocParallel_1.31.12 [5] ggplot2_3.3.6 digest_0.6.29 [7] htmltools_0.5.3 fansi_1.0.3 [9] magrittr_2.0.3 memoise_2.0.1 [11] BSgenome_1.65.2 tzdb_0.3.0 [13] openxlsx_4.2.5 limma_3.53.9 [15] Biostrings_2.65.6 readr_2.1.2 [17] echoconda_0.99.7 matrixStats_0.62.0 [19] R.utils_2.12.0 colorspace_2.0-3 [21] blob_1.2.3 rappdirs_0.3.3 [23] xfun_0.33 crayon_1.5.1 [25] RCurl_1.98-1.8 echodata_0.99.14 [27] jsonlite_1.8.0 templateR_0.99.0 [29] Exact_3.2 GEOquery_2.65.2 [31] glue_1.6.2 MACSr_0.99.15 [33] gtable_0.3.1 zlibbioc_1.43.0 [35] XVector_0.37.1 DelayedArray_0.23.2 [37] scales_1.2.1 mvtnorm_1.1-3 [39] DBI_1.1.3 Rcpp_1.0.9 [41] xtable_1.8-4 reticulate_1.26 [43] bit_4.0.4 proxy_0.4-27 [45] DT_0.25 htmlwidgets_1.5.4 [47] httr_1.4.4 dir.expiry_1.5.1 [49] ellipsis_0.3.2 pkgconfig_2.0.3 [51] XML_3.99-0.10 R.methodsS3_1.8.2 [53] dbplyr_2.2.1 utf8_1.2.2 [55] here_1.0.1 tidyselect_1.1.2 [57] rlang_1.0.6 later_1.3.0 [59] AnnotationDbi_1.59.1 munsell_0.5.0 [61] BiocVersion_3.16.0 cellranger_1.1.0 [63] tools_4.2.1 cachem_1.0.6 [65] cli_3.4.1 generics_0.1.3 [67] RSQLite_2.2.17 ExperimentHub_2.5.0 [69] stringr_1.4.1 fastmap_1.1.0 [71] yaml_2.3.5 knitr_1.40 [73] bit64_4.0.5 zip_2.2.1 [75] purrr_0.3.4 KEGGREST_1.37.3 [77] rootSolve_1.8.2.3 mime_0.12 [79] scKirby_0.1.0 R.oo_1.25.0 [81] xml2_1.3.3 compiler_4.2.1 [83] rstudioapi_0.14 filelock_1.0.2 [85] curl_4.3.2 png_0.1-7 [87] interactiveDisplayBase_1.35.0 e1071_1.7-11 [89] tibble_3.1.8 DescTools_0.99.46 [91] stringi_1.7.8 basilisk.utils_1.9.4 [93] lattice_0.20-45 Matrix_1.5-1 [95] vctrs_0.4.1 pillar_1.8.1 [97] lifecycle_1.0.2 BiocManager_1.30.18 [99] data.table_1.14.2 bitops_1.0-7 [101] lmom_2.9 httpuv_1.6.6 [103] rtracklayer_1.57.0 R6_2.5.1 [105] BiocIO_1.7.1 promises_1.2.0.1 [107] gld_2.6.5 codetools_0.2-18 [109] boot_1.3-28 MASS_7.3-58.1 [111] assertthat_0.2.1 pkgload_1.3.0 [113] SummarizedExperiment_1.27.3 rprojroot_2.0.3 [115] rjson_0.2.21 regioneR_1.29.1 [117] GenomicAlignments_1.33.1 Rsamtools_2.13.4 [119] GenomeInfoDbData_1.2.8 expm_0.999-6 [121] parallel_4.2.1 hms_1.1.2 [123] grid_4.2.1 tidyr_1.2.1 [125] basilisk_1.9.11 class_7.3-20 [127] MatrixGenerics_1.9.1 piggyback_0.1.4 [129] Biobase_2.57.1 shiny_1.7.2 [131] restfulr_0.0.15 ```

Best, Brian