preprocessIllumina error with EPICv2 array
1
0
Entering edit mode
Rakesh • 0
@63a8a78e
Last seen 6 days ago
United States

I've been trying to analyze data collected using the EPIC V2 array and have been running into issues using the preprocessIllumina function. I should be using the correct version of the EPICv2 manifest (see the first line of the script and the sessionInfo for the loaded R libraries).

> meth@annotation <- c(array = "IlluminaHumanMethylationEPICv2", annotation = "20a1.hg38")

> MSet.norm<-preprocessIllumina(meth, bg.correct = TRUE, normalize = "no")
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'X' in selecting a method for function 'apply': object 'NegControls' not found

> sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Rocky Linux 9.2 (Blue Onyx)

Matrix products: default
BLAS/LAPACK: /data/apps/software/spack/linux-rocky9-x86_64_v3/gcc-11.3.1/openblas-0.3.27-fvnsluafkwg3hhnlpvj34jtx657mywxl/lib/libopenblas-r0.3.27.so;  LAPACK version 3.12.0

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

time zone: America/New_York
tzcode source: internal

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

other attached packages:
 [1] IlluminaHumanMethylationEPICv2manifest_1.0.0      
 [2] IlluminaHumanMethylationEPICv2anno.20a1.hg38_1.0.0
 [3] ENmix_1.40.2                                      
 [4] doParallel_1.0.17                                 
 [5] stringr_1.5.1                                     
 [6] minfi_1.50.0                                      
 [7] bumphunter_1.46.0                                 
 [8] locfit_1.5-9.10                                   
 [9] iterators_1.0.14                                  
[10] foreach_1.5.2                                     
[11] Biostrings_2.72.1                                 
[12] XVector_0.44.0                                    
[13] SummarizedExperiment_1.34.0                       
[14] Biobase_2.64.0                                    
[15] MatrixGenerics_1.16.0                             
[16] matrixStats_1.4.1                                 
[17] GenomicRanges_1.56.2                              
[18] GenomeInfoDb_1.40.1                               
[19] IRanges_2.38.1                                    
[20] S4Vectors_0.42.1                                  
[21] BiocGenerics_0.50.0                               
[22] ggplot2_3.5.1                                     
[23] dplyr_1.1.4                                       

loaded via a namespace (and not attached):
  [1] RColorBrewer_1.1-3        jsonlite_1.8.9           
  [3] magrittr_2.0.3            GenomicFeatures_1.56.0   
  [5] BiocIO_1.14.0             zlibbioc_1.50.0          
  [7] vctrs_0.6.5               multtest_2.60.0          
  [9] memoise_2.0.1             Rsamtools_2.20.0         
 [11] DelayedMatrixStats_1.26.0 RCurl_1.98-1.16          
 [13] askpass_1.2.1             S4Arrays_1.4.1           
 [15] AnnotationHub_3.12.0      dynamicTreeCut_1.63-1    
 [17] curl_5.2.3                Rhdf5lib_1.26.0          
 [19] RPMM_1.25                 SparseArray_1.4.8        
 [21] rhdf5_2.48.0              KernSmooth_2.23-24       
 [23] nor1mix_1.3-3             plyr_1.8.9               
 [25] impute_1.78.0             cachem_1.1.0             
 [27] GenomicAlignments_1.40.0  lifecycle_1.0.4          
 [29] pkgconfig_2.0.3           Matrix_1.7-0             
 [31] R6_2.5.1                  fastmap_1.2.0            
 [33] GenomeInfoDbData_1.2.12   digest_0.6.37            
 [35] colorspace_2.1-1          siggenes_1.78.0          
 [37] reshape_0.8.9             AnnotationDbi_1.66.0     
 [39] irlba_2.3.5.1             ExperimentHub_2.12.0     
 [41] geneplotter_1.82.0        RSQLite_2.3.7            
 [43] base64_2.0.2              filelock_1.0.3           
 [45] fansi_1.0.6               httr_1.4.7               
 [47] abind_1.4-8               compiler_4.4.1           
 [49] beanplot_1.3.1            rngtools_1.5.2           
 [51] bit64_4.5.2               withr_3.0.1              
 [53] BiocParallel_1.38.0       DBI_1.2.3                
 [55] gplots_3.2.0              HDF5Array_1.32.1         
 [57] MASS_7.3-61               openssl_2.2.2            
 [59] rappdirs_0.3.3            DelayedArray_0.30.1      
 [61] rjson_0.2.23              caTools_1.18.3           
 [63] gtools_3.9.5              tools_4.4.1              
 [65] glue_1.8.0                quadprog_1.5-8           
 [67] restfulr_0.0.15           nlme_3.1-166             
 [69] rhdf5filters_1.16.0       grid_4.4.1               
 [71] cluster_2.1.6             generics_0.1.3           
 [73] gtable_0.3.5              tzdb_0.4.0               
 [75] preprocessCore_1.66.0     tidyr_1.3.1              
 [77] data.table_1.16.2         hms_1.1.3                
 [79] xml2_1.3.6                utf8_1.2.4               
 [81] BiocVersion_3.19.1        pillar_1.9.0             
 [83] limma_3.60.6              genefilter_1.86.0        
 [85] splines_4.4.1             BiocFileCache_2.12.0     
 [87] lattice_0.22-6            survival_3.7-0           
 [89] rtracklayer_1.64.0        bit_4.5.0                
 [91] GEOquery_2.72.0           annotate_1.82.0          
 [93] tidyselect_1.2.1          scrime_1.3.5             
 [95] statmod_1.5.0             stringi_1.8.4            
 [97] UCSC.utils_1.0.0          yaml_2.3.10              
 [99] codetools_0.2-20          tibble_3.2.1             
