IRanges: setting score() on RangedData drops rownames
2
0
Entering edit mode
@michael-dondrup-3849
Last seen 10.2 years ago
Hi, I observed this possibly unintended behavior of the score function in package IRanges: using 'score()<-' drops the rownames. Reproducible example. > rd1 = RangedData(ranges=IRanges(start=runif(4, min=1, max=10E8), width=runif(4, min=1, max=10E5), names=paste("bla",1:4)), space=1:2) > rownames(rd1) [1] "bla 1" "bla 3" "bla 2" "bla 4" > sessionInfo() R version 2.10.1 (2009-12-14) x86_64-apple-darwin9.8.0 locale: [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] IRanges_1.4.9 loaded via a namespace (and not attached): [1] tools_2.10.1 > > rd1 RangedData with 4 rows and 0 value columns across 2 spaces space ranges | <character> <iranges> | bla 1 1 [623833301, 624400493] | bla 3 1 [505448873, 505904729] | bla 2 2 [924959706, 925681728] | bla 4 2 [503293070, 504033700] | > rd1 RangedData with 4 rows and 1 value column across 2 spaces space ranges | score <character> <iranges> | <numeric> 1 1 [623833301, 624400493] | 0.2912978 2 1 [505448873, 505904729] | -0.5158529 3 2 [924959706, 925681728] | 0.7401251 4 2 [503293070, 504033700] | 1.1659967 > rownames(rd1) NULL
• 960 views
ADD COMMENT
0
Entering edit mode
Patrick Aboyoun ★ 1.6k
@patrick-aboyoun-6734
Last seen 10.2 years ago
United States
Michael, Thanks for the bug report! The issue was that the [[<-,RangedData method, which is called by score<-,RangedData, dropped row.names. This issue has been fixed in the BioC 2.5 IRanges (>= 1.4.15) and BioC 2.6 IRanges (>= 1.5.63) code lines and will be available at bioconductor.org within the next 36 hours. Patrick On 3/18/10 7:30 AM, Michael Dondrup wrote: > Hi, > I observed this possibly unintended behavior of the score function in package IRanges: > using 'score()<-' drops the rownames. > > Reproducible example. > >> rd1 = RangedData(ranges=IRanges(start=runif(4, min=1, max=10E8), width=runif(4, min=1, max=10E5), names=paste("bla",1:4)), space=1:2) >> rownames(rd1) >> > [1] "bla 1" "bla 3" "bla 2" "bla 4" > > >> sessionInfo() >> > R version 2.10.1 (2009-12-14) > x86_64-apple-darwin9.8.0 > > locale: > [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] IRanges_1.4.9 > > loaded via a namespace (and not attached): > [1] tools_2.10.1 > >>> rd1 >>> > RangedData with 4 rows and 0 value columns across 2 spaces > space ranges | > <character> <iranges> | > bla 1 1 [623833301, 624400493] | > bla 3 1 [505448873, 505904729] | > bla 2 2 [924959706, 925681728] | > bla 4 2 [503293070, 504033700] | > >> rd1 >> > RangedData with 4 rows and 1 value column across 2 spaces > space ranges | score > <character> <iranges> |<numeric> > 1 1 [623833301, 624400493] | 0.2912978 > 2 1 [505448873, 505904729] | -0.5158529 > 3 2 [924959706, 925681728] | 0.7401251 > 4 2 [503293070, 504033700] | 1.1659967 > >> rownames(rd1) >> > NULL > > _______________________________________________ > 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 >
ADD COMMENT
0
Entering edit mode
@michael-dondrup-3849
Last seen 10.2 years ago
Sorry, I copy-pasted a bit chaotic, the (ir-)reproducible example should look like this: > rd1 = RangedData(ranges=IRanges(start=runif(4, min=1, max=10E8), width=runif(4, min=1, max=10E5), names=paste("bla",1:4)), space=1:2) > rd1 RangedData with 4 rows and 0 value columns across 2 spaces space ranges | <character> <iranges> | bla 1 1 [623833301, 624400493] | bla 3 1 [505448873, 505904729] | bla 2 2 [924959706, 925681728] | bla 4 2 [503293070, 504033700] | > rownames(rd1) [1] "bla 1" "bla 3" "bla 2" "bla 4" > score(rd1) = rnorm(4) > rd1 RangedData with 4 rows and 1 value column across 2 spaces space ranges | score <character> <iranges> | <numeric> 1 1 [623833301, 624400493] | 0.2912978 2 1 [505448873, 505904729] | -0.5158529 3 2 [924959706, 925681728] | 0.7401251 4 2 [503293070, 504033700] | 1.1659967 > rownames(rd1) NULL Am Mar 18, 2010 um 3:30 PM schrieb Michael Dondrup: > Hi, > I observed this possibly unintended behavior of the score function in package IRanges: > using 'score()<-' drops the rownames. > > Reproducible example. >> rd1 = RangedData(ranges=IRanges(start=runif(4, min=1, max=10E8), width=runif(4, min=1, max=10E5), names=paste("bla",1:4)), space=1:2) >> rownames(rd1) > [1] "bla 1" "bla 3" "bla 2" "bla 4" > >> sessionInfo() > R version 2.10.1 (2009-12-14) > x86_64-apple-darwin9.8.0 > > locale: > [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] IRanges_1.4.9 > > loaded via a namespace (and not attached): > [1] tools_2.10.1 >>> rd1 > RangedData with 4 rows and 0 value columns across 2 spaces > space ranges | > <character> <iranges> | > bla 1 1 [623833301, 624400493] | > bla 3 1 [505448873, 505904729] | > bla 2 2 [924959706, 925681728] | > bla 4 2 [503293070, 504033700] | >> rd1 > RangedData with 4 rows and 1 value column across 2 spaces > space ranges | score > <character> <iranges> | <numeric> > 1 1 [623833301, 624400493] | 0.2912978 > 2 1 [505448873, 505904729] | -0.5158529 > 3 2 [924959706, 925681728] | 0.7401251 > 4 2 [503293070, 504033700] | 1.1659967 >> rownames(rd1) > NULL > > _______________________________________________ > 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
ADD COMMENT

Login before adding your answer.

Traffic: 571 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