[Bioc-devel] bug when coercing from list to SimpleList

2014-09-05 Thread Hervé Pagès

Hi Michael,

I found the following bug when coercing a list to a SimpleList
with IRanges devel (not with IRanges release):

  library(IRanges)
  x - list(a=matrix(rep(a, 6), nrow=3),
b=array(rep(b, 24), dim=c(3,4,2)))

Then:

   sapply(as(x, SimpleList), class)
 ab
  matrix matrix

   lapply(as(x, SimpleList), dim)
  $a
  [1] 3 2

  $b
  [1] 24  1

The array was turned into a matrix!

Note that the SimpleList() constructor behaves as expected:

   sapply(SimpleList(x), class)
 ab
  matrix  array

   lapply(SimpleList(x), dim)
  $a
  [1] 3 2

  $b
  [1] 3 4 2

Do you think you can have a look?

Thanks,
H.

 sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-unknown-linux-gnu (64-bit)

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

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

other attached packages:
[1] IRanges_1.99.25 S4Vectors_0.1.5 BiocGenerics_0.11.4

loaded via a namespace (and not attached):
[1] stats4_3.1.0

--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpa...@fhcrc.org
Phone:  (206) 667-5791
Fax:(206) 667-1319

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


Re: [Bioc-devel] bug when coercing from list to SimpleList

2014-09-05 Thread Michael Lawrence
Thanks, just a typo. Fixed in S4Vectors 0.2.1.


On Fri, Sep 5, 2014 at 12:38 AM, Hervé Pagès hpa...@fhcrc.org wrote:

 Hi Michael,

 I found the following bug when coercing a list to a SimpleList
 with IRanges devel (not with IRanges release):

   library(IRanges)
   x - list(a=matrix(rep(a, 6), nrow=3),
 b=array(rep(b, 24), dim=c(3,4,2)))

 Then:

sapply(as(x, SimpleList), class)
  ab
   matrix matrix

lapply(as(x, SimpleList), dim)
   $a
   [1] 3 2

   $b
   [1] 24  1

 The array was turned into a matrix!

 Note that the SimpleList() constructor behaves as expected:

sapply(SimpleList(x), class)
  ab
   matrix  array

lapply(SimpleList(x), dim)
   $a
   [1] 3 2

   $b
   [1] 3 4 2

 Do you think you can have a look?

 Thanks,
 H.

  sessionInfo()
 R version 3.1.0 (2014-04-10)
 Platform: x86_64-unknown-linux-gnu (64-bit)

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

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

 other attached packages:
 [1] IRanges_1.99.25 S4Vectors_0.1.5 BiocGenerics_0.11.4

 loaded via a namespace (and not attached):
 [1] stats4_3.1.0

 --
 Hervé Pagès

 Program in Computational Biology
 Division of Public Health Sciences
 Fred Hutchinson Cancer Research Center
 1100 Fairview Ave. N, M1-B514
 P.O. Box 19024
 Seattle, WA 98109-1024

 E-mail: hpa...@fhcrc.org
 Phone:  (206) 667-5791
 Fax:(206) 667-1319

 ___
 Bioc-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/bioc-devel


[[alternative HTML version deleted]]

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel