[BioC] IRanges::rbind with names stopped working

Patrick Aboyoun paboyoun at fhcrc.org
Wed Feb 3 18:59:56 CET 2010


Robert,
Thanks for the bug report. I noticed the same problem yesterday and 
checked in a patch earlier this morning to IRanges in BioC 2.6/R-devel 
that corrects this issue. The updated package should be available 
tomorrow at bioconductor.org or now via the Bioconductor svn.


library(IRanges, warn.conflicts=FALSE)

rd1 <- RangedData(IRanges(start=1:3,
                          end=4:6))
rd2 <- RangedData(IRanges(start=1:3,
                          end=4:6))
rbind(rd1, rd2)
RangedData with 6 rows and 0 value columns across 1 space
        space    ranges |
  <character> <IRanges> |
1           1    [1, 4] |
2           1    [2, 5] |
3           1    [3, 6] |
4           1    [1, 4] |
5           1    [2, 5] |
6           1    [3, 6] |

rd1 <- RangedData(IRanges(start=1:3,
                          end=4:6,
                          name=letters[1:3]))
rd2 <- RangedData(IRanges(start=1:3,
                          end=4:6,
                          name=letters[4:6]))
rbind(rd1, rd2)
RangedData with 6 rows and 0 value columns across 1 space
        space    ranges |
  <character> <IRanges> |
a           1    [1, 4] |
b           1    [2, 5] |
c           1    [3, 6] |
d           1    [1, 4] |
e           1    [2, 5] |
f           1    [3, 6] |

sessionInfo()
R version 2.11.0 Under development (unstable) (2010-02-01 r51089)
i386-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.5.39




