[BioC] IRanges: RangedData rbind error

Jonathan Cairns Jonathan.Cairns at cancer.org.uk
Wed Nov 24 15:09:06 CET 2010


Hi all,

I seem to be getting an error message on trying to use rbind() on two relatively innocuous-looking RangedData objects - see below. I was wondering if anyone else has had the same problem. This works fine on simpler objects, so my guess would be that these particular objects are malformed in some way but I'm not sure how I would check that.

I can get around this by manually coercing each RangedData object to a data.frame, but that approach seems suboptimal to me.

Thanks,

Jonathan

--------

> a
RangedData with 3032 rows and 0 value columns across 25 spaces
           space                 ranges   |
     <character>              <IRanges>   |
1           chr1     [1274369, 1274619]   |
2           chr1     [1310219, 1310569]   |
3           chr1     [1907419, 1907769]   |
4           chr1     [1983269, 1983469]   |
5           chr1     [2355219, 2355319]   |
6           chr1     [2431369, 2432219]   |
7           chr1     [2446219, 2446619]   |
8           chr1     [3441819, 3442169]   |
9           chr1     [3657769, 3657919]   |
...          ...                    ... ...
3024        chrX [106724271, 106724371]   |
3025        chrX [106983671, 106983771]   |
3026        chrX [108586171, 108586271]   |
3027        chrX [108781571, 108781671]   |
3028        chrX [110424871, 110425571]   |
3029        chrX [152256221, 152256371]   |
3030        chrX [152619071, 152619221]   |
3031        chrX [152661471, 152662221]   |
3032        chrX [152662571, 152662671]   |

> names(a) ##n.b. no ranges present for space "chrM"
 [1] "chr1"  "chr10" "chr11" "chr12" "chr13" "chr14" "chr15" "chr16" "chr17"
[10] "chr18" "chr19" "chr2"  "chr20" "chr21" "chr22" "chr3"  "chr4"  "chr5" 
[19] "chr6"  "chr7"  "chr8"  "chr9"  "chrM"  "chrX"  "chrY"  

> b
RangedData with 6486 rows and 0 value columns across 23 spaces
           space                 ranges   |
     <character>              <IRanges>   |
1           chr1     [1274159, 1274912]   |
2           chr1     [1309807, 1310770]   |
3           chr1     [1532507, 1532754]   |
4           chr1     [1907180, 1907982]   |
5           chr1     [1983127, 1983848]   |
6           chr1     [2354988, 2355437]   |
7           chr1     [2431031, 2432299]   |
8           chr1     [2433599, 2433985]   |
9           chr1     [2446015, 2446750]   |
...          ...                    ... ...
6478        chrX [152618904, 152619429]   |
6479        chrX [152660747, 152661246]   |
6480        chrX [152661264, 152662298]   |
6481        chrX [152662420, 152662899]   |
6482        chrX [152664180, 152664467]   |
6483        chrX [152665288, 152665502]   |
6484        chrX [152758426, 152758742]   |
6485        chrX [153591715, 153591957]   |
6486        chrX [153849434, 153849749]   |

> names(b) ## (chrY, chrM not present in this object)
 [1] "chr1"  "chr10" "chr11" "chr12" "chr13" "chr14" "chr15" "chr16" "chr17"
[10] "chr18" "chr19" "chr2"  "chr20" "chr21" "chr22" "chr3"  "chr4"  "chr5" 
[19] "chr6"  "chr7"  "chr8"  "chr9"  "chrX" 

> rbind(a,b)
Error in .Method(..., deparse.level = deparse.level) : 
  column names for arg 23 do not match those of first arg

> traceback()
17: stop("column names for arg ", i, " do not match those of first arg")
16: .Method(..., deparse.level = deparse.level)
15: eval(expr, envir, enclos)
14: eval(.dotsCall, env)
13: eval(.dotsCall, env)
12: standardGeneric("rbind")
11: function (..., deparse.level = 1) 
    standardGeneric("rbind")(<S4 object of class "DataFrame">, <S4 object of class "DataFrame">, 
        <S4 object of class "DataFrame">, <S4 object of class "DataFrame">, 
        <S4 object of class "DataFrame">, <S4 object of class "DataFrame">, 
        <S4 object of class "DataFrame">, <S4 object of class "DataFrame">, 
        <S4 object of class "DataFrame">, <S4 object of class "DataFrame">, 
        <S4 object of class "DataFrame">, <S4 object of class "DataFrame">, 
        <S4 object of class "DataFrame">, <S4 object of class "DataFrame">, 
        <S4 object of class "DataFrame">, <S4 object of class "DataFrame">, 
        <S4 object of class "DataFrame">, <S4 object of class "DataFrame">, 
        <S4 object of class "DataFrame">, <S4 object of class "DataFrame">, 
        <S4 object of class "DataFrame">, <S4 object of class "DataFrame">, 
        <S4 object of class "DataFrame">, <S4 object of class "DataFrame">, 
        <S4 object of class "DataFrame">)
10: do.call(rbind, unname(x))
9: .compress.list(lapply(unlistData, as, elementTypeData))
8: newCompressedList("CompressedSplitDataFrameList", listData)
7: SplitDataFrameList(do.call(Map, c(list(safe.rbind), dfs)))
6: .Method(..., deparse.level = deparse.level)
5: eval(expr, envir, enclos)
4: eval(.dotsCall, env)
3: eval(.dotsCall, env)
2: standardGeneric("rbind")
1: rbind(a, b)

> sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_GB.utf8       LC_NUMERIC=C             
 [3] LC_TIME=en_GB.utf8        LC_COLLATE=en_GB.utf8    
 [5] LC_MONETARY=C             LC_MESSAGES=en_GB.utf8   
 [7] LC_PAPER=en_GB.utf8       LC_NAME=C                
 [9] LC_ADDRESS=C              LC_TELEPHONE=C           
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C      

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rtracklayer_1.10.0 RCurl_1.4-3        bitops_1.0-4.1     IRanges_1.8.2     

loaded via a namespace (and not attached):
[1] Biobase_2.10.0      Biostrings_2.18.0   BSgenome_1.18.0    
[4] GenomicRanges_1.2.1 tools_2.12.0        XML_3.2-0          


This communication is from Cancer Research UK. Our website is at www.cancerresearchuk.org. We are a registered charity in England and Wales (1089464) and in Scotland (SC041666) and a company limited by guarantee registered in England and Wales under number 4325234. Our registered address is Angel Building, 407 St John Street, London, EC1V 4AD. Our central telephone number is 020 7242 0200.
 
This communication and any attachments contain information which is confidential and may also be privileged.   It is for the exclusive use of the intended recipient(s).  If you are not the intended recipient(s) please note that any form of disclosure, distribution, copying or use of this communication or the information in it or in any attachments is strictly prohibited and may be unlawful.  If you have received this communication in error, please notify the sender and delete the email and destroy any copies of it.
 
E-mail communications cannot be guaranteed to be secure or error free, as information could be intercepted, corrupted, amended, lost, destroyed, arrive late or incomplete, or contain viruses.  We do not accept liability for any such matters or their consequences.  Anyone who communicates with us by e-mail is taken to accept the risks in doing so.



More information about the Bioconductor mailing list