LTLA / BiocSingular

Clone of the Bioconductor repository for the BiocSingular package.

Home Page:https://bioconductor.org/packages/devel/bioc/html/BiocSingular.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

show method for LowRankMatrix gives `'S4' is not subsettable` on some machines

lwaldron opened this issue · comments

I can't reproduce the problem myself but in a seminar of 8 students I was teaching, about half of them were having this error. Here is an example from one of them, with a stop(error=recover) trace. Below I include some other with cleaner sessionInfo() (I asked everyone to use reprex on this code but not everyone did...) If there's more information that would be useful from one of the students seeing this error, let me know.

> library(BiocSingular)
> a <- matrix(rnorm(100000), ncol=20)
> out <- runPCA(a, rank=10)
> lr <- LowRankMatrix(out$rotation, out$x)
> lr

Error in (function (cond) :
errore durante la valutazione dell'argomento 'x' nella selezione di un metodo per la funzione 'type': object of type 'S4' is not subsettable

> sessionInfo()
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22621)

Matrix products: default


locale:
[1] LC_COLLATE=Italian_Italy.utf8 LC_CTYPE=Italian_Italy.utf8 LC_MONETARY=Italian_Italy.utf8
[4] LC_NUMERIC=C LC_TIME=Italian_Italy.utf8

time zone: Europe/Rome
tzcode source: internal

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

other attached packages:
[1] batchelor_1.16.0 BiocSingular_1.16.0 scran_1.28.1
[4] scater_1.28.0 ggplot2_3.4.2 scuttle_1.10.1
[7] TENxPBMCData_1.18.0 HDF5Array_1.28.1 rhdf5_2.44.0
[10] DelayedArray_0.26.3 S4Arrays_1.0.4 Matrix_1.5-4.1
[13] SingleCellExperiment_1.22.0 SummarizedExperiment_1.30.2 Biobase_2.60.0
[16] GenomicRanges_1.52.0 GenomeInfoDb_1.36.1 IRanges_2.34.1
[19] S4Vectors_0.38.1 BiocGenerics_0.46.0 MatrixGenerics_1.12.2
[22] matrixStats_1.0.0

loaded via a namespace (and not attached):
[1] RColorBrewer_1.1-3 rstudioapi_0.14 jsonlite_1.8.7
[4] magrittr_2.0.3 ggbeeswarm_0.7.2 farver_2.1.1
[7] rmarkdown_2.23 zlibbioc_1.46.0 vctrs_0.6.3
[10] memoise_2.0.1 DelayedMatrixStats_1.22.1 RCurl_1.98-1.12
[13] htmltools_0.5.5 AnnotationHub_3.8.0 curl_5.0.1
[16] BiocNeighbors_1.18.0 Rhdf5lib_1.22.0 sass_0.4.6
[19] bslib_0.5.0 cachem_1.0.8 ResidualMatrix_1.10.0
[22] igraph_1.5.0 mime_0.12 lifecycle_1.0.3
[25] pkgconfig_2.0.3 rsvd_1.0.5 R6_2.5.1
[28] fastmap_1.1.1 GenomeInfoDbData_1.2.10 shiny_1.7.4
[31] digest_0.6.32 colorspace_2.1-0 AnnotationDbi_1.62.2
[34] dqrng_0.3.0 irlba_2.3.5.1 ExperimentHub_2.8.0
[37] RSQLite_2.3.1 beachmat_2.16.0 labeling_0.4.2
[40] filelock_1.0.2 fansi_1.0.4 httr_1.4.6
[43] compiler_4.3.1 withr_2.5.0 bit64_4.0.5
[46] BiocParallel_1.34.2 viridis_0.6.3 DBI_1.1.3
[49] rappdirs_0.3.3 bluster_1.10.0 tools_4.3.1
[52] vipor_0.4.5 beeswarm_0.4.0 interactiveDisplayBase_1.38.0
[55] httpuv_1.6.11 glue_1.6.2 rhdf5filters_1.12.1
[58] promises_1.2.0.1 rsconnect_0.8.29 grid_4.3.1
[61] Rtsne_0.16 cluster_2.1.4 generics_0.1.3
[64] gtable_0.3.3 ScaledMatrix_1.8.1 metapod_1.8.0
[67] utf8_1.2.3 XVector_0.40.0 RcppAnnoy_0.0.21
[70] ggrepel_0.9.3 BiocVersion_3.17.1 pillar_1.9.0
[73] limma_3.56.2 later_1.3.1 dplyr_1.1.2
[76] BiocFileCache_2.8.0 lattice_0.21-8 FNN_1.1.3.2
[79] bit_4.0.5 tidyselect_1.2.0 locfit_1.5-9.8
[82] Biostrings_2.68.1 knitr_1.43 gridExtra_2.3
[85] edgeR_3.42.4 xfun_0.39 statmod_1.5.0
[88] pheatmap_1.0.12 yaml_2.3.7 evaluate_0.21
[91] codetools_0.2-19 tibble_3.2.1 BiocManager_1.30.21
[94] cli_3.6.1 uwot_0.1.16 xtable_1.8-4
[97] munsell_0.5.0 jquerylib_0.1.4 Rcpp_1.0.10
[100] dbplyr_2.3.2 png_0.1-8 parallel_4.3.1
[103] ellipsis_0.3.2 blob_1.2.4 sparseMatrixStats_1.12.1
[106] bitops_1.0-7 viridisLite_0.4.2 scales_1.2.1
[109] purrr_1.0.1 crayon_1.5.2 rlang_1.1.1
[112] cowplot_1.1.1 KEGGREST_1.40.0

> options(error=recover)
> lr
Error in (function (cond) :
errore durante la valutazione dell'argomento 'x' nella selezione di un metodo per la funzione 'type': object of type 'S4' is not subsettable

Enter a frame number, or 0 to exit

1: (new("standardGeneric", .Data = function (object)
standardGeneric("show"), generic = "show", package = "methods"
2: (new("standardGeneric", .Data = function (object)
standardGeneric("show"), generic = "show", package = "methods"
3: S4Arrays:::show_compact_array(object)
4: cat(array_as_one_line_summary(object))
5: array_as_one_line_summary(object)
6: sprintf("<%s>%s %s object of type \"%s\"", paste0(x_dim, collapse = " x "), if (is_sparse(x)) " sparse" else "",
7: type(x)
8: type(x)
9: type(.extract_empty_array(x))
10: .extract_empty_array(x)
11: extract_array(x, index)
12: extract_array(x, index)
13: callNextMethod()
14: .nextMethod(x = x, index = index)
15: extract_array(x@seed, index)
16: extract_array(x@seed, index)
17: subset_by_Nindex(x, index)
18: do.call(`[`, c(list(x), subscripts, list(drop = drop)))
19: do.call(`[`, c(list(x), subscripts, list(drop = drop)))
20: (function (cond)
.Internal(C_tryCatchHelper(addr, 1, cond)))(list(message = "object of type 'S4' is not subsetta
library(BiocSingular)
a <- matrix(rnorm(100000), ncol=20)
out <- runPCA(a, rank=10)
lr <- LowRankMatrix(out$rotation, out$x)
lr

sessionInfo()
Error in (function (cond) :
errore durante la valutazione dell'argomento 'x' nella selezione di un metodo per la funzione 'type': object of type 'S4' is not subsettable

> sessionInfo()
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22000)

Matrix products: default


locale:
[1] LC_COLLATE=Italian_Italy.utf8 LC_CTYPE=Italian_Italy.utf8
[3] LC_MONETARY=Italian_Italy.utf8 LC_NUMERIC=C
[5] LC_TIME=Italian_Italy.utf8

time zone: Europe/Rome
tzcode source: internal

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

other attached packages:
[1] BiocSingular_1.16.0 TENxPBMCData_1.18.0
[3] HDF5Array_1.28.1 rhdf5_2.44.0
[5] DelayedArray_0.26.3 S4Arrays_1.0.4
[7] Matrix_1.5-4.1 edgeR_3.42.4
[9] limma_3.56.2 bluster_1.10.0
[11] batchelor_1.16.0 scran_1.28.1
[13] scater_1.28.0 ggplot2_3.4.2
[15] scuttle_1.10.1 MouseGastrulationData_1.14.0
[17] SpatialExperiment_1.10.0 BiocManager_1.30.21
[19] SingleCellExperiment_1.22.0 SummarizedExperiment_1.30.2
[21] Biobase_2.60.0 GenomicRanges_1.52.0
[23] GenomeInfoDb_1.36.1 IRanges_2.34.1
[25] S4Vectors_0.38.1 BiocGenerics_0.46.0
[27] MatrixGenerics_1.12.2 matrixStats_1.0.0

loaded via a namespace (and not attached):
[1] RColorBrewer_1.1-3 jsonlite_1.8.5
[3] magrittr_2.0.3 ggbeeswarm_0.7.2
[5] magick_2.7.4 rmarkdown_2.23
[7] farver_2.1.1 BiocIO_1.10.0
[9] zlibbioc_1.46.0 vctrs_0.6.3
[11] Rsamtools_2.16.0 memoise_2.0.1
[13] DelayedMatrixStats_1.22.1 RCurl_1.98-1.12
[15] htmltools_0.5.5 AnnotationHub_3.8.0
[17] curl_5.0.1 BiocNeighbors_1.18.0
[19] Rhdf5lib_1.22.0 sass_0.4.6
[21] bslib_0.5.0 cachem_1.0.8
[23] ResidualMatrix_1.10.0 GenomicAlignments_1.36.0
[25] igraph_1.5.0 mime_0.12
[27] lifecycle_1.0.3 pkgconfig_2.0.3
[29] rsvd_1.0.5 R6_2.5.1
[31] fastmap_1.1.1 GenomeInfoDbData_1.2.10
[33] shiny_1.7.4 digest_0.6.32
[35] colorspace_2.1-0 AnnotationDbi_1.62.2
[37] dqrng_0.3.0 irlba_2.3.5.1
[39] ExperimentHub_2.8.0 RSQLite_2.3.1
[41] beachmat_2.16.0 filelock_1.0.2
[43] labeling_0.4.2 fansi_1.0.4
[45] httr_1.4.6 compiler_4.3.1
[47] bit64_4.0.5 withr_2.5.0
[49] BiocParallel_1.34.2 viridis_0.6.3
[51] DBI_1.1.3 R.utils_2.12.2
[53] rappdirs_0.3.3 rjson_0.2.21
[55] tools_4.3.1 vipor_0.4.5
[57] beeswarm_0.4.0 interactiveDisplayBase_1.38.0
[59] httpuv_1.6.11 R.oo_1.25.0
[61] glue_1.6.2 restfulr_0.0.15
[63] rhdf5filters_1.12.1 promises_1.2.0.1
[65] grid_4.3.1 Rtsne_0.16
[67] cluster_2.1.4 generics_0.1.3
[69] gtable_0.3.3 R.methodsS3_1.8.2
[71] ScaledMatrix_1.8.1 metapod_1.8.0
[73] utf8_1.2.3 XVector_0.40.0
[75] RcppAnnoy_0.0.20 ggrepel_0.9.3
[77] BiocVersion_3.17.1 pillar_1.9.0
[79] BumpyMatrix_1.8.0 later_1.3.1
[81] splines_4.3.1 dplyr_1.1.2
[83] BiocFileCache_2.8.0 lattice_0.21-8
[85] rtracklayer_1.60.0 FNN_1.1.3.2
[87] bit_4.0.5 tidyselect_1.2.0
[89] locfit_1.5-9.8 Biostrings_2.68.1
[91] knitr_1.43 gridExtra_2.3
[93] xfun_0.39 statmod_1.5.0
[95] DropletUtils_1.20.0 pheatmap_1.0.12
[97] yaml_2.3.7 evaluate_0.21
[99] codetools_0.2-19 tibble_3.2.1
[101] cli_3.6.1 uwot_0.1.15
[103] xtable_1.8-4 jquerylib_0.1.4
[105] munsell_0.5.0 Rcpp_1.0.10
[107] dbplyr_2.3.2 png_0.1-8
[109] XML_3.99-0.14 parallel_4.3.1
[111] ellipsis_0.3.2 blob_1.2.4
[113] sparseMatrixStats_1.12.1 bitops_1.0-7
[115] viridisLite_0.4.2 scales_1.2.1
[117] purrr_1.0.1 crayon_1.5.2
[119] rlang_1.1.1 KEGGREST_1.40.0
> library(BiocSingular)
> a <- matrix(rnorm(100000), ncol=20)
> out <- runPCA(a, rank=10)
> lr <- LowRankMatrix(out$rotation, out$x)
> lr
Error in (function (cond)  :
  error in evaluating the argument 'x' in selecting a method for function 'type': object of type 'S4' is not subsettable
> sessionInfo()
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: Europe/Rome
tzcode source: internal

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

other attached packages:
[1] BiocSingular_1.16.0

loaded via a namespace (and not attached):
 [1] codetools_0.2-19      Matrix_1.5-4.1        lattice_0.21-8        MatrixGenerics_1.12.2 rsvd_1.0.5            matrixStats_1.0.0     S4Arrays_1.0.4      
 [8] parallel_4.3.1        BiocGenerics_0.46.0   stats4_4.3.1          IRanges_2.34.1        grid_4.3.1            DelayedArray_0.26.3   compiler_4.3.1      
[15] beachmat_2.16.0       tools_4.3.1           irlba_2.3.5.1         ScaledMatrix_1.8.1    Rcpp_1.0.10           BiocManager_1.30.21   crayon_1.5.2

I can't reproduce it. The most I can say is that it seems that the extract_array method for the LowRankMatrixSeed is not being found. Don't know why that is the case: maybe it's a windows issue.