[Bioc-devel] as.list fails on IRanges inside of lapply(<IRanges>, blah)

Gabe Becker becker.gabe at gene.com
Tue Feb 20 18:41:29 CET 2018


All,

I'm trying to track down the new failure in my genbankr package and it
appears to come down to the fact  that i'm trying to lapply over an
IRanges, which fails in the IRanges to list (or List?) conversion. The
particular case that fails in my example is an IRanges of length 1 but that
does not appear to matter, as lapply fails over IRanges of length >1 as
well.

Is this intentional? If so, it seems a change of this magnitude would
warrant a deprecation cycle at least. If not, please let me know so I can
leave the code as is and wait for the fix.

> rng1 = IRanges(start = 1, end = 5)

> rng2 = IRanges(start = c(1, 7), end = c(3, 10))

> rng1

IRanges object with 1 range and 0 metadata columns:

          start       end     width

      <integer> <integer> <integer>

  [1]         1         5         5

> rng2

IRanges object with 2 ranges and 0 metadata columns:

          start       end     width

      <integer> <integer> <integer>

  [1]         1         3         3

  [2]         7        10         4

> lapply(rng1, identity)

*Error in (function (classes, fdef, mtable)  : *

*  unable to find an inherited method for function ‘getListElement’ for
signature ‘"IRanges"’*

> lapply(rng2, identity)

*Error in (function (classes, fdef, mtable)  : *

*  unable to find an inherited method for function ‘getListElement’ for
signature ‘"IRanges"’*

> sessionInfo()

R Under development (unstable) (2018-02-16 r74263)

Platform: x86_64-apple-darwin15.6.0 (64-bit)

Running under: OS X El Capitan 10.11.6


Matrix products: default

BLAS:
/Users/beckerg4/local/Rdevel/R.framework/Versions/3.5/Resources/lib/libRblas.dylib

LAPACK:
/Users/beckerg4/local/Rdevel/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib


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] stats4    parallel  stats     graphics  grDevices utils     datasets

[8] methods   base


other attached packages:

*[1] IRanges_2.13.26     S4Vectors_0.17.33   BiocGenerics_0.25.3*


loaded via a namespace (and not attached):

[1] compiler_3.5.0 tools_3.5.0



Best,
~G



-- 
Gabriel Becker, Ph.D
Scientist
Bioinformatics and Computational Biology
Genentech Research

	[[alternative HTML version deleted]]



More information about the Bioc-devel mailing list