BiocParallel error with ChIPQC
1
0
Entering edit mode
@8f9d24cc
Last seen 3 months ago
United States

Hi, I just got this error message when using ChIPQC (with a metadata table for 4 bam files with peak info...):

Error: BiocParallel errors 4 remote errors, element index: 1, 2, 3, 4  0 unevaluated and other errors  
first remote error: Error in if (is.na(peaks)) peaks = NULL: the condition has length > 1

With the following command:

chipObj <- ChIPQC(samples)

Show Traceback gives me:

7. stop(.error_bplist(res))
6. .bpinit(manager = manager, X = X, FUN = FUN, ARGS = ARGS, BPPARAM = BPPARAM, 
BPOPTIONS = BPOPTIONS, BPREDO = BPREDO)
5. bplapply(X, FUN, ..., BPREDO = BPREDO, BPPARAM = BPPARAM, BPOPTIONS = BPOPTIONS)
4. bplapply(X, FUN, ..., BPREDO = BPREDO, BPPARAM = BPPARAM, BPOPTIONS = BPOPTIONS)
3. bplapply(samplelist, doChIPQCsample, experiment, chromosomes, 
annotation, mapQCth, blacklist, profileWin, fragmentLength, 
shifts)
2. bplapply(samplelist, doChIPQCsample, experiment, chromosomes, 
annotation, mapQCth, blacklist, profileWin, fragmentLength, 
shifts)
1. ChIPQC(samples)

After getting this error, I tried to run ChIPQC with files that had given me great results in the past (ChIPQC report...) and I got the same error message. I can't analyze these other ChIP-seq datasets anymore. I recently updated a bunch of R packages so my guess would be that the new version of one of the packages is encountering some issue.

I tried to install a previous version of ChIPQC (3.10 or 3.11) with:

BiocManager::install("ChIPQC", version = "3.11")

and kept getting error messages of this type:

Error: Bioconductor version '3.11' requires R version '4.0'; use   `BiocManager::install(version = '3.15')` with R version 4.2; see https://bioconductor.org/install

I already the version 3.15 of BiocManager and the version 4.2 of R so I am not sure how to overcome this error.

A similar ChIPQC issue (from 3.8 years ago) was described here: ChIPQC - can't read in bam files

It was suggested in the comments to try to open the bam files with Rsamtools function open.bamFile(). I just did that and got the following error message:

