MarioniLab / scran

Clone of the Bioconductor repository for the scran package.
https://bioconductor.org/packages/devel/bioc/html/scran.html
39 stars 23 forks source link

BiocParallel errror (invalid length of row names) in combineMarkers() with full.stats = TRUE #97

Closed CyrilLagger closed 2 years ago

CyrilLagger commented 2 years ago

Hi,

I get the following error:

Error: BiocParallel errors
  1 remote errors, element index: 1
  2 unevaluated and other errors
  first remote error: invalid length of row names

when running the example from combineMarkers() with full.stats = TRUE:

library(scuttle)
sce <- mockSCE()
sce <- logNormCounts(sce)
kout <- kmeans(t(logcounts(sce)), centers=3)
clusters <- paste0("Cluster", kout$cluster)
out <- pairwiseTTests(logcounts(sce), groups=clusters)
comb <- combineMarkers(out$statistics, out$pairs, full.stats = TRUE)

Traceback suggest the error is coming from this bplapply: https://github.com/MarioniLab/scran/blob/592ade7df44b23a4a1e044c2f7bb4554be85fb9b/R/combineMarkers.R#L213-L217

The error appears on R 4.1.x on both Windows and Linux:

Windows sessionInfo() ``` R version 4.1.0 (2021-05-18) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19042) Matrix products: default locale: [1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252 [4] LC_NUMERIC=C LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats4 stats graphics grDevices utils datasets methods base other attached packages: [1] scuttle_1.4.0 scran_1.18.7 SingleCellExperiment_1.12.0 SummarizedExperiment_1.24.0 [5] Biobase_2.54.0 GenomicRanges_1.46.1 GenomeInfoDb_1.30.0 IRanges_2.28.0 [9] S4Vectors_0.32.3 BiocGenerics_0.40.0 MatrixGenerics_1.6.0 matrixStats_0.61.0 loaded via a namespace (and not attached): [1] Rcpp_1.0.8 compiler_4.1.0 bluster_1.4.0 XVector_0.34.0 bitops_1.0-7 [6] BiocNeighbors_1.12.0 tools_4.1.0 DelayedMatrixStats_1.16.0 zlibbioc_1.40.0 statmod_1.4.36 [11] lattice_0.20-44 pkgconfig_2.0.3 Matrix_1.3-3 igraph_1.2.11 DelayedArray_0.20.0 [16] parallel_4.1.0 GenomeInfoDbData_1.2.7 cluster_2.1.2 locfit_1.5-9.4 grid_4.1.0 [21] BiocParallel_1.28.3 limma_3.50.0 irlba_2.3.5 BiocSingular_1.10.0 magrittr_2.0.1 [26] edgeR_3.36.0 sparseMatrixStats_1.6.0 beachmat_2.10.0 rsvd_1.0.5 dqrng_0.3.0 [31] ScaledMatrix_1.2.0 RCurl_1.98-1.5 ```
Linux sessionInfo() ``` R version 4.1.2 (2021-11-01) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Debian GNU/Linux 11 (bullseye) Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.13.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] stats4 stats graphics grDevices utils datasets methods [8] base other attached packages: [1] scuttle_1.4.0 scran_1.18.7 [3] SingleCellExperiment_1.12.0 SummarizedExperiment_1.24.0 [5] Biobase_2.54.0 GenomicRanges_1.46.1 [7] GenomeInfoDb_1.30.0 IRanges_2.28.0 [9] S4Vectors_0.32.3 BiocGenerics_0.40.0 [11] MatrixGenerics_1.6.0 matrixStats_0.61.0 loaded via a namespace (and not attached): [1] Rcpp_1.0.8 compiler_4.1.2 [3] bluster_1.4.0 XVector_0.34.0 [5] bitops_1.0-7 BiocNeighbors_1.12.0 [7] tools_4.1.2 DelayedMatrixStats_1.16.0 [9] zlibbioc_1.40.0 statmod_1.4.36 [11] jsonlite_1.7.3 lattice_0.20-45 [13] pkgconfig_2.0.3 rlang_0.4.12 [15] Matrix_1.4-0 igraph_1.2.11 [17] DelayedArray_0.20.0 parallel_4.1.2 [19] GenomeInfoDbData_1.2.7 cluster_2.1.2 [21] locfit_1.5-9.4 grid_4.1.2 [23] BiocParallel_1.28.3 limma_3.50.0 [25] irlba_2.3.5 edgeR_3.36.0 [27] BiocSingular_1.10.0 magrittr_2.0.1 [29] sparseMatrixStats_1.6.0 beachmat_2.10.0 [31] rsvd_1.0.5 dqrng_0.3.0 [33] ScaledMatrix_1.2.0 RCurl_1.98-1.5 ```
LTLA commented 2 years ago

Hm. I have no such problems on the latest BioC-release environment.

I see that you're using scran 1.18.7 with BiocParallel 1.28.3; the former is part of BioC 3.12 while the latter is part of BioC 3.14. I don't recall what changed in between these release cycles to cause your error - my best guess is that some class definition updated in S4Vectors - but mixing and matching packages from different BioC releases is unlikely to work.

CyrilLagger commented 2 years ago

Thanks @LTLA I didn't realize this mismatch in versions. Updating packages accordingly (to BioC 3.14 in my case) solved the problem.