[101] BiocManager_1.30.25       cli_3.6.3                
[103] xtable_1.8-4              munsell_0.5.1            
[105] Rcpp_1.0.13               dbplyr_2.5.0             
[107] png_0.1-8                 XML_3.99-0.14            
[109] readr_2.1.5               blob_1.2.4               
[111] mclust_6.1.1              doRNG_1.8.6              
[113] sparseMatrixStats_1.16.0  bitops_1.0-9             
[115] scales_1.3.0              illuminaio_0.46.0        
[117] purrr_1.0.2               crayon_1.5.3             
[119] rlang_1.1.4               KEGGREST_1.44.1

I believe the error might be attributable to the fact that, in the code for the bgcorrect.illumina function (which is called by preprocessIllumina), the conditional statements don't include the V2 array (relevant excerpt):

    if (.is450k(rgSet) || .isEPIC(rgSet) || .isAllergy(rgSet)) {
        NegControls <- getControlAddress(rgSet, controlType = "NEGATIVE")
    }
    if (.is27k(rgSet)) {
        NegControls <- getControlAddress(rgSet, controlType = "Negative")
    }

Does anyone know how to resolve this issue? Is it as simple as adding:

.isEPICv2 <- function(object) {
    annotation(object)["array"] == "IlluminaHumanMethylationEPICv2"
}

to the utils.R file and updating the preprocessIllumina function to state:

    if (.is450k(rgSet) || .isEPIC(rgSet) || .isAllergy(rgSet) || .isEPICv2(rgSet)) {
        NegControls <- getControlAddress(rgSet, controlType = "NEGATIVE")
    }
    if (.is27k(rgSet)) {
        NegControls <- getControlAddress(rgSet, controlType = "Negative")
    }
minfi EPICv2manifest • 319 views
ADD COMMENT
2
Entering edit mode
@james-w-macdonald-5106
Last seen 2 days ago
United States

You shouldn't need to change the annotation, and certainly not like that. You should never need to use the @ function directly - there are usually functions intended to do what you are already doing (the annotation function in this case), and you should seek them out rather than doing direct access to an S4 object. And anyway, I already added functionality to automatically recognize the array type.

As an example:

> z <- read.metharray.exp(targets = targets[1:5,])
> z
class: RGChannelSet 
dim: 1105209 5 
metadata(0):
assays(2): Green Red
rownames(1105209): 1600157 1600179 ... 99810982 99810990
rowData names(0):
colnames(5): 207810880123_R07C01 207837970016_R02C01
  207837970016_R03C01 207837970016_R04C01 207837970016_R05C01
colData names(9): Sample_Name Sample_Well ... Basename filenames
Annotation
  array: IlluminaHumanMethylationEPICv2
  annotation: 20a1.hg38

So no need to change the annotation. I have also pushed updates so preprocessIllumina will recognize the array type.

> zz <- preprocessIllumina(z, TRUE, "no")
Loading required package: IlluminaHumanMethylationEPICv2manifest
> zz
class: MethylSet 
dim: 936990 5 
metadata(0):
assays(2): Meth Unmeth
rownames(936990): cg25324105_BC11 cg25383568_TC11 ...
  ch.12.78471492F_BC21 ch.21.43742285F_BC21
rowData names(0):
colnames(5): 207810880123_R07C01 207837970016_R02C01
  207837970016_R03C01 207837970016_R04C01 207837970016_R05C01
colData names(9): Sample_Name Sample_Well ... Basename filenames
Annotation
  array: IlluminaHumanMethylationEPICv2
  annotation: 20a1.hg38
Preprocessing
  Method: Illumina, bg.correct = TRUE, normalize = no, reference = 1
  minfi version: 1.53.1
  Manifest version: 1.0.0

The updated version should propagate in the next day or so, but if you are impatient you can get it from my GitHub

library(BiocManager)
install("jmacdon/minfi", ref = "RELEASE_3_20")
0
Entering edit mode

Amazing, thanks for the help!

ADD REPLY

Login before adding your answer.

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