Bioconductor/GenomicRanges

no convenient SimpleGRangesList to CompressedGRangesList as function

Closed this issue · 2 comments

Hi Hervé, @hpages

Shouldn't there be a SimpleGRangesList to CompressedGRangesList as
method?

I get an error when using this code:

suppressPackageStartupMessages({
    library(GenomicRanges)
})
example(GRangesList, echo = FALSE)

grl <- as(list(gr1, gr2), "GRangesList")
GRangesList(grl)
#> Error in as(objects[[1L]], "CompressedGRangesList", strict = FALSE): no method or default for coercing "SimpleGRangesList" to "CompressedGRangesList"

sessionInfo()
#> R version 3.6.1 Patched (2019-10-04 r77258)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 18.04.3 LTS
#> 
#> Matrix products: default
#> BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] parallel  stats4    stats     graphics  grDevices utils     datasets 
#> [8] methods   base     
#> 
#> other attached packages:
#> [1] GenomicRanges_1.37.16 GenomeInfoDb_1.21.2   IRanges_2.19.16      
#> [4] S4Vectors_0.23.25     BiocGenerics_0.31.6  
#> 
#> loaded via a namespace (and not attached):
#>  [1] Rcpp_1.0.2             digest_0.6.21          bitops_1.0-6          
#>  [4] magrittr_1.5           evaluate_0.14          highr_0.8             
#>  [7] zlibbioc_1.31.0        rlang_0.4.0            stringi_1.4.3         
#> [10] XVector_0.25.0         rmarkdown_1.16         tools_3.6.1           
#> [13] stringr_1.4.0          RCurl_1.95-4.12        xfun_0.10             
#> [16] yaml_2.2.0             compiler_3.6.1         htmltools_0.4.0       
#> [19] knitr_1.25             GenomeInfoDbData_1.2.1

Created on 2019-10-09 by the reprex package (v0.3.0)

The simple solution would be to use as(list(gr1, gr2), "CompressedGRangesList")
but I don't think many end users are aware of this distinction.

This is in reference to Bioconductor/RaggedExperiment#24

Thanks,
Marcel

Yup. Should be fixed in GenomicRanges 1.37.17 (see commit bb01f40).

Thanks for catching this.

H.

Thanks Hervé!