R 3.5.0/Bioconductor version 3.6: OS-dependent behavior divergence for list concatenation of SummarizedExperiment
1
0
Entering edit mode
balin • 0
@balin-15829
Last seen 6.0 years ago

Consider the following code:

nrows <- 200; ncols <- 6
counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
rowRanges <- GenomicRanges::GRanges(rep(c("chr1", "chr2"), c(50, 150)),
               IRanges::IRanges(floor(runif(200, 1e5, 1e6)), width=100),
               strand=sample(c("+", "-"), 200, TRUE),
               feature_id=sprintf("ID%03d", 1:200))
colData <- S4Vectors::DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
               row.names=LETTERS[1:6])
rse <- SummarizedExperiment::SummarizedExperiment(
               assays=S4Vectors::SimpleList(counts=counts),
               rowRanges=rowRanges, colData=colData)
c(rse,list())

This works fine when run on (Arch)Linux and produces

[[1]]
class: RangedSummarizedExperiment 
dim: 200 6 
metadata(0):
assays(1): counts
rownames: NULL
rowData names(1): feature_id
colnames(6): A B ... E F
colData names(1): Treatment

BUT on Windows the same code currently produces:

Error in as(from, to_class, strict = FALSE) :
  no method or default for coercing "list" to "RangedSummarizedExperiment"

I can provide sessionInfo() for both systems, but as there's no where to attach files here I wait until it's requested - is this even the right venue for BIOC bugreports?

summarizedexperiment bug 3.5.0 • 2.2k views
ADD COMMENT
0
Entering edit mode

Stepping back a bit, is this a sensible thing to expect to work? That a list() can be represented as a (Ranged)SummarizedExperiment ?

ADD REPLY
0
Entering edit mode
On Wed, 2018-05-16 at 13:22 +0000, Martin Morgan [bioc] wrote: > Activity on a post you are following on support.bioconductor.org > User Martin Morgan wrote Comment: R 3.5.0/Bioconductor version 3.6: > OS-dependent behavior divergence for list concatenation of > SummarizedExperiment: > Stepping back a bit, is this a sensible thing to expect to work? That > a list() can be represented as a (Ranged)SummarizedExperiment ? > Post tags: summarizedexperiment, bug, 3.5.0 > You may reply via email or visit Two Mailing lists for the Bioconductor project > 08958/#108973 @Martin Morgan OK. Sourcing `biocLite` from the homepage finally gave my the outdated error. Investigation into my `.libPaths` revealed that despite all my efforts to keep package libs project-specific, the (root-only writable) system library helt **old** bioc pakages including `BiocInstaller` ... that's remedied now and I am properly up to speed. Accordingly above concatenation now also fails for me. Why would that be the case with an up-to-date but not an old bioc version? Is that really intended behavior?
ADD REPLY
0
Entering edit mode

It's not intended behavior that you could concatenate a RangedSummarizedExperiment with some other random thing and have it work. By definition you should only be able to concatenate things of the same type, which is what I think Martin was getting at in his previous comment.

ADD REPLY
0
Entering edit mode
@james-w-macdonald-5106
Last seen 9 hours ago
United States

On Linux:

> nrows <- 200; ncols <- 6
> counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
> rowRanges <- GenomicRanges::GRanges(rep(c("chr1", "chr2"), c(50, 150)),
+                IRanges::IRanges(floor(runif(200, 1e5, 1e6)), width=100),
+                strand=sample(c("+", "-"), 200, TRUE),
+                feature_id=sprintf("ID%03d", 1:200))
> colData <- S4Vectors::DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
+                row.names=LETTERS[1:6])
> rse <- SummarizedExperiment::SummarizedExperiment(
+                assays=S4Vectors::SimpleList(counts=counts),
+                rowRanges=rowRanges, colData=colData)
> c(rse,list())
Error in as(from, to_class, strict = FALSE) :
  no method or default for coercing "list" to "RangedSummarizedExperiment"
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)

Matrix products: default
BLAS: /data/oldR/R-3.5.0/lib64/R/lib/libRblas.so
LAPACK: /data/oldR/R-3.5.0/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_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  stats4    stats     graphics  grDevices utils     datasets
[8] methods   base     

other attached packages:
 [1] SummarizedExperiment_1.10.0 DelayedArray_0.6.0         
 [3] BiocParallel_1.14.1         matrixStats_0.53.1         
 [5] Biobase_2.40.0              GenomicRanges_1.32.2       
 [7] GenomeInfoDb_1.16.0         IRanges_2.14.4             
 [9] S4Vectors_0.18.1            BiocGenerics_0.26.0  

And on Windows:

 

> nrows <- 200; ncols <- 6
> counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
> rowRanges <- GenomicRanges::GRanges(rep(c("chr1", "chr2"), c(50, 150)),
+                IRanges::IRanges(floor(runif(200, 1e5, 1e6)), width=100),
+                strand=sample(c("+", "-"), 200, TRUE),
+                feature_id=sprintf("ID%03d", 1:200))
> colData <- S4Vectors::DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
+                row.names=LETTERS[1:6])
> rse <- SummarizedExperiment::SummarizedExperiment(
+                assays=S4Vectors::SimpleList(counts=counts),
+                rowRanges=rowRanges, colData=colData)
> c(rse,list())
Error in as(from, to_class, strict = FALSE) :
  no method or default for coercing "list" to "RangedSummarizedExperiment"
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
 [1] SummarizedExperiment_1.10.0 DelayedArray_0.6.0         
 [3] BiocParallel_1.14.0         matrixStats_0.53.1         
 [5] Biobase_2.40.0              GenomicRanges_1.32.0       
 [7] GenomeInfoDb_1.16.0         IRanges_2.14.1             
 [9] S4Vectors_0.18.1            BiocGenerics_0.26.0   
ADD COMMENT
0
Entering edit mode

Weirder by the minute ... here's my (again error free) reproduction including sessionInfo() ...

I note a difference in SummarizedExperiment version (above 1.10., me 1.8), which BiocInstaller::biocLite(checkBuild=T) does not change ... where does that difference come from?

> nrows <- 200; ncols <- 6
> counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
> rowRanges <- GenomicRanges::GRanges(rep(c("chr1", "chr2"), c(50, 150)),
+                 IRanges::IRanges(floor(runif(200, 1e5, 1e6)), width=100),
+                 strand=sample(c("+", "-"), 200, TRUE),
+                 feature_id=sprintf("ID%03d", 1:200))
> colData <- S4Vectors::DataFrame(Treatment=rep(c("ChIP", "Input"), 3),
+                 row.names=LETTERS[1:6])
> rse <- SummarizedExperiment::SummarizedExperiment(
+                 assays=S4Vectors::SimpleList(counts=counts),
+                 rowRanges=rowRanges, colData=colData)
> c(rse,list())
[[1]]
class: RangedSummarizedExperiment 
dim: 200 6 
metadata(0):
assays(1): counts
rownames: NULL
rowData names(1): feature_id
colnames(6): A B ... E F
colData names(1): Treatment
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Arch Linux

Matrix products: default
BLAS: /usr/lib/libblas.so.3.8.0
LAPACK: /usr/lib/liblapack.so.3.8.0

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

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

loaded via a namespace (and not attached):
 [1] lattice_0.20-35            matrixStats_0.53.1         IRanges_2.12.0            
 [4] bitops_1.0-6               grid_3.5.0                 GenomeInfoDb_1.14.0       
 [7] switchr_0.12.7             stats4_3.5.0               zlibbioc_1.24.0           
[10] XVector_0.18.0             S4Vectors_0.16.0           Matrix_1.2-14             
[13] tools_3.5.0                Biobase_2.38.0             RCurl_1.95-4.10           
[16] DelayedArray_0.4.1         parallel_3.5.0             compiler_3.5.0            
[19] BiocGenerics_0.24.0        GenomicRanges_1.30.3       SummarizedExperiment_1.8.1
[22] GenomeInfoDbData_1.0.0
ADD REPLY
0
Entering edit mode

@balin is using R-3.5.0, but with Bioconductor 3.6; BiocInstaller::valid() will complain about invalid packages. Of course, updating will apparently break the installation...

ADD REPLY
0
Entering edit mode

@Martin Morgan

1) I have not down anything out of the ordinary (other than maintaining my dev environment in switchr) - is switchr known to generate this kind of R/bioc mismatch?

2) isn't it strange that the apparently mismatched R/bioc combination does the concatenation just fine, but your matched version doesn't?

ADD REPLY
0
Entering edit mode

I don't know how switchr works, but your package versions are not consistent with your R version.

It isn't the mismatch that causes problems, but the fact that in your sessionInfo you have different packages from those expected / that Jim has. For instance, you have SummarizedExperiment 1.8.1 which is from the Bioc 3.6 (R 3.4.*) release, whereas Jim has 1.10..0, which is from the Bioc 3.7 / R 3.5 release. 

ADD REPLY
0
Entering edit mode
> BiocInstaller::biocValid()
[1] TRUE
ADD REPLY
0
Entering edit mode
> BiocInstaller::biocLite('BiocUpgrade')
Error: Bioconductor version 3.6 cannot be upgraded with R version 3.5.0
ADD REPLY
0
Entering edit mode

I was misleading about biocValid(), sorry.  You should see

> library(BiocInstaller)
Warning: Bioconductor version 3.6 is too old for R version 3.5.0; see
  https://bioconductor.org/install/#troubleshoot-biocinstaller

'BIocUpgrade' is used to toggle between versions within an R release; follow the "Troubleshoot BiocInstaller" section at at http://bioconductor.org/install/#troubleshoot-bioconductor-packages

ADD REPLY
0
Entering edit mode

I don't ... loads without a hitch.

ADD REPLY
0
Entering edit mode

We could try trouble-shooting if you want, the end interpretation is that your packages are incorrect for your version of R.

The following should generate the warning message

BiocInstaller:::.onAttach()

It is generated based on the value of

BiocInstaller:::IS_END_OF_LIFE

which should be TRUE. It is set in 

BiocInstaller:::.onLoad

You could debug this

> debug(BiocInstaller:::.onLoad)
> BiocInstaller:::.onLoad()
...
Browse[2]> n
...

and the code should consult the web for relevant variables.

 

 

ADD REPLY

Login before adding your answer.

Traffic: 809 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6