Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with preprocessIllumina #258

Closed
Zszywek opened this issue Dec 12, 2023 · 5 comments
Closed

Problem with preprocessIllumina #258

Zszywek opened this issue Dec 12, 2023 · 5 comments

Comments

@Zszywek
Copy link

Zszywek commented Dec 12, 2023

Hello,

after updating through BiocManager today, no matter what I tried I couldn't preprocess the data from rgSet. After looking into the traceback it looks like a problem with matrixStats but even downloading and using an old version of it, the issue persists. Traceback:

Error: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.
image

I have also found the same problem with the getSex function after replacing the preprocess function with the one from wateRmelon package. I couldn't find any way to circumvent this but the recommendations to change useNames = useNames into something else and I can't do that myself as it's in the under-the-hood function.

Best and thank you in advance

@PeteHaitch
Copy link
Contributor

PeteHaitch commented Dec 12, 2023

Please provide a reproducible example (as text and not as a screenshot).
E.g., this demonstrates preprocessIllumina() working on my machine:

suppressPackageStartupMessages(library(minfi))
suppressPackageStartupMessages(library(minfiData))
preprocessIllumina(RGsetEx)
#> class: MethylSet 
#> dim: 485512 6 
#> metadata(0):
#> assays(2): Meth Unmeth
#> rownames(485512): cg00050873 cg00212031 ... ch.22.47579720R
#>   ch.22.48274842R
#> rowData names(0):
#> colnames(6): 5723646052_R02C02 5723646052_R04C01 ... 5723646053_R05C02
#>   5723646053_R06C02
#> colData names(13): Sample_Name Sample_Well ... Basename filenames
#> Annotation
#>   array: IlluminaHumanMethylation450k
#>   annotation: ilmn12.hg19
#> Preprocessing
#>   Method: Illumina, bg.correct = TRUE, normalize = controls, reference = 1
#>   minfi version: 1.49.0
#>   Manifest version: 0.4.0

Please also provide the output of BiocManager::valid() and sessionInfo(), e.g.,

