Bioconductor / GenomicRanges

Representation and manipulation of genomic intervals
https://bioconductor.org/packages/GenomicRanges
41 stars 17 forks source link

numeric meta column collapsed for connecting ranges when converting from Rle to GRanges #45

Closed ruqianl closed 3 years ago

ruqianl commented 3 years ago
library(BSgenome.Scerevisiae.UCSC.sacCer2)
set.seed(55)

## 2) As a metadata column on a disjoint GRanges object
## ----------------------------------------------------

gr2 <- GRanges(c("chrI:5",
                 "chrI:6",
                 "chrI:291-377",
                 "chrV:51-60"),
               score=c(0.4,0.4, -10, 2.2),
               id=letters[1:4],
               seqinfo=seqinfo(Scerevisiae))
gr2

bindAsGRanges(mcolAsRleList(gr2, "score"))

image

Sessioninfo:

` sessionInfo() R version 3.6.0 (2019-04-26) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 18.04.5 LTS

Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3 LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

locale: [1] LC_CTYPE=en_AU.UTF-8 LC_NUMERIC=C LC_TIME=en_AU.UTF-8 LC_COLLATE=en_AU.UTF-8 LC_MONETARY=en_AU.UTF-8 LC_MESSAGES=en_AU.UTF-8
[7] LC_PAPER=en_AU.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C

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

other attached packages: [1] BSgenome.Scerevisiae.UCSC.sacCer2_1.4.0 BSgenome_1.52.0 rtracklayer_1.44.0 Biostrings_2.52.0
[5] XVector_0.24.0 ggplot2_3.3.0 chromoMap_0.2 dplyr_0.8.3
[9] Gviz_1.28.3 GenomicRanges_1.36.0 GenomeInfoDb_1.20.0 IRanges_2.18.1
[13] S4Vectors_0.22.0 BiocGenerics_0.30.0

loaded via a namespace (and not attached): [1] ProtGenerics_1.16.0 bitops_1.0-6 matrixStats_0.54.0 bit64_0.9-7 RColorBrewer_1.1-2 progress_1.2.2
[7] httr_1.4.1 rstan_2.19.2 tools_3.6.0 backports_1.1.4 R6_2.4.0 rpart_4.1-15
[13] Hmisc_4.2-0 DBI_1.0.0 lazyeval_0.2.2 colorspace_1.4-1 nnet_7.3-12 withr_2.1.2
[19] processx_3.3.1 tidyselect_0.2.5 gridExtra_2.3 prettyunits_1.0.2 bit_1.1-14 curl_4.1
[25] compiler_3.6.0 cli_1.1.0 Biobase_2.44.0 htmlTable_1.13.1 DelayedArray_0.10.0 labeling_0.3
[31] scales_1.0.0 checkmate_1.9.3 callr_3.2.0 StanHeaders_2.19.0 stringr_1.4.0 digest_0.6.21
[37] Rsamtools_2.0.0 foreign_0.8-70 base64enc_0.1-3 dichromat_2.0-0 pkgconfig_2.0.3 htmltools_0.3.6
[43] ensembldb_2.8.0 htmlwidgets_1.3 rlang_0.4.0 rstudioapi_0.10 RSQLite_2.1.1 BiocParallel_1.18.1
[49] acepack_1.4.1 inline_0.3.15 VariantAnnotation_1.30.1 RCurl_1.95-4.12 magrittr_1.5 GenomeInfoDbData_1.2.1
[55] Formula_1.2-3 loo_2.1.0 Matrix_1.2-17 Rcpp_1.0.2 munsell_0.5.0 stringi_1.4.3
[61] yaml_2.2.0 SummarizedExperiment_1.14.0 zlibbioc_1.30.0 pkgbuild_1.0.3 blob_1.1.1 ggrepel_0.8.1
[67] crayon_1.3.4 lattice_0.20-38 splines_3.6.0 GenomicFeatures_1.36.1 hms_0.4.2 ps_1.3.0
[73] knitr_1.23 pillar_1.4.2 biomaRt_2.40.0 XML_3.98-1.20 glue_1.3.1 packrat_0.5.0
[79] biovizBase_1.32.0 latticeExtra_0.6-28 data.table_1.12.2 gtable_0.3.0 purrr_0.3.3 assertthat_0.2.1
[85] xfun_0.7 AnnotationFilter_1.8.0 survival_2.43-3 tibble_2.1.3 GenomicAlignments_1.20.0 AnnotationDbi_1.46.0
[91] memoise_1.1.0 cluster_2.0.8 `

ruqianl commented 3 years ago

I understand why this is the result now. It took a while to figure out the intended behaviour.