[BioC] GRangesList replacement method bug
Richard Bourgon
bourgon.richard at gene.com
Wed Dec 14 23:01:26 CET 2011
BioC team:
I encountered a bug with replacement methods for GRangesList objects (see below for code).
Basically, you can set to non-existant elementMetaData columns for a GRanges object, but not if it is a part of a GRangesList. Setting to already existing columns is fine, however.
Richard Bourgon, Ph.D.
Genentech, Inc.
Bioinformatics & Computational Biology
1 DNA Way, MS 93
South San Francisco, CA 94080-4990
(650) 467-2064
***
gr <- GRanges( "a", IRanges(1,10), x = TRUE )
grl <- GRangesList( y = gr, z = gr )
values( grl[["y"]] )$x <- FALSE # Fine for existing column
values( grl[["y"]] )$w <- FALSE # Fails for new column
Error in .Method(..., deparse.level = deparse.level) :
number of columns for arg 2 do not match those of first arg
values( gr )$w <- FALSE # No problem with new column here
sessionInfo()
R version 2.14.0 (2011-10-31)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] datasets utils grDevices graphics stats methods base
other attached packages:
[1] rtracklayer_1.14.4 RCurl_1.8-0 bitops_1.0-4.1 GenomicRanges_1.6.4
[5] IRanges_1.12.5 gdata_2.8.2 BiocInstaller_1.2.1
loaded via a namespace (and not attached):
[1] Biobase_2.14.0 Biostrings_2.22.0 BSgenome_1.22.0 gtools_2.6.2 tools_2.14.0
[6] XML_3.6-2 zlibbioc_1.0.0
More information about the Bioconductor
mailing list