Error in value[[3L]](cond) : 
failed to open BamFile: unable to find an inherited method for function 'path' for signature '"character"'
6. stop("failed to open BamFile: ", conditionMessage(err))
5. value[[3L]](cond)
4. tryCatchOne(expr, names, parentenv, handlers[[1L]])
3. tryCatchList(expr, classes, parentenv, handlers)
2. tryCatch({
.io_check_exists(path(con))
index <- sub("\\.bai$", "", index(con, asNA = FALSE))
con$.extptr <- .Call(.bamfile_open, path(con), index, "rb") ...
1. open.BamFile("extract_14M_1_PEO1_G9A_1_S4_L002.bam")

Could there be an issue with the latest version of Rsamtools or am I not using Rsamtools correctly?

From another Bioconductor question: DiffBind GreyListChIP error: Error: BiocParallel errors

I tried:

BiocParallel::register(BiocParallel::SerialParam())

And this did not solve my issue.

I also tried a few other things like clearing the workspace, relaunching R, RStudio, my computer, installing the newest version of RStudio, reindexing the bam files... I tried on a different computer that has unfortunately also updated many R packages (it has the version 3.12 of ChIPQC) and got the same error message.

If anyone has any solution or ideas I could try to solve this issue, it would be fantastic and greatly appreciated.

Thank you very much in advance.

Best,

Etienne

sessionInfo( ):

R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  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   base     

other attached packages:
 [1] BiocParallel_1.31.8         valr_0.6.4                  ChIPseeker_1.32.0           org.Mm.eg.db_3.15.0         ensembldb_2.20.2            AnnotationFilter_1.20.0     GenomicFeatures_1.48.3      AnnotationDbi_1.58.0        AnnotationHub_3.4.0         BiocFileCache_2.4.0        
[11] dbplyr_2.1.1                forcats_0.5.1               stringr_1.4.0               dplyr_1.0.9                 purrr_0.3.4                 readr_2.1.2                 tidyr_1.2.0                 tibble_3.1.7                tidyverse_1.3.1             ChIPQC_1.32.0              
[21] DiffBind_3.6.1              SummarizedExperiment_1.26.1 Biobase_2.56.0              MatrixGenerics_1.8.0        matrixStats_0.62.0          GenomicRanges_1.48.0        GenomeInfoDb_1.32.2         IRanges_2.30.0              S4Vectors_0.34.0            BiocGenerics_0.42.0        
[31] ggplot2_3.3.6              

loaded via a namespace (and not attached):
  [1] utf8_1.2.2                                tidyselect_1.1.2                          RSQLite_2.2.14                            htmlwidgets_1.5.4                         grid_4.2.0                                scatterpie_0.1.7                         
  [7] munsell_0.5.0                             codetools_0.2-18                          systemPipeR_2.2.2                         withr_2.5.0                               colorspace_2.0-3                          GOSemSim_2.22.0                          
 [13] filelock_1.0.2                            knitr_1.39                                rstudioapi_0.13                           DOSE_3.22.0                               bbmle_1.0.25                              GenomeInfoDbData_1.2.8                   
 [19] polyclip_1.10-0                           mixsqp_0.3-43                             hwriter_1.3.2.1                           farver_2.1.0                              bit64_4.0.5                               treeio_1.20.0                            
 [25] coda_0.19-4                               vctrs_0.4.1                               TxDb.Rnorvegicus.UCSC.rn4.ensGene_3.2.2   generics_0.1.2                            xfun_0.31                                 R6_2.5.1                                 
 [31] graphlayouts_0.8.0                        apeglm_1.18.0                             invgamma_1.1                              locfit_1.5-9.5                            gridGraphics_0.5-1                        fgsea_1.22.0                             
 [37] bitops_1.0-7                              cachem_1.0.6                              DelayedArray_0.22.0                       assertthat_0.2.1                          vroom_1.5.7                               promises_1.2.0.1                         
 [43] BiocIO_1.6.0                              scales_1.2.0                              ggraph_2.0.5                              enrichplot_1.16.1                         gtable_0.3.0                              tidygraph_1.2.1                          
 [49] rlang_1.0.2                               splines_4.2.0                             rtracklayer_1.56.0                        lazyeval_0.2.2                            broom_0.8.0                               BiocManager_1.30.18                      
 [55] yaml_2.3.5                                reshape2_1.4.4                            modelr_0.1.8                              TxDb.Dmelanogaster.UCSC.dm3.ensGene_3.2.2 backports_1.4.1                           httpuv_1.6.5                             
 [61] qvalue_2.28.0                             tools_4.2.0                               ggplotify_0.1.0                           ellipsis_0.3.2                            gplots_3.1.3                              RColorBrewer_1.1-3                       
 [67] Rcpp_1.0.8.3                              plyr_1.8.7                                progress_1.2.2                            zlibbioc_1.42.0                           RCurl_1.98-1.7                            prettyunits_1.1.1                        
 [73] viridis_0.6.2                             ashr_2.2-54                               chipseq_1.46.0                            haven_2.5.0                               ggrepel_0.9.1                             fs_1.5.2                                 
 [79] magrittr_2.0.3                            data.table_1.14.2                         TxDb.Hsapiens.UCSC.hg18.knownGene_3.2.2   DO.db_2.9                                 reprex_2.0.1                              truncnorm_1.0-8                          
 [85] mvtnorm_1.1-3                             SQUAREM_2021.1                            amap_0.8-18                               ProtGenerics_1.28.0                       TxDb.Mmusculus.UCSC.mm9.knownGene_3.2.2   patchwork_1.1.1                          
 [91] hms_1.1.1                                 mime_0.12                                 xtable_1.8-4                              XML_3.99-0.10                             emdbook_1.3.12                            jpeg_0.1-9                               
 [97] readxl_1.4.0                              gridExtra_2.3                             compiler_4.2.0                            biomaRt_2.52.0                            bdsmatrix_1.3-4                           shadowtext_0.1.2                         
[103] KernSmooth_2.23-20                        crayon_1.5.1                              htmltools_0.5.2                           ggfun_0.0.6                               later_1.3.0                               tzdb_0.3.0                               
[109] aplot_0.1.6                               lubridate_1.8.0                           DBI_1.1.2                                 tweenr_1.0.2                              MASS_7.3-57                               rappdirs_0.3.3                           
[115] boot_1.3-28                               ShortRead_1.54.0                          Matrix_1.4-1                              cli_3.3.0                                 parallel_4.2.0                            igraph_1.3.2                             
[121] pkgconfig_2.0.3                           TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2   GenomicAlignments_1.32.0                  numDeriv_2016.8-1.1                       TxDb.Celegans.UCSC.ce6.ensGene_3.2.2      xml2_1.3.3                               
[127] ggtree_3.4.0                              XVector_0.36.0                            rvest_1.0.2                               yulab.utils_0.0.4                         digest_0.6.29                             Biostrings_2.64.0                        
[133] fastmatch_1.1-3                           cellranger_1.1.0                          tidytree_0.3.9                            restfulr_0.0.13                           GreyListChIP_1.28.1                       curl_4.3.2                               
[139] shiny_1.7.1                               Rsamtools_2.12.0                          gtools_3.9.2                              rjson_0.2.21                              nlme_3.1-157                              lifecycle_1.0.1                          
[145] jsonlite_1.8.0                            viridisLite_0.4.0                         limma_3.52.1                              BSgenome_1.64.0                           fansi_1.0.3                               pillar_1.7.0                             
[151] lattice_0.20-45                           Nozzle.R1_1.1-1                           plotrix_3.8-2                             KEGGREST_1.36.2                           fastmap_1.1.0                             httr_1.4.3                               
[157] GO.db_3.15.0                              interactiveDisplayBase_1.34.0             glue_1.6.2                                png_0.1-7                                 BiocVersion_3.15.2                        bit_4.0.4                                
[163] ggforce_0.3.3                             stringi_1.7.6                             blob_1.2.3                                TxDb.Mmusculus.UCSC.mm10.knownGene_3.10.0 latticeExtra_0.6-29                       caTools_1.18.2                           
[169] memoise_2.0.1                             ape_5.6-2                                 irlba_2.3.5
BiocManager ChIPQC RSamtools BiocParallel • 4.5k views
ADD COMMENT
1
Entering edit mode

I had the same error message.

ADD REPLY
0
Entering edit mode

I figured it out (kind of). I tried everything I could think of.

I got the latest version of BiocParallel (not official yet). This update fixed other issues I was having with BiocParallel and other packages but it did not fix ChIPQC.

The thing that worked was to downgrade R and use a previous version of ChIPQC. That worked great till by mistake I upgraded R and ChIPQC again and it stopped working again. Then, I thought that maybe I had some incompatibility issues with some R packages so I deleted all my packages and reinstall everything new. Without thinking, I deleted the old ChIPQC package. That was a mistake because after resinstalling the latest version of ChIPQC and all the dependencies, I still got the same error message. So, now I have to request from Rory Stark or one of the ChIPQC creators an older version of ChIPQC...

ADD REPLY
0
Entering edit mode

First make sure that you are using packages that are supposed to work together. Do this by making sure that

BiocManager::valid()

returns TRUE. If it does not, it provides guidance on what to do to make BiocManager::valid() return TRUE.

Once at this stage, i would recommend BiocParallel::register(BiocParallel::SerialParam()) and evaluating the command again. I think then you should report explicitly the error that you see, instead of saying that it 'did not solve my issue'.

Immediately after the error occurs, you might try traceback() to see the series of function calls that lead to the error. It would be very helpful to report traceback() here.

On your own, you could try to either debug() a particular function in the traceback to try and figure out what goes wrong, or perhaps set options(error = recover) (reset with options(error = NULL)) and explore what is going wrong. See ?degug and ?recover and ?browser for some hints on what you can do on your own to figure out what is going wrong.

ADD REPLY
0
Entering edit mode

Great advice! Thank you very much, Martin!

BiocManager::valid() helped me find 43 outdated R packages that I was able to update using sudo R in the terminal. Unfortunately, that did not solve my issue. I installed the currently Bioconductor available version of BiocParallel and that did not help. I re-installed the latest version (non-official) and that did not help either.

I also tried: BiocParallel::register(BiocParallel::SerialParam()) and that did not work either. I will look into debug() and all the other recommendations that you gave me. Thank you again for all the great suggestions!

ADD REPLY
1
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 5 weeks ago
Cambridge, UK

I have submitted two fixes for ChIPQC. One addresses the issue where an error is generated with the message:

Error in if (is.na(peaks)) peaks = NULL: the condition has length > 1

The other makes the use of BiocParallel more explicit, checking for installed backends and reporting information on how ChIPQC will be executed.

These fixes will be in effect from version ChIPQC_1.32.1 in the main Release branch. There are related fixes in DiffBind_3.6.2 so these should be updated together.

ADD COMMENT
0
Entering edit mode

Could you tell me how to install ChIPQC_1.32.1 in the main Release branch?

ADD REPLY
0
Entering edit mode

You need to be on the current version of Bioconductor, 3.15, which uses R version 4.2.0. Simply run:

BiocManager::install()

to update everything, which is perferred. Alternatively you can just update ChIPQC and DiffBind:

BiocManager::install(c("DiffBind", "ChIPQC"))
ADD REPLY
1
Entering edit mode

I have installed the updated packages. It works for me. Thanks a lot.

ADD REPLY
0
Entering edit mode

Thank you so much, Rory!!! It worked!!! For some weird reason, I had to install the package using the tar.gz file:

 install.packages("/home/<your_username>/tools/ChIPQC_1.32.1.tar.gz", repos = NULL, type="source")

for it to be updated to the 1.32.1 version (instead of staying at 1.32.0). And after loading the library and launching ChIPQC, I got the following error message when I tried to generate the ChIPQC report using ChIPQCreport() :

Error in f(...) : Graphics API version mismatch

But after installing the ragg package (install.packages("ragg")), it fixed the error. Now, everything perfectly works! I can finally use your fantastic ChIPQC package again. :-)

ADD REPLY
0
Entering edit mode

Hi Rory,

I am using ChIPQC_1.34.0. I am getting a similar error but for blacklist instead of peaks.

  Error: BiocParallel errors
  4 remote errors, element index: 1, 2, 3, 4
  0 unevaluated and other errors
  first remote error:
  Error in if (is.na(blacklist)) blacklist = NULL: the condition has length > 1

Thank you!

ADD REPLY
0
Entering edit mode

Can you confirm the versions of both ChipQC and DiffBind using sessionInfo()?

ADD REPLY
0
Entering edit mode

Here you go! ChIPQC_1.34.0 and BiocParallel_1.32.5.

> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Rocky Linux 8.6 (Green Obsidian)

Matrix products: default
BLAS/LAPACK: /cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/flexiblas/3.0.4/lib64/libflexiblas.so.3.0

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8
 [5] LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8
 [7] LC_PAPER=en_CA.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
 [1] ChIPQC_1.34.0               BiocParallel_1.32.5
 [3] DiffBind_3.8.3              SummarizedExperiment_1.28.0
 [5] Biobase_2.58.0              MatrixGenerics_1.10.0
 [7] matrixStats_0.63.0          GenomicRanges_1.50.2
 [9] GenomeInfoDb_1.34.6         IRanges_2.32.0
[11] S4Vectors_0.36.1            BiocGenerics_0.44.0
[13] ggplot2_3.4.0
ADD REPLY
1
Entering edit mode

Looks like there was a regression in ChIPQC_1.34.0. I have re-submitted the fixes and they will be available in ChIPQC_1.34.1.

ADD REPLY

Login before adding your answer.

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