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
Stepping back a bit, is this a sensible thing to expect to work? That a list() can be represented as a (Ranged)SummarizedExperiment ?
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.