[BioC] IRanges: setting score() on RangedData drops rownames

Michael Dondrup Michael.Dondrup at uni.no
Thu Mar 18 17:43:02 CET 2010


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



More information about the Bioconductor mailing list