Error ("could not find function "EM_estimate"") when running ENmix mpreprocess() on Microsoft Azure
0
0
Entering edit mode
balf0020 • 0
@6ed45d16
Last seen 2 days ago
Australia

I am encountering an error while trying to run code from the first example in the ENmix user guide in a Microsoft Azure notebook. I have two code cells, as below.

Code cell 1:

# Create user library directory with explicit permissions
user_lib <- path.expand("~/R/library")
dir.create(user_lib, recursive = TRUE, showWarnings = FALSE)
Sys.chmod(user_lib, mode = "0777")

# Add user library to .libPaths()
.libPaths(c(user_lib, .libPaths()))

# Set repository
options(repos = c(CRAN = "https://cloud.r-project.org"))

# Install BiocManager with explicit library location
install.packages("BiocManager", lib = user_lib)

# Load BiocManager from the user library
library(BiocManager, lib.loc = user_lib)

# Install Bioconductor packages with explicit library location
BiocManager::install(c(
  "ENmix",
  "minfiData"
), force = TRUE, dependencies = TRUE, lib = user_lib)

Code cell 2:

library(ENmix)
library(minfiData)
#read in IDAT files
path <- file.path(find.package("minfiData"),"extdata")
rgSet <- readidat(path = path,recursive = TRUE)
#quality control, data pre-processing and imputation
beta=mpreprocess(rgSet,nCores=6,qc=TRUE,fqcfilter=TRUE,
                 rmcr=TRUE,impute=TRUE)

Code cell 2 produced the output below.

[readidat] Found 6 files with suffix _Grn.idat

[readidat] Found 6 files with suffix _Red.idat

[readidat] Red Green Channel contains 621926 probes and 6 Samples

1  samples with percentage of low quality CpG value greater than  0.05  or bisulfite intensity less than  16095.2 
5021  CpGs with percentage of low quality value greater than  0.05 
Ploting qc_sample.jpg ...Done
Ploting qc_CpG.jpg ...Done
Identifying ourlier samples based on beta or total intensity values...
After excluding low quality samples and CpGs
1  samples are outliers based on averaged total intensity value 
0  samples are outliers in beta value distribution 
1  outlier samples were added into badsample list
WARNING: Sample size may be too small to correctly identify outlier samples!
RECOMMAND: set outlier=FALSE or double check total intensity and beta value 
     distribution plots to confirm