BiocManager::valid()
#> 'getOption("repos")' replaces Bioconductor standard repositories, see
#> 'help("repositories", package = "BiocManager")' for details.
#> Replacement repositories:
#>     CRAN: https://cran.rstudio.com/
#> [1] TRUE
sessionInfo()
#> R Under development (unstable) (2023-10-28 r85429)
#> Platform: aarch64-apple-darwin20
#> Running under: macOS Ventura 13.6.1
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib 
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> time zone: Australia/Melbourne
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] parallel  stats4    stats     graphics  grDevices utils     datasets 
#> [8] methods   base     
#> 
#> other attached packages:
#>  [1] minfiData_0.49.0                                  
#>  [2] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.1
#>  [3] IlluminaHumanMethylation450kmanifest_0.4.0        
#>  [4] minfi_1.49.0                                      
#>  [5] bumphunter_1.45.0                                 
#>  [6] locfit_1.5-9.8                                    
#>  [7] iterators_1.0.14                                  
#>  [8] foreach_1.5.2                                     
#>  [9] Biostrings_2.71.1                                 
#> [10] XVector_0.43.0                                    
#> [11] SummarizedExperiment_1.33.1                       
#> [12] Biobase_2.63.0                                    
#> [13] MatrixGenerics_1.15.0                             
#> [14] matrixStats_1.2.0                                 
#> [15] GenomicRanges_1.55.1                              
#> [16] GenomeInfoDb_1.39.1                               
#> [17] IRanges_2.37.0                                    
#> [18] S4Vectors_0.41.2                                  
#> [19] BiocGenerics_0.49.1                               
#> 
#> loaded via a namespace (and not attached):
#>   [1] RColorBrewer_1.1-3        rstudioapi_0.15.0        
#>   [3] magrittr_2.0.3            GenomicFeatures_1.55.1   
#>   [5] rmarkdown_2.25            fs_1.6.3                 
#>   [7] BiocIO_1.13.0             zlibbioc_1.49.0          
#>   [9] vctrs_0.6.5               multtest_2.59.0          
#>  [11] memoise_2.0.1             Rsamtools_2.19.2         
#>  [13] DelayedMatrixStats_1.25.1 RCurl_1.98-1.13          
#>  [15] askpass_1.2.0             htmltools_0.5.7          
#>  [17] S4Arrays_1.3.1            progress_1.2.3           
#>  [19] curl_5.2.0                Rhdf5lib_1.25.1          
#>  [21] SparseArray_1.3.1         rhdf5_2.47.1             
#>  [23] nor1mix_1.3-2             plyr_1.8.9               
#>  [25] cachem_1.0.8              GenomicAlignments_1.39.0 
#>  [27] lifecycle_1.0.4           pkgconfig_2.0.3          
#>  [29] Matrix_1.6-4              R6_2.5.1                 
#>  [31] fastmap_1.1.1             GenomeInfoDbData_1.2.11  
#>  [33] digest_0.6.33             siggenes_1.77.0          
#>  [35] reshape_0.8.9             AnnotationDbi_1.65.2     
#>  [37] RSQLite_2.3.4             base64_2.0.1             
#>  [39] filelock_1.0.3            fansi_1.0.6              
#>  [41] httr_1.4.7                abind_1.4-5              
#>  [43] compiler_4.4.0            beanplot_1.3.1           
#>  [45] rngtools_1.5.2            bit64_4.0.5              
#>  [47] withr_2.5.2               BiocParallel_1.37.0      
#>  [49] DBI_1.1.3                 HDF5Array_1.31.0         
#>  [51] biomaRt_2.59.0            MASS_7.3-60.1            
#>  [53] openssl_2.1.1             rappdirs_0.3.3           
#>  [55] DelayedArray_0.29.0       rjson_0.2.21             
#>  [57] tools_4.4.0               glue_1.6.2               
#>  [59] quadprog_1.5-8            restfulr_0.0.15          
#>  [61] nlme_3.1-164              rhdf5filters_1.15.1      
#>  [63] grid_4.4.0                generics_0.1.3           
#>  [65] tzdb_0.4.0                preprocessCore_1.65.0    
#>  [67] tidyr_1.3.0               data.table_1.14.10       
#>  [69] hms_1.1.3                 xml2_1.3.6               
#>  [71] utf8_1.2.4                pillar_1.9.0             
#>  [73] stringr_1.5.1             limma_3.59.1             
#>  [75] genefilter_1.85.0         splines_4.4.0            
#>  [77] dplyr_1.1.4               BiocFileCache_2.11.1     
#>  [79] lattice_0.22-5            survival_3.5-7           
#>  [81] rtracklayer_1.63.0        bit_4.0.5                
#>  [83] GEOquery_2.71.0           annotate_1.81.0          
#>  [85] tidyselect_1.2.0          knitr_1.45               
#>  [87] xfun_0.41                 scrime_1.3.5             
#>  [89] statmod_1.5.0             stringi_1.8.3            
#>  [91] yaml_2.3.8                evaluate_0.23            
#>  [93] codetools_0.2-19          tibble_3.2.1             
#>  [95] BiocManager_1.30.22       cli_3.6.2                
#>  [97] xtable_1.8-4              Rcpp_1.0.11              
#>  [99] dbplyr_2.4.0              png_0.1-8                
#> [101] XML_3.99-0.16             readr_2.1.4              
#> [103] blob_1.2.4                prettyunits_1.2.0        
#> [105] mclust_6.0.1              doRNG_1.8.6              
#> [107] reprex_2.0.2              sparseMatrixStats_1.15.0 
#> [109] bitops_1.0-7              illuminaio_0.45.0        
#> [111] purrr_1.0.2               crayon_1.5.2             
#> [113] rlang_1.1.2               KEGGREST_1.43.0

@votti
Copy link

votti commented Dec 13, 2023

I am also affected by this, but while using the function minfi::detectionP usining matrixStats 1.2.0

Loading required package: IlluminaHumanMethylationEPICv2manifest

Error: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.
Traceback:

1. minfi::detectionP(rgset)
2. .detectionP(Red = Red, Green = Green, locusNames = locusNames, 
 .     controlIdx = controlIdx, TypeI.Red = TypeI.Red, TypeI.Green = TypeI.Green, 
 .     TypeII = TypeII)
3. .detectionP(Red = Red, Green = Green, locusNames = locusNames, 
 .     controlIdx = controlIdx, TypeI.Red = TypeI.Red, TypeI.Green = TypeI.Green, 
 .     TypeII = TypeII)
4. colMedians(rBg)
5. colMedians(rBg)
6. .local(x, rows, cols, na.rm, ..., useNames = useNames)
7. matrixStats::colMedians(x, rows = rows, cols = cols, na.rm = na.rm, 
 .     dim. = dim., ..., useNames = useNames)
8. deprecatedUseNamesNA()
9. .Defunct(msg = "useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.", 
 .     package = .packageName)

