[BioC] IRanges::rbind with names stopped working

Robert Castelo robert.castelo at upf.edu
Wed Feb 3 12:46:21 CET 2010


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
>



More information about the Bioconductor mailing list