Skip to content
Prev 4663 / 21312 Next

[Bioc-devel] 'GRangesList' does not keep metadata of items

Related to the storage of a list inside a DataFrame (as a column),
I found 2 issues:

   df <- DataFrame(A=I(list(a=1:3, b="BB")))

1. The name of the col is not as specified:

     > df
     DataFrame with 2 rows and 1 column
              X
         <list>
     1 ########
     2 ########

2. rbind() doesn't work as expected:

     > rbind(df, df)
     DataFrame with 3 rows and 4 columns
             X.a         X.b     X.a.1       X.b.1
       <integer> <character> <integer> <character>
     1         1          BB         1          BB
     2         2          BB         2          BB
     3         3          BB         3          BB

   or it can break:

     > df <- DataFrame(A=I(list(a=1:3, b=character(0))))
     > rbind(df, df)
     Error in DataFrame(cols) : cannot coerce class "list" to a DataFrame

This last issue will break c() on GRangesList objects that have mcols
of the kind I showed previously.

Cheers,
H.


 > sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-unknown-linux-gnu (64-bit)

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=C                 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  stats     graphics  grDevices utils     datasets  methods
[8] base

other attached packages:
[1] GenomicRanges_1.13.39 XVector_0.1.0         IRanges_1.19.28
[4] BiocGenerics_0.7.4

loaded via a namespace (and not attached):
[1] stats4_3.0.1 tools_3.0.1
On 09/03/2013 02:40 PM, Herv? Pag?s wrote: