scater::runPCA() errors on DelayedMatrix (DelayedArray:::.check_Ops_vector_arg_length)
1
0
Entering edit mode
kevin.rue ▴ 350
@kevinrue-6757
Last seen 16 days ago
University of Oxford

Hi,

Please see the reprex below. This involves a few packages (scater, DelayedArray, BiocSingular), and I'm not exactly sure in which one the issue is taking place. Any help is appreciated!

suppressPackageStartupMessages(library(TENxPBMCData))
tenx_pbmc3k <- TENxPBMCData(dataset="pbmc3k")
#> snapshotDate(): 2019-05-07
#> see ?TENxPBMCData and browseVignettes('TENxPBMCData') for documentation
#> downloading 0 resources
#> loading from cache 
#>     'EH1607 : 1607'

suppressPackageStartupMessages(library(scater))
tenx_pbmc3k <- normalize(tenx_pbmc3k)
#> Warning in .local(object, ...): using library sizes as size factors

assayNames(tenx_pbmc3k)
#> [1] "counts"    "logcounts"
assay(tenx_pbmc3k, "logcounts")
#> <32738 x 2700> DelayedMatrix object of type "double":
#>                    [,1]    [,2]    [,3] ... [,2699] [,2700]
#> ENSG00000243485       0       0       0   .       0       0
#> ENSG00000237613       0       0       0   .       0       0
#> ENSG00000186092       0       0       0   .       0       0
#> ENSG00000238009       0       0       0   .       0       0
#> ENSG00000239945       0       0       0   .       0       0
#>             ...       .       .       .   .       .       .
#> ENSG00000215635       0       0       0   .       0       0
#> ENSG00000268590       0       0       0   .       0       0
#> ENSG00000251180       0       0       0   .       0       0
#> ENSG00000215616       0       0       0   .       0       0
#> ENSG00000215611       0       0       0   .       0       0

tenx_pbmc3k <- scater::runPCA(tenx_pbmc3k)
#> Error in .check_Ops_vector_arg_length(e, x_nrow, e_what = e_what, x_what = x_what): right object is longer than first dimension of left object

BiocManager::valid()
#> [1] TRUE

sessionInfo()
#> R version 3.6.0 (2019-04-26)
#> Platform: x86_64-apple-darwin18.5.0 (64-bit)
#> Running under: macOS Mojave 10.14.5
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
#> 
#> attached base packages:
#> [1] parallel  stats4    stats     graphics  grDevices utils     datasets 
#> [8] methods   base     
#> 
#> other attached packages:
#>  [1] scater_1.13.3               ggplot2_3.1.1              
#>  [3] TENxPBMCData_1.3.0          HDF5Array_1.13.1           
#>  [5] rhdf5_2.29.0                SingleCellExperiment_1.7.0 
#>  [7] SummarizedExperiment_1.15.1 DelayedArray_0.11.0        
#>  [9] BiocParallel_1.19.0         matrixStats_0.54.0         
#> [11] Biobase_2.45.0              GenomicRanges_1.37.5       
#> [13] GenomeInfoDb_1.21.1         IRanges_2.19.4             
#> [15] S4Vectors_0.23.3            BiocGenerics_0.31.2        
#> 
#> loaded via a namespace (and not attached):
#>  [1] viridis_0.5.1                 httr_1.4.0                   
#>  [3] BiocSingular_1.1.1            viridisLite_0.3.0            
#>  [5] bit64_0.9-7                   AnnotationHub_2.17.3         
#>  [7] DelayedMatrixStats_1.7.0      shiny_1.3.2                  
#>  [9] assertthat_0.2.1              interactiveDisplayBase_1.23.0
#> [11] BiocManager_1.30.4            highr_0.8                    
#> [13] BiocFileCache_1.9.0           blob_1.1.1                   
#> [15] vipor_0.4.5                   GenomeInfoDbData_1.2.1       
#> [17] yaml_2.2.0                    pillar_1.4.0                 
#> [19] RSQLite_2.1.1                 lattice_0.20-38              
#> [21] glue_1.3.1                    digest_0.6.19                
#> [23] promises_1.0.1                XVector_0.25.0               
#> [25] colorspace_1.4-1              htmltools_0.3.6              
#> [27] httpuv_1.5.1                  Matrix_1.2-17                
#> [29] plyr_1.8.4                    pkgconfig_2.0.2              
#> [31] zlibbioc_1.31.0               purrr_0.3.2                  
#> [33] xtable_1.8-4                  scales_1.0.0                 
#> [35] later_0.8.0                   tibble_2.1.1                 
#> [37] withr_2.1.2                   lazyeval_0.2.2               
#> [39] magrittr_1.5                  crayon_1.3.4                 
#> [41] mime_0.6                      memoise_1.1.0                
#> [43] evaluate_0.13                 beeswarm_0.2.3               
#> [45] tools_3.6.0                   stringr_1.4.0                
#> [47] Rhdf5lib_1.7.1                munsell_0.5.0                
#> [49] irlba_2.3.3                   AnnotationDbi_1.47.0         
#> [51] compiler_3.6.0                rsvd_1.0.0                   
#> [53] rlang_0.3.4                   grid_3.6.0                   
#> [55] RCurl_1.95-4.12               BiocNeighbors_1.3.1          
#> [57] rappdirs_0.3.1                bitops_1.0-6                 
#> [59] rmarkdown_1.13                ExperimentHub_1.11.1         
#> [61] gtable_0.3.0                  DBI_1.0.0                    
#> [63] curl_3.3                      R6_2.4.0                     
#> [65] gridExtra_2.3                 knitr_1.23                   
#> [67] dplyr_0.8.1                   bit_1.1-14                   
#> [69] ggbeeswarm_0.6.0              stringi_1.4.3                
#> [71] Rcpp_1.0.1                    dbplyr_1.4.0                 
#> [73] tidyselect_0.2.5              xfun_0.7
scater BiocSingular DelayedArray • 1.1k views
ADD COMMENT
2
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 20 hours ago
The city by the bay

This is because scater fails to use the implicit generic version of sweep, which apparently requires an explicit import from DelayedArray to get generic'd. This has now been fixed (1.13.4 and 1.12.2).

ADD COMMENT

Login before adding your answer.

Traffic: 677 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