IRanges glitch: error restoring saved RangedData object
1
0
Entering edit mode
@michael-dondrup-3849
Last seen 10.2 years ago
Hi, I guess I found a little bug in IRanges. When loading a saved RangedData object before loading library(IRanges) before, then IRanges is loaded automatically but the RangeData object is rendered unusable. Only restarting R lets me access the object. The following code reproduces this: $ R --vanilla version 2.11.1 (2010-05-31)... > library(IRanges) > rd = RangedData(IRanges(start=c(1:10), width=2, names=letters[1:10]), space="chr1", score=rnorm(10)) > rd RangedData with 10 rows and 1 value column across 1 space space ranges | score <character> <iranges> | <numeric> a chr1 [ 1, 2] | -0.79949926 b chr1 [ 2, 3] | 1.09152227 c chr1 [ 3, 4] | 0.19032854 d chr1 [ 4, 5] | 0.37248408 e chr1 [ 5, 6] | 0.68396618 f chr1 [ 6, 7] | -1.19804918 g chr1 [ 7, 8] | 0.01221636 h chr1 [ 8, 9] | 0.66203090 i chr1 [ 9, 10] | 0.39848133 j chr1 [10, 11] | 0.15233945 > save(rd, file="rd.r") > q() # restart R $ R --vanilla > load("rd.r") > rd Loading required package: IRanges Attaching package: 'IRanges' The following object(s) are masked from 'package:base': cbind, Map, mapply, order, paste, pmax, pmax.int, pmin, pmin.int, rbind, rep.int, table RangedData with 10 rows and 1 column Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to array extent > Note that this depends on presence of rownames. If you make an object rd = RangedData(IRanges(start=c(1:10), width=2), space="chr1", score=rnorm(10)) without named IRanges, the result after loading is > rd Loading required package: IRanges Attaching package: 'IRanges' The following object(s) are masked from 'package:base': cbind, Map, mapply, order, paste, pmax, pmax.int, pmin, pmin.int, rbind, rep.int, table RangedData with 10 rows and 1 column chr1 <rangeddata> 1 ######## > sessionInfo() R version 2.11.1 (2010-05-31) x86_64-unknown-linux-gnu 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=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=no_NO.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=no_NO.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] IRanges_1.6.11 >
IRanges IRanges • 965 views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 4 months ago
United States
Hi Michael -- I think this is a problem in the methods package; the 'show' method found is for DataTable, instead of RangedData. I'll pursue this elsewhere and let you know what comes of it. Martin On 08/13/2010 02:44 AM, Michael Dondrup wrote: > Hi, > I guess I found a little bug in IRanges. When loading a saved RangedData object before loading library(IRanges) > before, then IRanges is loaded automatically but the RangeData object is rendered unusable. Only restarting R lets me access > the object. > The following code reproduces this: > $ R --vanilla > version 2.11.1 (2010-05-31)... >> library(IRanges) >> rd = RangedData(IRanges(start=c(1:10), width=2, names=letters[1:10]), space="chr1", score=rnorm(10)) >> rd > RangedData with 10 rows and 1 value column across 1 space > space ranges | score > <character> <iranges> | <numeric> > a chr1 [ 1, 2] | -0.79949926 > b chr1 [ 2, 3] | 1.09152227 > c chr1 [ 3, 4] | 0.19032854 > d chr1 [ 4, 5] | 0.37248408 > e chr1 [ 5, 6] | 0.68396618 > f chr1 [ 6, 7] | -1.19804918 > g chr1 [ 7, 8] | 0.01221636 > h chr1 [ 8, 9] | 0.66203090 > i chr1 [ 9, 10] | 0.39848133 > j chr1 [10, 11] | 0.15233945 >> save(rd, file="rd.r") >> q() > # restart R > $ R --vanilla >> load("rd.r") >> rd > Loading required package: IRanges > > Attaching package: 'IRanges' > > The following object(s) are masked from 'package:base': > > cbind, Map, mapply, order, paste, pmax, pmax.int, pmin, pmin.int, > rbind, rep.int, table > > RangedData with 10 rows and 1 column > Error in dimnames(x) <- dn : > length of 'dimnames' [1] not equal to array extent >> > > Note that this depends on presence of rownames. If you make an object > rd = RangedData(IRanges(start=c(1:10), width=2), space="chr1", score=rnorm(10)) > without named IRanges, the result after loading is >> rd > Loading required package: IRanges > > Attaching package: 'IRanges' > > The following object(s) are masked from 'package:base': > > cbind, Map, mapply, order, paste, pmax, pmax.int, pmin, pmin.int, > rbind, rep.int, table > > RangedData with 10 rows and 1 column > chr1 > <rangeddata> > 1 ######## > >> sessionInfo() > R version 2.11.1 (2010-05-31) > x86_64-unknown-linux-gnu > > 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=C LC_MESSAGES=en_US.UTF-8 > [7] LC_PAPER=no_NO.UTF-8 LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=no_NO.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] IRanges_1.6.11 >> > > > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793
ADD COMMENT

Login before adding your answer.

Traffic: 973 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6