Bioconductor / BiocParallel

Bioconductor facilities for parallel evaluation
https://bioconductor.org/packages/BiocParallel
67 stars 29 forks source link

BiocParallel errors:could not find function ".OLD_read_block" #252

Closed alopehba closed 1 year ago

alopehba commented 1 year ago
>library(SingleR)
>library(celldex)
>library(pheatmap)
> library(BiocParallel)
> # load('ref_Human_all.RData')
> # ref<-ref_Human_all
> singler <- SingleR(test = scRNA_harmony@assays$RNA@data,
+                    ref = ref,
+                    labels = ref$label.main,
+                    clusters = scRNA_harmony@meta.data$seurat_clusters)

Error: BiocParallel errors
  1 remote errors, element index: 1
  4 unevaluated and other errors
  first remote error:
Error in .OLD_read_block(x, viewport, as.sparse = as.sparse): could not find function ".OLD_read_block"

I don’t know where the problem is. I checked the data and there is no problem. SingleR’ version 2.2.0, celldex’ version 1.10.1, ‘BiocParallel’ version 1.34.2, all of them are the latest stable version, but the error is still reported.

mtmorgan commented 1 year ago

Please make sure that BiocManager::valid() returns TRUE; try re-installing S4Vectors and DelayedArray using BiocManager::install(c("S4Vectors", "DelayedArray"), force = TRUE). @hpages may have more specific advice (this is not a BiocParallel problem per se, but something about the binaries of S4Vectors or DelayedArray (???) distributed on Windows / macOS being incorrect).

vjcitn commented 1 year ago

@alopehba If reinstallations do not solve the problem, a) please do provide the output of sessionInfo() after the error and b) it would be nice to know if example(SingleR) succeeds on your platform

hpages commented 1 year ago

This has been corrected in the latest DelayedArray binaries (0.26.3). However, the DelayedArray 0.26.3 binary for arm64 Mac did not propagate yet, so we're still at version 0.26.2 on this platform. See https://bioconductor.org/packages/3.17/DelayedArray (look at the Package Archives section at the bottom of the page).

The good news is that today's build report for arm64 Mac indicates that DelayedArray 0.26.3 passed all the checks on this platform, so the new binary is about to propagate (in the next hour or so): https://bioconductor.org/checkResults/3.17/bioc-mac-arm64-LATEST/DelayedArray/

hpages commented 1 year ago

@alopehba DelayedArray_0.26.3.tgz for arm64 Mac has finally propagated: https://bioconductor.org/packages/3.17/DelayedArray

Just run BiocManager::install() (with no arguments) to update, assuming that you are on an M1/M2 Mac.

Cheers, H.

alopehba commented 1 year ago

Thank all of you for reply. I have updated S4Vectors (0.34.0) and DelayedArray (0.26.3), ( win system) but it still has the same problem as above. And example (SingleR) didn't succeed.

sce<- as.SingleCellExperiment(scRNA_harmony)
singler <- SingleR(test = sce,
                     ref = ref,
                     labels = ref$label.fine,
                     clusters = sce@colData$seurat_clusters)

Error: BiocParallel errors
  1 remote errors, element index: 1
  4 unevaluated and other errors
  first remote error:
Error in .OLD_read_block(x, viewport, as.sparse = as.sparse): could not find function ".OLD_read_block"

sessionInfo()

* sessionInfo()

R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22000)

Matrix products: default

locale:
**************

time zone: *********
tzcode source: internal

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

other attached packages:
 [1] DelayedArray_0.26.3         S4Arrays_1.0.1              Matrix_1.5-4.1             
 [4] BiocParallel_1.34.2         pheatmap_1.0.12             celldex_1.10.1             
 [7] SingleR_2.2.0               SummarizedExperiment_1.30.1 Biobase_2.56.0             
[10] GenomicRanges_1.48.0        GenomeInfoDb_1.36.0         IRanges_2.34.0             
[13] S4Vectors_0.38.1            BiocGenerics_0.46.0         MatrixGenerics_1.12.0      
[16] matrixStats_0.63.0          reshape2_1.4.4              devtools_2.4.5             
[19] usethis_2.1.6               lubridate_1.9.2             forcats_1.0.0              
[22] stringr_1.5.0               purrr_1.0.1                 readr_2.1.4                
[25] tidyr_1.3.0                 tibble_3.2.1                ggplot2_3.4.2              
[28] tidyverse_2.0.0             dplyr_1.1.2                 SeuratObject_4.1.3         
[31] Seurat_4.3.0  

Bioconductor version '3.17'

Warning message:
50 packages out-of-date; 0 packages too new 
alopehba commented 1 year ago

Warning message: replacing previous import ‘S4Arrays::read_block’ by ‘DelayedArray::read_block’ when loading ‘SummarizedExperiment’ Is there a conflict because this package is loaded?

hpages commented 1 year ago

I have to admit that I don't really understand what's going on. Installing DelayedArray 0.26.3 did solve the problem for others e.g. see https://support.bioconductor.org/p/9152365/#9152403 and https://github.com/Bioconductor/HDF5Array/issues/55#issuecomment-1558423555

Maybe you also need to reinstall SummarizedExperiment from source. Can you try BiocManager::install("SummarizedExperiment", type="source", force=TRUE) and see if that solves the problem?

alopehba commented 1 year ago

I have to admit that I don't really understand what's going on. Installing DelayedArray 0.26.3 did solve the problem for others e.g. see https://support.bioconductor.org/p/9152365/#9152403 and Bioconductor/HDF5Array#55 (comment)

Maybe you also need to reinstall SummarizedExperiment from source. Can you try and see if that solves the problem?BiocManager::install("SummarizedExperiment", type="source", force=TRUE)

Thank you for your suggestion. I have also updated other related packages according to the operation of the 2 links, and also updated the 'SummarizedExperiment', but it still cannot be resolved.

hpages commented 1 year ago

Could it be that you have some stale packages somewhere that get in the way? What does .libPaths() say?

Oh, and based on the output of sessionInfo() that you finally shared with us, we finally know that you are on Windows. This is the kind of information that you absolutely want to share as early as possible when reporting a problem like this, so we can quickly eliminate possible scenarios that don't apply to you and don't waste our time discussing them with you.

What about this warning:

Warning message:
50 packages out-of-date; 0 packages too new 

Are you going to leave this unattended?

Jiefei-Wang commented 1 year ago

Just want to say that this is not even a parallelization error. SingleR uses SerialParam by default, so something must be wrong in @alopehba 's current R environment (not related to unmatched environments or package versions between workers and servers)

@alopehba : could you please provide us with a runnable example? I'm using Windows and might be able to reproduce it, but I have no clue about how you get the dataset ref_Human_all.RData. However, I can confirm example(SingleR) can be run without issue.

mtmorgan commented 1 year ago

Without more input from @alopehba I'll close this issue.