A temporary workaround is to disable the NA check in matrixStats using:
assignInNamespace("deprecatedUseNamesNA",function(){},ns="matrixStats")

I sorry for not being able to provide a minimal example as I dont have the minfiData package installed as I am working on a system where installing a new package takes an hour, but I may look into it tomorrow.

sessionInfo:

R version 4.2.3 (2023-03-15)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Debian GNU/Linux 12 (bookworm)

Matrix products: default
BLAS/LAPACK: [/opt/conda/envs/condaenv/lib/libopenblasp-r0.3.25.so](https://jupytext+.vscode-resource.vscode-cdn.net/opt/conda/envs/condaenv/lib/libopenblasp-r0.3.25.so)

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

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

other attached packages:
 [1] IlluminaHumanMethylationEPICv2anno.20a1.hg38_0.99.0
 [2] IlluminaHumanMethylationEPICv2manifest_0.99.1      
 [3] dplyr_1.1.4                                        
 [4] RColorBrewer_1.1-3                                 
 [5] limma_3.54.2                                       
 [6] minfi_1.44.0                                       
 [7] bumphunter_1.40.0                                  
 [8] locfit_1.5-9.8                                     
 [9] iterators_1.0.14                                   
[10] foreach_1.5.2                                      
[11] Biostrings_2.66.0                                  
[12] XVector_0.38.0                                     
[13] SummarizedExperiment_1.28.0                        
[14] Biobase_2.58.0                                     
[15] MatrixGenerics_1.10.0                              
[16] matrixStats_1.2.0                                  
[17] GenomicRanges_1.50.2                               
[18] GenomeInfoDb_1.34.9                                
[19] IRanges_2.32.0                                     
[20] S4Vectors_0.36.2                                   
[21] BiocGenerics_0.44.0                                
[22] ggplot2_3.4.4                                      
[23] magrittr_2.0.3                                     

loaded via a namespace (and not attached):
  [1] colorspace_2.1-0          rjson_0.2.21             
  [3] siggenes_1.72.0           mclust_6.0.1             
  [5] IRdisplay_1.1             base64enc_0.1-3          
  [7] base64_2.0.1              bit64_4.0.5              
  [9] AnnotationDbi_1.60.2      fansi_1.0.6              
 [11] xml2_1.3.6                codetools_0.2-19         
 [13] splines_4.2.3             sparseMatrixStats_1.10.0 
 [15] cachem_1.0.8              scrime_1.3.5             
 [17] IRkernel_1.3.2            jsonlite_1.8.8           
 [19] Rsamtools_2.14.0          annotate_1.76.0          
 [21] dbplyr_2.4.0              png_0.1-8                
 [23] HDF5Array_1.26.0          BiocManager_1.30.22      
 [25] readr_2.1.4               compiler_4.2.3           
 [27] httr_1.4.7                Matrix_1.6-4             
 [29] fastmap_1.1.1             cli_3.6.2                
 [31] htmltools_0.5.7           prettyunits_1.2.0        
 [33] tools_4.2.3               gtable_0.3.4             
 [35] glue_1.6.2                GenomeInfoDbData_1.2.9   
 [37] rappdirs_0.3.3            doRNG_1.8.6              
 [39] Rcpp_1.0.11               vctrs_0.6.5              
 [41] rhdf5filters_1.10.1       multtest_2.54.0          
 [43] nlme_3.1-164              preprocessCore_1.60.2    
 [45] rtracklayer_1.58.0        DelayedMatrixStats_1.20.0
 [47] stringr_1.5.1             lifecycle_1.0.4          
 [49] restfulr_0.0.15           rngtools_1.5.2           
 [51] XML_3.99-0.16             beanplot_1.3.1           
 [53] zlibbioc_1.44.0           MASS_7.3-60              
 [55] scales_1.3.0              hms_1.1.3                
 [57] GEOquery_2.66.0           rhdf5_2.42.1             
 [59] yaml_2.3.8                curl_5.2.0               
 [61] memoise_2.0.1             biomaRt_2.54.1           
 [63] reshape_0.8.9             stringi_1.8.3            
 [65] RSQLite_2.3.4             genefilter_1.80.3        
 [67] BiocIO_1.8.0              GenomicFeatures_1.50.4   
 [69] filelock_1.0.3            BiocParallel_1.32.6      
 [71] repr_1.1.6                rlang_1.1.2              
 [73] pkgconfig_2.0.3           bitops_1.0-7             
 [75] nor1mix_1.3-2             evaluate_0.23            
 [77] lattice_0.22-5            purrr_1.0.2              
 [79] Rhdf5lib_1.20.0           GenomicAlignments_1.34.1 
 [81] bit_4.0.5                 tidyselect_1.2.0         
 [83] plyr_1.8.9                R6_2.5.1                 
 [85] generics_0.1.3            pbdZMQ_0.3-10            
 [87] DelayedArray_0.24.0       DBI_1.1.3                
 [89] pillar_1.9.0              withr_2.5.2              
 [91] survival_3.5-7            KEGGREST_1.38.0          
 [93] RCurl_1.98-1.13           tibble_3.2.1             
 [95] crayon_1.5.2              uuid_1.1-1               
 [97] utf8_1.2.4                BiocFileCache_2.6.1      
 [99] tzdb_0.4.0                progress_1.2.3           
[101] grid_4.2.3                data.table_1.14.10       
[103] blob_1.2.4                digest_0.6.33            
[105] xtable_1.8-4              tidyr_1.3.0              
[107] illuminaio_0.40.0         openssl_2.1.1            
[109] munsell_0.5.0             quadprog_1.5-8           
[111] askpass_1.2.0

@votti
Copy link

votti commented Dec 13, 2023

Here a small examples how this error happens:

suppressPackageStartupMessages(library(minfi))

colMedians(matrix(data = c(1)))

Results in:

Error: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.
Traceback:

1. colMedians(matrix(data = c(1)))
2. colMedians(matrix(data = c(1)))
3. .local(x, rows, cols, na.rm, ..., useNames = useNames)
4. matrixStats::colMedians(x, rows = rows, cols = cols, na.rm = na.rm, 
 .     dim. = dim., ..., useNames = useNames)
5. deprecatedUseNamesNA()
6. .Defunct(msg = "useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.", 
 .     package = .packageName)

Same for colMeans2 that is the issue in preprocessIllumina,

Interestingly specifically using colMeans2/colMedians from matrixStats does not have this issue:

matrixStats::colMedians(matrix(data = c(1)))

or

library(matrixStats)
colMedians(matrix(data = c(1)))

so I think maybe some minfi dependency changes the colMedians function dispatched for matrix matrices.

Edit: the culprit is an outdated version of MatrixGenerics - they 'recently' fixed compatibility with matrixStats: Bioconductor/MatrixGenerics#31
Updating MatrixGenerics should fix this issue.

With the session info:

R version 4.2.3 (2023-03-15)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Debian GNU/Linux 12 (bookworm)

Matrix products: default
BLAS/LAPACK: [/opt/conda/envs/condaenv/lib/libopenblasp-r0.3.25.so](https://jupytext+.vscode-resource.vscode-cdn.net/opt/conda/envs/condaenv/lib/libopenblasp-r0.3.25.so)

locale:
[1] LC_CTYPE=C.UTF-8       LC_NUMERlibtraryIC=C           LC_TIME=C.UTF-8       
[4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
[7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

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

other attached packages:
[1] IlluminaHumanMethylationEPICv2anno.20a1.hg38_0.99.0
[2] IlluminaHumanMethylationEPICv2manifest_0.99.1      
[3] dplyr_1.1.4                                        
[4] RColorBrewer_1.1-3                                 
[5] limma_3.54.2                                       
[6] minfi_1.44.0                                       
[7] bumphunter_1.40.0                                  
[8] locfit_1.5-9.8                                     
[9] iterators_1.0.14                                   
[10] foreach_1.5.2                                      
[11] Biostrings_2.66.0                                  
[12] XVector_0.38.0                                     
[13] SummarizedExperiment_1.28.0                        
[14] Biobase_2.58.0                                     
[15] MatrixGenerics_1.10.0                              
[16] matrixStats_1.2.0                                  
[17] GenomicRanges_1.50.2                               
[18] GenomeInfoDb_1.34.9                                
[19] IRanges_2.32.0                                     
[20] S4Vectors_0.36.2                                   
[21] BiocGenerics_0.44.0                                
[22] ggplot2_3.4.4                                      
[23] magrittr_2.0.3                                     

loaded via a namespace (and not attached):
 [1] colorspace_2.1-0          rjson_0.2.21             
 [3] siggenes_1.72.0           mclust_6.0.1             
 [5] IRdisplay_1.1             base64enc_0.1-3          
 [7] base64_2.0.1              bit64_4.0.5              
 [9] AnnotationDbi_1.60.2      fansi_1.0.6              
[11] xml2_1.3.6                codetools_0.2-19         
[13] splines_4.2.3             sparseMatrixStats_1.10.0 
[15] cachem_1.0.8              scrime_1.3.5             
[17] IRkernel_1.3.2            jsonlite_1.8.8           
[19] Rsamtools_2.14.0          annotate_1.76.0          
[21] dbplyr_2.4.0              png_0.1-8                
[23] HDF5Array_1.26.0          BiocManager_1.30.22      
[25] readr_2.1.4               compiler_4.2.3           
[27] httr_1.4.7                Matrix_1.6-4             
[29] fastmap_1.1.1             cli_3.6.2                
[31] htmltools_0.5.7           prettyunits_1.2.0        
[33] tools_4.2.3               gtable_0.3.4             
[35] glue_1.6.2                GenomeInfoDbData_1.2.9   
[37] rappdirs_0.3.3            doRNG_1.8.6              
[39] Rcpp_1.0.11               vctrs_0.6.5              
[41] rhdf5filters_1.10.1       multtest_2.54.0          
[43] nlme_3.1-164              preprocessCore_1.60.2    
[45] rtracklayer_1.58.0        DelayedMatrixStats_1.20.0
[47] stringr_1.5.1             lifecycle_1.0.4          
[49] restfulr_0.0.15           rngtools_1.5.2           
[51] XML_3.99-0.16             beanplot_1.3.1           
[53] zlibbioc_1.44.0           MASS_7.3-60              
[55] scales_1.3.0              hms_1.1.3                
[57] GEOquery_2.66.0           rhdf5_2.42.1             
[59] yaml_2.3.8                curl_5.2.0               
[61] memoise_2.0.1             biomaRt_2.54.1           
[63] reshape_0.8.9             stringi_1.8.3            
[65] RSQLite_2.3.4             genefilter_1.80.3        
[67] BiocIO_1.8.0              GenomicFeatures_1.50.4   
[69] filelock_1.0.3            BiocParallel_1.32.6      
[71] repr_1.1.6                rlang_1.1.2              
[73] pkgconfig_2.0.3           bitops_1.0-7             
[75] nor1mix_1.3-2             evaluate_0.23            
[77] lattice_0.22-5            purrr_1.0.2              
[79] Rhdf5lib_1.20.0           GenomicAlignments_1.34.1 
[81] bit_4.0.5                 tidyselect_1.2.0         
[83] plyr_1.8.9                R6_2.5.1                 
[85] generics_0.1.3            pbdZMQ_0.3-10            
[87] DelayedArray_0.24.0       DBI_1.1.3                
[89] pillar_1.9.0              withr_2.5.2              
[91] survival_3.5-7            KEGGREST_1.38.0          
[93] RCurl_1.98-1.13           tibble_3.2.1             
[95] crayon_1.5.2              uuid_1.1-1               
[97] utf8_1.2.4                BiocFileCache_2.6.1      
[99] tzdb_0.4.0                progress_1.2.3           
[101] grid_4.2.3                data.table_1.14.10       
[103] blob_1.2.4                digest_0.6.33            
[105] xtable_1.8-4              tidyr_1.3.0              
[107] illuminaio_0.40.0         openssl_2.1.1            
[109] munsell_0.5.0             quadprog_1.5-8           
[111] askpass_1.2.0

that is also part of this Docker container: https://hub.docker.com/layers/votti/hcy-minifi/v0.1.7/images/sha256-2677bd133d6f7fa8bc18252d636de5f83807871873df1d94e4e4d3602456c8bc?context=explore

@Zszywek
Copy link
Author

Zszywek commented Dec 13, 2023

I actually managed to deal with the problem myself, turned out it was somehow related to the fact that I used my Linux distribution's package which itself was quite old (4.1.2. if I remember correctly, which was circa 2 years old). After adding an official PPA of r-project and upgrading everything it works properly, even though the packages versions themself didn't change. So sorry for the mayhem as I'm not even able to reproduce it anymore.

@PeteHaitch
Copy link
Contributor

Bioconductor package developers can only make changes to the release version (currently Bioconductor v3.18 with minfi v1.48.0 ) and devel version (currently Bioconductor 3.19 with minfi v1.49.0).
This means that if a CRAN-dependency makes changes (like matrixStats has) then we can only address those changes in the current release and devel versions of Bioconductor software.
That means if you are using older versions of minfi (e.g., v1.44.0) we can't make any change that would fix it for you.
Current versions of minfi work with the current version of matrixStats.

If you downgrade matrixStats to v1.1.0 or earlier (e.g., using something like remotes::install_version("matrixStats", version="1.1.0") then you might be able to continue to use older versions minfi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants