[Bioc-devel] Biostrings: XStringViews subsetting operator does not reduce element metadata

Jiří Hon xhonji01 at stud.fit.vutbr.cz
Thu Feb 21 13:46:46 CET 2013


Hi,
I found out, that XStringViews/Views subsetting operator does not reduce  
element metadata as I would expect. See the following example. It is  
reproducible in both stable (2.11) and development (2.12) versions of  
Bioconductor.

------------------------------------------------
library(Biostrings)
x <- Views(DNAString("GAA"), 1:2, 2:3)
elementMetadata(x) <- DataFrame(score=3:4)
y <- x[1]
elementMetadata(y) <- elementMetadata(y)
------------------------------------------------

The example fails with following error message:

------------------------------------------------
Error in `elementMetadata<-`(`*tmp*`, value = <S4 object of class  
"DataFrame">) :
   the number of rows in elementMetadata 'value' (if non-NULL) must match  
the length of 'x'
------------------------------------------------

Output of sessionInfo()

------------------------------------------------
R version 2.15.2 (2012-10-26)
Platform: x86_64-pc-linux-gnu (64-bit)

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

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

other attached packages:
[1] Biostrings_2.26.3  IRanges_1.16.5     BiocGenerics_0.4.0

loaded via a namespace (and not attached):
[1] parallel_2.15.2 stats4_2.15.2
------------------------------------------------

As I do not orient well in XStringViews inheritance structure, I can't  
even guess, where a significance change was made. I only know that in Bioc  
2.8.4 (R 2.13.1) is this example fully functional.

Please take a look at this issue and if it's not a bug, but a feature,  
please be patient and explain.

Thanks a lot

Jirka



More information about the Bioc-devel mailing list