[Bioc-sig-seq] GenomicRanges endoapply Error

Dario Strbenac D.Strbenac at garvan.org.au
Wed Sep 15 09:00:09 CEST 2010


Hello,

I get a problem when I build up my GRangesList element by element.

e.g.

> gRangesList <- GRangesList()
> load("C:/Users/dario/Documents/Garvan/rawData/seq/Ramaciotti/22-02-2010/s_8_1/PrEC_INPUT_1_GR.Rdata") #loads object called 'rs'
> head(rs)
GRanges with 6 ranges and 0 elementMetadata values
    seqnames       ranges strand |
       <Rle>    <IRanges>  <Rle> |
[1]     chr1 [ 482,  482]      - |
[2]     chr1 [ 637,  637]      - |
[3]     chr1 [4818, 4818]      - |
[4]     chr1 [6322, 6322]      - |
[5]     chr1 [7375, 7375]      - |
[6]     chr1 [9138, 9138]      - |

seqlengths
      chr1     chr10     chr11     chr12     chr13     chr14     chr15     chr16     chr17     chr18 ...      chr3      chr4      chr5      chr6      chr7      chr8      chr9      chrM      chrX      chrY
 247249719 135374737 134452384 132349534 114142980 106368585 100338915  88827254  78774742  76117153 ... 199501827 191273063 180857866 170899992 158821424 146274826 140273252     16571 154913754  57772954
> gRangesList[[1]] <- rs
> load("C:/Users/dario/Documents/Garvan/rawData/seq/Ramaciotti/25-03-2010/s_8_1/LNCaP_INPUT_1_GR.Rdata") # loads another object called 'rs'
> head(rs)
GRanges with 6 ranges and 0 elementMetadata values
    seqnames         ranges strand |
       <Rle>      <IRanges>  <Rle> |
[1]     chr1 [  277,   277]      - |
[2]     chr1 [ 6163,  6163]      - |
[3]     chr1 [ 7357,  7357]      - |
[4]     chr1 [45011, 45011]      - |
[5]     chr1 [48676, 48676]      - |
[6]     chr1 [48945, 48945]      - |

seqlengths
      chr1     chr10     chr11     chr12     chr13     chr14     chr15     chr16     chr17     chr18 ...      chr3      chr4      chr5      chr6      chr7      chr8      chr9      chrM      chrX      chrY
 247249719 135374737 134452384 132349534 114142980 106368585 100338915  88827254  78774742  76117153 ... 199501827 191273063 180857866 170899992 158821424 146274826 140273252     16571 154913754  57772954
> gRangesList[[2]] <- rs
> 
> endoapply(gRangesList, resize, seqLen)
Error in validObject(.Object) : 
  invalid class "GRangesList" object: number of rows in non-NULL 'elementMetadata(x)' must match length of 'x'

Whereas, using the GRangesList constructor is problem free :

> gr1 <-
+ GRanges(seqnames = "chr2", ranges = IRanges(3, 6),
+ strand = "+", score = 5L, GC = 0.45)
> gr2 <-
+ GRanges(seqnames = c("chr1", "chr1"),
+ ranges = IRanges(c(7,13), width = 3),
+ strand = c("+", "-"), score = 3:4, GC = c(0.3, 0.5))
> gr3 <-
+ GRanges(seqnames = c("chr1", "chr2"),
+ ranges = IRanges(c(1, 4), c(3, 9)),
+ strand = c("-", "-"), score = c(6L, 2L), GC = c(0.4, 0.1))
> grl <- GRangesList("gr1" = gr1, "gr2" = gr2, "gr3" = gr3)
> xtnd <- endoapply(grl, resize, seqLen)

> sessionInfo()
R version 2.11.1 (2010-05-31) 
x86_64-pc-mingw32 

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252    LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                       LC_TIME=English_Australia.1252    

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

other attached packages:
 [1] BSgenome.Hsapiens.UCSC.hg18_1.3.16 DNAcopy_1.22.0                     chipseq_0.4.0                      ShortRead_1.6.2                    Rsamtools_1.0.0                   
 [6] lattice_0.18-8                     BSgenome_1.16.0                    Biostrings_2.16.0                  GenomicRanges_1.0.9                IRanges_1.6.17                    

loaded via a namespace (and not attached):
[1] Biobase_2.8.0 grid_2.11.1   hwriter_1.2   tools_2.11.1 

--------------------------------------
Dario Strbenac
Research Assistant
Cancer Epigenetics
Garvan Institute of Medical Research
Darlinghurst NSW 2010
Australia



More information about the Bioc-sig-sequencing mailing list