Ploting freqpolygon_beta_beforeQC.jpg ...Done
Ploting freqpolygon_beta_afterQC.jpg ...Done
2  samples were excluded before ENmix correction
5021  CpGs were excluded before ENmix correction
Analysis is running, please wait...!
Error in {: task 1 failed - "could not find function "EM_estimate""
Traceback:

1. preprocessENmix(rgSet, bgParaEst = bgParaEst, QCinfo = qc, dyeCorr = dyeCorr, 
 .     nCores = nCores)
2. enmix(cg_grn, bgGI, bgParaEst, nCores)
3. foreach(i = 1:ncol(meth), .combine = cbind, .export = c("EM_estimate", 
 .     "new_cm", "enmix_adj")) %dopar% {
 .     i = i
 .     enmix_adj(meth[, i], bg[i, ], bgParaEst)
 . }
4. e$fun(obj, substitute(ex), parent.frame(), e$data)
5. stop(simpleError(msg, call = expr))

Note the error about not being able to find the function "EM_estimate". I ran the code below on my personal computer, and it worked fine.

Code run on my personal computer:

install.packages("BiocManager")

BiocManager::install(c(
  "ENmix",
  "minfiData"
), dependencies = TRUE)

library(ENmix)
library(minfiData)
#read in IDAT files
path <- file.path(find.package("minfiData"),"extdata")
rgSet <- readidat(path = path,recursive = TRUE)
#quality control, data pre-processing and imputation
beta=mpreprocess(rgSet,nCores=6,qc=TRUE,fqcfilter=TRUE,
                 rmcr=TRUE,impute=TRUE)

Does anyone know how to get this working on Azure? I'm assuming the issue is something to do with Azure, because it works on my personal computer.

Thank you!

Here is the output of sessionInfo() on Azure:

R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 20.04.6 LTS

Matrix products: default
BLAS/LAPACK: /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64_lin/libmkl_rt.so;  LAPACK version 3.7.0

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   

time zone: Etc/UTC
tzcode source: system (glibc)

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

other attached packages:
 [1] minfiData_0.52.0                                  
 [2] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.1
 [3] IlluminaHumanMethylation450kmanifest_0.4.0        
 [4] minfi_1.52.1                                      
 [5] bumphunter_1.48.0                                 
 [6] locfit_1.5-9.10                                   
 [7] Biostrings_2.74.1                                 
 [8] XVector_0.46.0                                    
 [9] ENmix_1.42.0                                      
[10] SummarizedExperiment_1.36.0                       
[11] Biobase_2.66.0                                    
[12] GenomicRanges_1.58.0                              
[13] GenomeInfoDb_1.42.1                               
[14] IRanges_2.40.1                                    
[15] S4Vectors_0.44.0                                  
[16] BiocGenerics_0.52.0                               
[17] MatrixGenerics_1.18.0                             
[18] matrixStats_1.4.1                                 
[19] doParallel_1.0.17                                 
[20] iterators_1.0.14                                  
[21] foreach_1.5.2                                     
[22] BiocManager_1.30.25                               

loaded via a namespace (and not attached):
  [1] RColorBrewer_1.1-3        jsonlite_1.8.9           
  [3] magrittr_2.0.3            GenomicFeatures_1.58.0   
  [5] BiocIO_1.16.0             zlibbioc_1.52.0          
  [7] vctrs_0.6.5               multtest_2.62.0          
  [9] memoise_2.0.1             Rsamtools_2.22.0         
 [11] DelayedMatrixStats_1.28.0 RCurl_1.98-1.16          
 [13] askpass_1.2.0             base64enc_0.1-3          
 [15] htmltools_0.5.8.1         S4Arrays_1.6.0           
 [17] AnnotationHub_3.14.0      dynamicTreeCut_1.63-1    
 [19] curl_5.2.3                Rhdf5lib_1.28.0          
 [21] SparseArray_1.6.0         rhdf5_2.50.1             
 [23] RPMM_1.25                 KernSmooth_2.23-24       
 [25] nor1mix_1.3-3             plyr_1.8.9               
 [27] impute_1.80.0             cachem_1.1.0             
 [29] uuid_1.2-1                GenomicAlignments_1.42.0 
 [31] lifecycle_1.0.4           pkgconfig_2.0.3          
 [33] Matrix_1.6-5              R6_2.5.1                 
 [35] fastmap_1.2.0             GenomeInfoDbData_1.2.13  
 [37] digest_0.6.37             siggenes_1.80.0          
 [39] reshape_0.8.9             AnnotationDbi_1.68.0     
 [41] irlba_2.3.5.1             ExperimentHub_2.14.0     
 [43] geneplotter_1.84.0        RSQLite_2.3.9            
 [45] base64_2.0.2              filelock_1.0.3           
 [47] fansi_1.0.6               httr_1.4.7               
 [49] abind_1.4-8               compiler_4.4.1           
 [51] beanplot_1.3.1            rngtools_1.5.2           
 [53] bit64_4.5.2               BiocParallel_1.40.0      
 [55] DBI_1.2.3                 gplots_3.2.0             
 [57] HDF5Array_1.34.0          MASS_7.3-61              
 [59] openssl_2.2.2             rappdirs_0.3.3           
 [61] DelayedArray_0.32.0       rjson_0.2.23             
 [63] caTools_1.18.3            gtools_3.9.5             
 [65] tools_4.4.1               rentrez_1.2.3            
 [67] glue_1.7.0                quadprog_1.5-8           
 [69] restfulr_0.0.15           nlme_3.1-165             
 [71] rhdf5filters_1.18.0       grid_4.4.1               
 [73] pbdZMQ_0.3-13             cluster_2.1.6            
 [75] generics_0.1.3            tzdb_0.4.0               
 [77] preprocessCore_1.68.0     tidyr_1.3.1              
 [79] hms_1.1.3                 data.table_1.16.0        
 [81] xml2_1.3.6                utf8_1.2.4               
 [83] BiocVersion_3.20.0        pillar_1.9.0             
 [85] IRdisplay_1.1             limma_3.62.1             
 [87] genefilter_1.88.0         splines_4.4.1            
 [89] dplyr_1.1.4               BiocFileCache_2.14.0     
 [91] lattice_0.22-5            survival_3.7-0           
 [93] rtracklayer_1.66.0        bit_4.5.0                
 [95] GEOquery_2.74.0           annotate_1.84.0          
 [97] tidyselect_1.2.1          scrime_1.3.5             
 [99] statmod_1.5.0             UCSC.utils_1.2.0         
[101] yaml_2.3.10               evaluate_1.0.0           
[103] codetools_0.2-19          tibble_3.2.1             
[105] cli_3.6.3                 IRkernel_1.3.2           
[107] xtable_1.8-4              repr_1.1.7               
[109] Rcpp_1.0.13               dbplyr_2.5.0             
[111] png_0.1-8                 XML_3.99-0.18            
[113] readr_2.1.5               blob_1.2.4               
[115] mclust_6.1.1              doRNG_1.8.6              
[117] sparseMatrixStats_1.18.0  bitops_1.0-8             
[119] illuminaio_0.48.0         purrr_1.0.2              
[121] crayon_1.5.3              rlang_1.1.4              
[123] KEGGREST_1.46.0

Here is the output of sessionInfo() on my personal computer:

R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26100)

Matrix products: default


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

time zone: Australia
tzcode source: internal

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

