Open aciolfi opened 3 years ago
Hi aciolfi,
I was having the same issue and this is how I managed to fix it. So I basically created a new function to run DMRcate. I've commented below the lines of code which I found issues while debugging it.
DMRcate_manual_run = function(beta_matrix,
pheno,
arraytype,
dist = 2,
mafcut = 0.05,
fdr = 0.05,
lambda = 1000,
C = 2)
{
require(DMRcate)
myMs <- logit2(beta_matrix)
myMs <- rmSNPandCH(myMs, dist = dist, mafcut = mafcut)
design <- model.matrix(~ pheno)
if(arraytype == "450K"){
myannotation <- cpg.annotate(datatype = "array",
fdr = 0.05,
myMs,
design = design,
coef = ncol(design),
analysis.type = "differential",
annotation = c(array = "IlluminaHumanMethylation450k",
annotation = "ilmn12.hg19"),
what = "M")
} else {
myannotation <- cpg.annotate(datatype = "array",
fdr = 0.05,
myMs,
design = design,
coef = ncol(design),
analysis.type = "differential",
annotation = c(array = "IlluminaHumanMethylationEPIC",
annotation = "ilm10b4.hg19"),
what = "M")
}
#commenting lines with issues
# M <- do.call("cbind", lapply(myannotation, as.data.frame)) #don't know why this code is here
# colnames(M) <- names(myannotation) #don't know why this code is here
#removed unused mc.cores argument
dmrcoutput <- dmrcate(myannotation, lambda = lambda, C = C) #mc.cores = cores - this argument no longer applies
#data(dmrcatedata) - unsused line of code
DMR <- as.data.frame(extractRanges(dmrcoutput, genome = "hg19"))
rownames(DMR) <- paste("DMR", 1:nrow(DMR), sep="_")
message("DMRcate detected ", nrow(DMR)," DMRs with mafcut as = ", mafcut, ".")
if(nrow(DMR) == 0)
stop("No DMR detected.")
return(DMR)
}
#to run
DMRs <- DMRcate_manual_run(beta_matrix, pheno, "EPIC")
Thanks a lot for the code!
Il giorno mar 30 mar 2021 alle 03:45 Alessandra Santana < @.***> ha scritto:
Hi aciolfi,
I was having the same issue and this is how I managed to fix it. So I basically created a new function to run DMRcate. I've commented below the lines of code which I found issues while debugging it.
DMRcate_manual_run = function(beta_matrix, pheno, arraytype, dist = 2, mafcut = 0.05, fdr = 0.05, lambda = 1000, C = 2) {
require(DMRcate) myMs <- logit2(beta_matrix) myMs <- rmSNPandCH(myMs, dist = dist, mafcut = mafcut) design <- model.matrix(~ pheno)
if(arraytype == "450K"){ myannotation <- cpg.annotate(datatype = "array", fdr = 0.05, myMs, design = design, coef = ncol(design), analysis.type = "differential", annotation = c(array = "IlluminaHumanMethylation450k", annotation = "ilmn12.hg19"), what = "M") } else { myannotation <- cpg.annotate(datatype = "array", fdr = 0.05, myMs, design = design, coef = ncol(design), analysis.type = "differential", annotation = c(array = "IlluminaHumanMethylationEPIC", annotation = "ilm10b4.hg19"), what = "M") }
commenting lines with issues
M <- do.call("cbind", lapply(myannotation, as.data.frame)) #don't know why this code is here
colnames(M) <- names(myannotation) #don't know why this code is here
removed unused mc.cores argument
dmrcoutput <- dmrcate(myannotation, lambda = lambda, C = C) #mc.cores = cores - this argument no longer applies
data(dmrcatedata) - unsused line of code
DMR <- as.data.frame(extractRanges(dmrcoutput, genome = "hg19")) rownames(DMR) <- paste("DMR", 1:nrow(DMR), sep="_")
message("DMRcate detected ", nrow(DMR)," DMRs with mafcut as = ", mafcut, ".") if(nrow(DMR) == 0) stop("No DMR detected.")
return(DMR) }
to runDMRs <- DMRcate_manual_run(beta_matrix, pheno, "EPIC")
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/YuanTian1991/ChAMP/issues/18#issuecomment-809842467, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELVFVYRIO5736M6GTREH7DTGEULTANCNFSM4T3GU5NA .
Hi,
Thanks for the answers and do we have the "compare.group" parametre to specify the comparison?
Cheers Claire
No, as far as I know there is no way to specify this info using DMRcate, unfortunately.
Best, Andrea
Il giorno lun 17 mag 2021 alle 02:32 ClaireXinSun @.***> ha scritto:
Hi,
Thanks for the answers and do we have the "compare.group" parametre to specify the comparison?
Cheers Claire
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/YuanTian1991/ChAMP/issues/18#issuecomment-841905716, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELVFVZD57XOYP4GAHZXHRLTOBP3XANCNFSM4T3GU5NA .
Hi! I am still experiencing this issue, however, i am not experiencing it when running DMRcate separately/standalone. Any updates from the authors regarding this issue?
Hi! I'm experiencing the same issue:
myDMR <- champ.DMR(beta=myCombat,
+ pheno=myLoad$pd$AMH,
+ compare.group=NULL, # not important with 2 groups
+ arraytype="EPIC",
+ method = "DMRcate",
+ minProbes=7, # 3 in campagna et al default is 7
+ adjPvalDmr=0.05,
+ cores=5,
+ ## following parameters are specifically for DMRcate method.
+ rmSNPCH=T,
+ fdr=0.05,
+ dist=2,
+ mafcut=0.05,
+ lambda=1000,
+ C=2)
[===========================]
[<<<<< ChAMP.DMR START >>>>>]
-----------------------------
!!! important !!! We just upgrate champ.DMR() function, since now champ.DMP() could works on multiple phenotypes, but ProbeLasso can only works on one DMP result, so if your pheno parameter contains more than 2 phenotypes, and you want to use ProbeLasso function, you MUST specify compare.group=c("A","B"). Bumphunter and DMRcate should not be influenced.
[ Section 1: Check Input Pheno Start ]
You pheno is factor type.
Your pheno information contains following groups. >>
<2>:125 samples.
<1>:83 samples.
[ Section 1: Check Input Pheno Done ]
[ Section 2: Run DMR Algorithm Start ]
5 cores will be used to do parallel DMRcate computing.
<< Find DMR with DMRcate Method >>
snapshotDate(): 2023-04-24
see ?DMRcatedata and browseVignettes('DMRcatedata') for documentation
loading from cache
see ?DMRcatedata and browseVignettes('DMRcatedata') for documentation
loading from cache
Your contrast returned 5961 individually significant probes. We recommend the default setting of pcutoff in dmrcate().
Error in as.list.default(X) :
no method for coercing this S4 class to a vector
My session info:
R version 4.3.1 (2023-06-16)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.0
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/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: Europe/Oslo
tzcode source: internal
attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] shiny_1.8.0 DMRcatedata_2.18.0
[3] ExperimentHub_2.8.1 AnnotationHub_3.8.0
[5] BiocFileCache_2.8.0 dbplyr_2.3.4
[7] IlluminaHumanMethylationEPICanno.ilm10b4.hg19_0.6.0 ChAMP_2.30.0
[9] RPMM_1.25 cluster_2.1.4
[11] DT_0.30 IlluminaHumanMethylationEPICmanifest_0.3.0
[13] Illumina450ProbeVariants.db_1.36.0 DMRcate_2.14.1
[15] ChAMPdata_2.32.0 minfi_1.46.0
[17] bumphunter_1.42.0 locfit_1.5-9.8
[19] iterators_1.0.14 foreach_1.5.2
[21] Biostrings_2.68.1 XVector_0.40.0
[23] SummarizedExperiment_1.30.2 Biobase_2.60.0
[25] MatrixGenerics_1.12.3 matrixStats_1.1.0
[27] GenomicRanges_1.52.1 GenomeInfoDb_1.36.4
[29] IRanges_2.34.1 S4Vectors_0.38.2
[31] BiocGenerics_0.46.0
loaded via a namespace (and not attached):
[1] DSS_2.48.0 ProtGenerics_1.32.0
[3] bitops_1.0-7 doParallel_1.0.17
[5] httr_1.4.7 RColorBrewer_1.1-3
[7] tools_4.3.1 doRNG_1.8.6
[9] backports_1.4.1 utf8_1.2.4
[11] R6_2.5.1 HDF5Array_1.28.1
[13] lazyeval_0.2.2 mgcv_1.9-0
[15] Gviz_1.44.2 methylumi_2.46.0
[17] rhdf5filters_1.12.1 permute_0.9-7
[19] withr_2.5.2 ROC_1.76.0
[21] prettyunits_1.2.0 gridExtra_2.3
[23] base64_2.0.1 preprocessCore_1.62.1
[25] cli_3.6.1 wateRmelon_2.6.0
[27] sass_0.4.7 JADE_2.0-4
[29] readr_2.1.4 genefilter_1.82.1
[31] goseq_1.52.0 askpass_1.2.0
[33] Rsamtools_2.16.0 foreign_0.8-85
[35] siggenes_1.74.0 illuminaio_0.42.0
[37] R.utils_2.12.3 lumi_2.52.0
[39] dichromat_2.0-0.1 scrime_1.3.5
[41] BSgenome_1.68.0 limma_3.56.2
[43] readxl_1.4.3 impute_1.74.1
[45] rstudioapi_0.15.0 RSQLite_2.3.3
[47] generics_0.1.3 BiocIO_1.10.0
[49] combinat_0.0-8 crosstalk_1.2.0
[51] gtools_3.9.4 dendextend_1.17.1
[53] dplyr_1.1.4 GO.db_3.17.0
[55] Matrix_1.6-3 interp_1.1-4
[57] fansi_1.0.5 abind_1.4-5
[59] R.methodsS3_1.8.2 lifecycle_1.0.4
[61] yaml_2.3.7 edgeR_3.42.4
[63] qvalue_2.32.0 rhdf5_2.44.0
[65] grid_4.3.1 blob_1.2.4
[67] promises_1.2.1 crayon_1.5.2
[69] lattice_0.22-5 GenomicFeatures_1.52.2
[71] annotate_1.78.0 KEGGREST_1.40.1
[73] pillar_1.9.0 knitr_1.45
[75] beanplot_1.3.1 rjson_0.2.21
[77] marray_1.78.0 codetools_0.2-19
[79] glue_1.6.2 data.table_1.14.8
[81] vctrs_0.6.4 png_0.1-8
[83] cellranger_1.1.0 gtable_0.3.4
[85] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.1 cachem_1.0.8
[87] xfun_0.41 S4Arrays_1.0.6
[89] mime_0.12 survival_3.5-7
[91] shinythemes_1.2.0 fastICA_1.2-3
[93] statmod_1.5.0 interactiveDisplayBase_1.38.0
[95] ellipsis_0.3.2 nlme_3.1-163
[97] kpmt_0.1.0 bit64_4.0.5
[99] bsseq_1.36.0 progress_1.2.2
[101] filelock_1.0.2 bslib_0.5.1
[103] nor1mix_1.3-2 affyio_1.70.0
[105] KernSmooth_2.23-22 IlluminaHumanMethylation450kmanifest_0.4.0
[107] rpart_4.1.21 colorspace_2.1-0
[109] DBI_1.1.3 Hmisc_5.1-1
[111] nnet_7.3-19 DNAcopy_1.74.1
[113] tidyselect_1.2.0 bit_4.0.5
[115] compiler_4.3.1 curl_5.1.0
[117] htmlTable_2.4.2 BiasedUrn_2.0.11
[119] xml2_1.3.5 plotly_4.10.3
[121] DelayedArray_0.26.7 rtracklayer_1.60.1
[123] checkmate_2.3.0 scales_1.2.1
[125] affy_1.78.2 quadprog_1.5-8
[127] rappdirs_0.3.3 stringr_1.5.1
[129] digest_0.6.33 rmarkdown_2.25
[131] GEOquery_2.68.0 htmltools_0.5.7
[133] pkgconfig_2.0.3 jpeg_0.1-10
[135] base64enc_0.1-3 sparseMatrixStats_1.12.2
[137] fastmap_1.1.1 ensembldb_2.24.1
[139] rlang_1.1.2 htmlwidgets_1.6.2
[141] DelayedMatrixStats_1.22.6 farver_2.1.1
[143] jquerylib_0.1.4 jsonlite_1.8.7
[145] BiocParallel_1.34.2 mclust_6.0.1
[147] R.oo_1.25.0 VariantAnnotation_1.46.0
[149] RCurl_1.98-1.13 magrittr_2.0.3
[151] Formula_1.2-5 GenomeInfoDbData_1.2.10
[153] Rhdf5lib_1.22.1 munsell_0.5.0
[155] Rcpp_1.0.11 viridis_0.6.4
[157] stringi_1.8.1 nleqslv_3.3.4
[159] zlibbioc_1.46.0 MASS_7.3-60
[161] globaltest_5.54.0 plyr_1.8.9
[163] org.Hs.eg.db_3.17.0 deldir_1.0-9
[165] splines_4.3.1 multtest_2.56.0
[167] geneLenDataBase_1.36.0 hms_1.1.3
[169] rngtools_1.5.2 reshape2_1.4.4
[171] biomaRt_2.56.1 BiocVersion_3.17.1
[173] missMethyl_1.34.0 XML_3.99-0.15
[175] evaluate_0.23 latticeExtra_0.6-30
[177] biovizBase_1.48.0 BiocManager_1.30.22
[179] isva_1.9 tzdb_0.4.0
[181] httpuv_1.6.12 tidyr_1.3.0
[183] openssl_2.1.1 purrr_1.0.2
[185] clue_0.3-65 reshape_0.8.9
[187] ggplot2_3.4.4 xtable_1.8-4
[189] restfulr_0.0.15 AnnotationFilter_1.24.0
[191] later_1.3.1 viridisLite_0.4.2
[193] tibble_3.2.1 memoise_2.0.1
[195] AnnotationDbi_1.62.2 GenomicAlignments_1.36.0
[197] sva_3.48.0
Hi! I am experiencing the same problem when analyzing 850K data, can the authors give us some help?
Hi Tian, I cannot use champ.DMR with DMRcate method, since I always receive the same error:
Here's my sessionInfo:
Could you please help me to understand what is going wrong? Thank you