[Bioc-devel] GenomicRanges::cbind() problem

Robert Castelo robert.castelo at upf.edu
Tue Sep 12 09:06:36 CEST 2017


dear GenomicRanges developers,

my package qpgraph is breaking in devel due to the following behavior of 
GenomicRanges:

library(GenomicRanges)
gr <- GRanges(seqnames=rep("1", 10), IRanges(1:10, width=1))
mcols(gr)
DataFrame with 10 rows and 0 columns
mcols(gr) <- cbind(mcols(gr), DataFrame(test=rep(1, 10)))
gr
GRanges object with 10 ranges and 1 metadata column:
        seqnames    ranges strand |       dfs
           <Rle> <IRanges>  <Rle> | <numeric>
    [1]        1  [ 1,  1]      * |         1
    [2]        1  [ 2,  2]      * |         1
    [3]        1  [ 3,  3]      * |         1
    [4]        1  [ 4,  4]      * |         1
    [5]        1  [ 5,  5]      * |         1
    [6]        1  [ 6,  6]      * |         1
    [7]        1  [ 7,  7]      * |         1
    [8]        1  [ 8,  8]      * |         1
    [9]        1  [ 9,  9]      * |         1
   [10]        1  [10, 10]      * |         1
   -------
   seqinfo: 1 sequence from an unspecified genome; no seqlengths

notice that the metadata column i've added should be called 'test' and 
it is called 'dfs' instead. this does not happen in release:

library(GenomicRanges)
gr <- GRanges(seqnames=rep("1", 10), IRanges(1:10, width=1))
mcols(gr)
DataFrame with 10 rows and 0 columns
mcols(gr) <- cbind(mcols(gr), DataFrame(test=rep(1, 10)))
gr
GRanges object with 10 ranges and 1 metadata column:
        seqnames    ranges strand |      test
           <Rle> <IRanges>  <Rle> | <numeric>
    [1]        1  [ 1,  1]      * |         1
    [2]        1  [ 2,  2]      * |         1
    [3]        1  [ 3,  3]      * |         1
    [4]        1  [ 4,  4]      * |         1
    [5]        1  [ 5,  5]      * |         1
    [6]        1  [ 6,  6]      * |         1
    [7]        1  [ 7,  7]      * |         1
    [8]        1  [ 8,  8]      * |         1
    [9]        1  [ 9,  9]      * |         1
   [10]        1  [10, 10]      * |         1
   -------
   seqinfo: 1 sequence from an unspecified genome; no seqlengths

i guess that if doing 'cbind()' with an empty 'DataFrame' is not allowed 
anymore, the correct behavior should be giving an error but renaming the 
column seems bogus to me.

please find below my session information bits for both, devel and release.

cheers,

robert.

devel sessionInfo():

R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS: /opt/R/R-3.4.0_BioCdevel/lib64/R/lib/libRblas.so
LAPACK: /opt/R/R-3.4.0_BioCdevel/lib64/R/lib/libRlapack.so

locale:
  [1] LC_CTYPE=en_US.UTF8       LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF8        LC_COLLATE=en_US.UTF8
  [5] LC_MONETARY=en_US.UTF8    LC_MESSAGES=en_US.UTF8
  [7] LC_PAPER=en_US.UTF8       LC_NAME=C
  [9] LC_ADDRESS=C              LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF8 LC_IDENTIFICATION=C

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

other attached packages:
[1] GenomicRanges_1.29.13 GenomeInfoDb_1.13.4 IRanges_2.11.15
[4] S4Vectors_0.15.7      BiocGenerics_0.23.1 colorout_1.1-2

loaded via a namespace (and not attached):
[1] zlibbioc_1.23.0         compiler_3.4.0 tools_3.4.0
[4] XVector_0.17.1          GenomeInfoDbData_0.99.1 RCurl_1.95-4.8
[7] bitops_1.0-6

release sessionInfo():

R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS: /opt/R/R-3.4.0/lib64/R/lib/libRblas.so
LAPACK: /opt/R/R-3.4.0/lib64/R/lib/libRlapack.so

locale:
  [1] LC_CTYPE=en_US.UTF8       LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF8        LC_COLLATE=en_US.UTF8
  [5] LC_MONETARY=en_US.UTF8    LC_MESSAGES=en_US.UTF8
  [7] LC_PAPER=en_US.UTF8       LC_NAME=C
  [9] LC_ADDRESS=C              LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF8 LC_IDENTIFICATION=C

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

other attached packages:
[1] GenomicRanges_1.28.4 GenomeInfoDb_1.12.2 IRanges_2.10.3
[4] S4Vectors_0.14.3     BiocGenerics_0.22.0 colorout_1.1-2

loaded via a namespace (and not attached):
[1] zlibbioc_1.22.0         compiler_3.4.0 XVector_0.16.0
[4] GenomeInfoDbData_0.99.0 RCurl_1.95-4.8 bitops_1.0-6

-- 
Robert Castelo, PhD
Associate Professor
Dept. of Experimental and Health Sciences
Universitat Pompeu Fabra (UPF)
Barcelona Biomedical Research Park (PRBB)
Dr Aiguader 88
E-08003 Barcelona, Spain
telf: +34.933.160.514
fax: +34.933.160.550



More information about the Bioc-devel mailing list