other attached packages:
 [1] minfiData_0.52.0                                  
 [2] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.1
 [3] IlluminaHumanMethylation450kmanifest_0.4.0        
 [4] minfi_1.52.1                                      
 [5] bumphunter_1.48.0                                 
 [6] locfit_1.5-9.10                                   
 [7] Biostrings_2.74.1                                 
 [8] XVector_0.46.0                                    
 [9] ENmix_1.42.0                                      
[10] SummarizedExperiment_1.36.0                       
[11] Biobase_2.66.0                                    
[12] GenomicRanges_1.58.0                              
[13] GenomeInfoDb_1.42.1                               
[14] IRanges_2.40.1                                    
[15] S4Vectors_0.44.0                                  
[16] BiocGenerics_0.52.0                               
[17] MatrixGenerics_1.18.0                             
[18] matrixStats_1.4.1                                 
[19] doParallel_1.0.17                                 
[20] iterators_1.0.14                                  
[21] foreach_1.5.2                                     

loaded via a namespace (and not attached):
  [1] RColorBrewer_1.1-3        rstudioapi_0.17.1        
  [3] jsonlite_1.8.9            magrittr_2.0.3           
  [5] GenomicFeatures_1.58.0    BiocIO_1.16.0            
  [7] zlibbioc_1.52.0           vctrs_0.6.5              
  [9] multtest_2.62.0           memoise_2.0.1            
 [11] Rsamtools_2.22.0          DelayedMatrixStats_1.28.0
 [13] RCurl_1.98-1.16           askpass_1.2.1            
 [15] S4Arrays_1.6.0            dynamicTreeCut_1.63-1    
 [17] AnnotationHub_3.14.0      curl_6.0.1               
 [19] Rhdf5lib_1.28.0           SparseArray_1.6.0        
 [21] rhdf5_2.50.1              RPMM_1.25                
 [23] KernSmooth_2.23-24        nor1mix_1.3-3            
 [25] plyr_1.8.9                impute_1.80.0            
 [27] cachem_1.1.0              GenomicAlignments_1.42.0 
 [29] lifecycle_1.0.4           pkgconfig_2.0.3          
 [31] Matrix_1.7-0              R6_2.5.1                 
 [33] fastmap_1.2.0             GenomeInfoDbData_1.2.13  
 [35] digest_0.6.37             siggenes_1.80.0          
 [37] reshape_0.8.9             AnnotationDbi_1.68.0     
 [39] irlba_2.3.5.1             geneplotter_1.84.0       
 [41] ExperimentHub_2.14.0      RSQLite_2.3.9            
 [43] base64_2.0.2              filelock_1.0.3           
 [45] httr_1.4.7                abind_1.4-8              
 [47] compiler_4.4.1            beanplot_1.3.1           
 [49] rngtools_1.5.2            bit64_4.5.2              
 [51] BiocParallel_1.40.0       DBI_1.2.3                
 [53] gplots_3.2.0              HDF5Array_1.34.0         
 [55] MASS_7.3-60.2             openssl_2.3.0            
 [57] rappdirs_0.3.3            DelayedArray_0.32.0      
 [59] rjson_0.2.23              caTools_1.18.3           
 [61] gtools_3.9.5              tools_4.4.1              
 [63] rentrez_1.2.3             glue_1.8.0               
 [65] quadprog_1.5-8            restfulr_0.0.15          
 [67] nlme_3.1-164              rhdf5filters_1.18.0      
 [69] grid_4.4.1                cluster_2.1.6            
 [71] generics_0.1.3            tzdb_0.4.0               
 [73] preprocessCore_1.68.0     tidyr_1.3.1              
 [75] data.table_1.16.4         hms_1.1.3                
 [77] xml2_1.3.6                BiocVersion_3.20.0       
 [79] pillar_1.10.0             limma_3.62.1             
 [81] genefilter_1.88.0         splines_4.4.1            
 [83] dplyr_1.1.4               BiocFileCache_2.14.0     
 [85] lattice_0.22-6            renv_1.0.11              
 [87] survival_3.6-4            rtracklayer_1.66.0       
 [89] bit_4.5.0.1               GEOquery_2.74.0          
 [91] annotate_1.84.0           tidyselect_1.2.1         
 [93] scrime_1.3.5              statmod_1.5.0            
 [95] UCSC.utils_1.2.0          yaml_2.3.10              
 [97] codetools_0.2-20          tibble_3.2.1             
 [99] BiocManager_1.30.25       cli_3.6.3                
[101] xtable_1.8-4              Rcpp_1.0.13-1            
[103] dbplyr_2.5.0              png_0.1-8                
[105] XML_3.99-0.18             readr_2.1.5              
[107] blob_1.2.4                mclust_6.1.1             
[109] doRNG_1.8.6               sparseMatrixStats_1.18.0 
[111] bitops_1.0-9              illuminaio_0.48.0        
[113] purrr_1.0.2               crayon_1.5.3             
[115] rlang_1.1.4               KEGGREST_1.46.0
Preprocessing ENmix • 42 views
ADD COMMENT

Login before adding your answer.

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