Robert Castelo wrote:
> hi Michael, thanks for addressing this quick. it works now in devel for
> the case of RangedData with names but it seems to have broken for the
> case without names, although i'm not sure if maybe this is an intended
> behavior, please let me know.
>
> library(IRanges, warn.conflicts=FALSE)
>
> rd1 <- RangedData(IRanges(start=1:3,
>                           end=4:6))
> rd2 <- RangedData(IRanges(start=1:3,
>                           end=4:6))
> rbind(rd1, rd2)
> Error in `rownames<-`(`*tmp*`, value = character(0)) : 
>   invalid rownames length
>
> rd1 <- RangedData(IRanges(start=1:3,
>                           end=4:6,
>                           name=letters[1:3]))
> rd2 <- RangedData(IRanges(start=1:3,
>                           end=4:6,
>                           name=letters[4:6]))
> rbind(rd1, rd2)
> RangedData with 6 rows and 0 value columns across 1 space
>         space    ranges |
>   <character> <IRanges> |
> a           1    [1, 4] |
> b           1    [2, 5] |
> c           1    [3, 6] |
> d           1    [1, 4] |
> e           1    [2, 5] |
> f           1    [3, 6] |
>
> sessionInfo()
> R version 2.11.0 Under development (unstable) (2009-10-06 r49948) 
> x86_64-unknown-linux-gnu 
>
> locale:
> [1] C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods
> base     
>
> other attached packages:
> [1] IRanges_1.5.38
>
>
> cheers,
> robert.
>
>
>
> On Tue, 2010-02-02 at 05:11 -0800, Michael Lawrence wrote:
>   
>> Sorry, this is fixed now in 2.6.
>>
>> Michael
>>
>> On Tue, Feb 2, 2010 at 3:04 AM, Robert Castelo
>> <robert.castelo at upf.edu> wrote:
>>         dear list, and particularly the IRanges developers,
>>         
>>         i'm porting from BioC 2.4 to BioC 2.6 a script which is doing
>>         rbind on
>>         two RangedData objects and have noticed that this operation
>>         (rbind) now
>>         doesn't work when the ranges have names.
>>         
>>         i'm reproducing below the situation with BioC 2.4, 2.5 and 2.6
>>         where for
>>         the latter two versions of BioC this functionality fails.
>>         
>>         *** BioC 2.4
>>         
>>         library(IRanges, warn.conflicts=FALSE)
>>         
>>         rd1 <- RangedData(IRanges(start=1:3,
>>                                  end=4:6))
>>         rd2 <- RangedData(IRanges(start=1:3,
>>                                  end=4:6))
>>         rbind(rd1, rd2)
>>         RangedData: 6 ranges by 0 columns
>>         columns(0):
>>         sequences(0):
>>         rd1 <- RangedData(IRanges(start=1:3,
>>                                  end=4:6,
>>                                  name=letters[1:3]))
>>         rd2 <- RangedData(IRanges(start=1:3,
>>                                  end=4:6,
>>                                  name=letters[4:6]))
>>         rbind(rd1, rd2)
>>         RangedData: 6 ranges by 0 columns
>>         columns(0):
>>         sequences(0):
>>         sessionInfo()
>>         R version 2.9.1 (2009-06-26)
>>         x86_64-unknown-linux-gnu
>>         
>>         locale:
>>         C
>>         
>>         attached base packages:
>>         [1] stats     graphics  grDevices utils     datasets  methods
>>         base
>>         
>>         other attached packages:
>>         [1] IRanges_1.2.3
>>         
>>         
>>         ** BioC 2.5
>>         
>>         library(IRanges, warn.conflicts=FALSE)
>>         
>>         rd1 <- RangedData(IRanges(start=1:3,
>>                                  end=4:6))
>>         rd2 <- RangedData(IRanges(start=1:3,
>>                                  end=4:6))
>>         rbind(rd1, rd2)
>>         RangedData with 6 rows and 0 value columns across 1 space
>>                space    ranges |
>>          <character> <IRanges> |
>>         1           1    [1, 4] |
>>         2           1    [2, 5] |
>>         3           1    [3, 6] |
>>         4           1    [1, 4] |
>>         5           1    [2, 5] |
>>         6           1    [3, 6] |
>>         rd1 <- RangedData(IRanges(start=1:3,
>>                                  end=4:6,
>>                                  name=letters[1:3]))
>>         rd2 <- RangedData(IRanges(start=1:3,
>>                                  end=4:6,
>>                                  name=letters[4:6]))
>>         rbind(rd1, rd2)
>>         Error in validObject(.Object) :
>>          invalid class "RangedData" object: the names of the ranges
>>         must equal
>>         the rownames
>>         sessionInfo()
>>         R version 2.10.0 (2009-10-26)
>>         x86_64-unknown-linux-gnu
>>         
>>         locale:
>>         [1] C
>>         
>>         attached base packages:
>>         [1] stats     graphics  grDevices utils     datasets  methods
>>         base
>>         
>>         other attached packages:
>>         [1] IRanges_1.4.10
>>         
>>         ** BioC 2.6
>>         
>>         library(IRanges, warn.conflicts=FALSE)
>>         
>>         rd1 <- RangedData(IRanges(start=1:3,
>>                                  end=4:6))
>>         rd2 <- RangedData(IRanges(start=1:3,
>>                                  end=4:6))
>>         rbind(rd1, rd2)
>>         RangedData with 6 rows and 0 value columns across 1 space
>>                space    ranges |
>>          <character> <IRanges> |
>>         1           1    [1, 4] |
>>         2           1    [2, 5] |
>>         3           1    [3, 6] |
>>         4           1    [1, 4] |
>>         5           1    [2, 5] |
>>         6           1    [3, 6] |
>>         rd1 <- RangedData(IRanges(start=1:3,
>>                                  end=4:6,
>>                                  name=letters[1:3]))
>>         rd2 <- RangedData(IRanges(start=1:3,
>>                                  end=4:6,
>>                                  name=letters[4:6]))
>>         rbind(rd1, rd2)
>>         Error in validObject(.Object) :
>>          invalid class "RangedData" object: the names of the ranges
>>         must equal
>>         the rownames
>>         sessionInfo()
>>         R version 2.11.0 Under development (unstable) (2009-10-06
>>         r49948)
>>         x86_64-unknown-linux-gnu
>>         
>>         locale:
>>         [1] C
>>         
>>         attached base packages:
>>         [1] stats     graphics  grDevices utils     datasets  methods
>>         base
>>         
>>         other attached packages:
>>         [1] IRanges_1.5.37
>>         
>>         
>>         thanks!
>>         robert.
>>         
>>         _______________________________________________
>>         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
>>
>>     
>
> _______________________________________________
> 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