hi,

I came across an error in trying to subset a GRangesList with metadata
columns on the metadata columns:

> library(GenomicRanges)

> grl <- GRangesList(GRanges(),GRanges())

> mcols(grl) <- DataFrame(a=1:2)

> mcols(mcols(grl)) <- DataFrame(type="z")

> grl[1:2]

Error in normalizeSingleBracketSubscript(i, x, byrow = TRUE) :
  subscript contains NAs or out of bounds indices
Calls: [ ... extractROWS -> extractROWS -> normalizeSingleBracketSubscript

Also grl[2] produces the same error, while grl[1] does not.  traceback and
sessionInfo below.

thanks,

Mike


> grl[2]
Error in normalizeSingleBracketSubscript(i, x, byrow = TRUE) :
  subscript contains NAs or out of bounds indices
Calls: [ ... extractROWS -> extractROWS -> normalizeSingleBracketSubscript
> traceback()
18: stop("subscript contains NAs or out of bounds indices")
17: normalizeSingleBracketSubscript(i, x, byrow = TRUE)
16: extractROWS(x@elementMetadata, i)
15: extractROWS(x@elementMetadata, i)
14: extractROWS(x@elementMetadata, i)
13: extractROWS(x@elementMetadata, i)
12: extractROWS(x, i)
11: extractROWS(x, i)
10: .nextMethod(x, i)
9: eval(expr, envir, enclos)
8: eval(call, callEnv)
7: callNextMethod(x, i)
6: .nextMethod(x = x, i = i)
5: eval(expr, envir, enclos)
4: eval(call, callEnv)
3: callNextMethod(x = x, i = i)
2: grl[2]
1: grl[2]

> sessionInfo()
R Under development (unstable) (2013-09-12 r63919)
Platform: x86_64-apple-darwin12.3.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] GenomicRanges_1.13.42 XVector_0.1.2         IRanges_1.19.33
[4] BiocGenerics_0.7.5    knitr_1.2             BiocInstaller_1.11.4
[7] Defaults_1.1-1

loaded via a namespace (and not attached):
[1] digest_0.6.3   evaluate_0.4.3 formatR_0.7    stats4_3.1.0
stringr_0.6.2
[6] tools_3.1.0

	[[alternative HTML version deleted]]

