This package is designed to help you to create the methylation correlated blocks using methylation profiles. A stacked ensemble of machine learning models, which combined the Cox regression, support vector regression and elastic-net regression model, can be constructed using this package1. You also can choose one of them to build DNA methylation signatures associated with disease progression.
Note: This package is still under developing. Some of the functions may change.
Followings are brief insturctions for using this package:
You can install and test our package by downloading source package.
First, you need a methylation data set, currently only most common platform ‘Illumina Infinium Human Methylation 450K’ is supported.
You can use your own datasets,or use our demo data.
You can automatically run following:
suppressPackageStartupMessages(library(EnMCB))
methylation_dataset<-create_demo()
res<-IdentifyMCB(methylation_dataset)
## Loading required package: S4Vectors
## Loading required package: stats4
## Loading required package: BiocGenerics
##
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:stats':
##
## IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
##
## Filter, Find, Map, Position, Reduce, anyDuplicated, append,
## as.data.frame, basename, cbind, colnames, dirname, do.call,
## duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
## lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
## pmin.int, rank, rbind, rownames, sapply, setdiff, sort, table,
## tapply, union, unique, unsplit, which.max, which.min
##
## Attaching package: 'S4Vectors'
## The following objects are masked from 'package:base':
##
## I, expand.grid, unname
IdentfyMCB() function will calculated Pearson correlation coefficients between the any two CpGs. A value of Pearson correlation coefficients which under the threshold was used to identify boundaries between any two adjacent markers indicating uncorrelated methylation. Markers not separated by a boundary were combined into the MCB. You can extract the MCB information with,
and select some of MCBs for further modeling.
In order to get differentially methylated blocks, one may run following:
#simulation for the group data
groups = c(rep("control",200),rep("dis",255))
DiffMCB_resutls<-DiffMCB(methylation_dataset,
groups,
MCB)$tab
In order to build survival models, one may run following:
# sample the dataset into training set and testing set
trainingset<-colnames(methylation_dataset) %in% sample(colnames(methylation_dataset),0.6*length(colnames(methylation_dataset)))
testingset<-!trainingset
#build the models
library(survival)
data(demo_survival_data)
models<-metricMCB(MCB,
training_set = methylation_dataset[,trainingset],
Surv = demo_survival_data[trainingset],
Method = "cox",ci = TRUE)
#select the best
onemodel<-models$best_cox_model$cox_model
Then, you can predict the risk by the model you build:
newcgdata<-data.frame(t(methylation_dataset[,testingset]))
prediction_results<-predict(onemodel, newcgdata)
In order to build ensemble model, one may run following:
# You can choose one of MCBs:
select_single_one=1
em<-ensemble_model(t(MCB[select_single_one,]),
training_set=methylation_dataset[,trainingset],
Surv_training=demo_survival_data[trainingset])
Note that this function only can be used for single MCB only, otherwise the precessing time could be very long.
Then, you can predict the risk by the model you build:
em_prediction_results<-ensemble_prediction(ensemble_model = em,
prediction_data = methylation_dataset[,testingset])
This function will return the single vector with risk scores predicted by ensemble model.
For detailed information, you can find at our references.
## 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: /home/biocbuild/bbs-3.15-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.15-bioc/R/lib/libRlapack.so
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_GB LC_COLLATE=C
## [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
##
## attached base packages:
## [1] stats4 stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] survival_3.3-1 S4Vectors_0.34.0 BiocGenerics_0.42.0
## [4] EnMCB_1.8.2
##
## loaded via a namespace (and not attached):
## [1] nlme_3.1-157 survivalROC_1.0.3 rms_6.3-0
## [4] bit64_4.0.5 filelock_1.0.2 RColorBrewer_1.1-3
## [7] httr_1.4.3 tools_4.2.0 backports_1.4.1
## [10] bslib_0.3.1 utf8_1.2.2 R6_2.5.1
## [13] rpart_4.1.16 Hmisc_4.7-0 DBI_1.1.2
## [16] survivalsvm_0.0.5 colorspace_2.0-3 nnet_7.3-17
## [19] tidyselect_1.1.2 gridExtra_2.3 bit_4.0.4
## [22] curl_4.3.2 compiler_4.2.0 quantreg_5.93
## [25] glmnet_4.1-4 cli_3.3.0 htmlTable_2.4.0
## [28] SparseM_1.81 sandwich_3.0-1 sass_0.4.1
## [31] scales_1.2.0 checkmate_2.1.0 polspline_1.1.20
## [34] nnls_1.4 mvtnorm_1.1-3 quadprog_1.5-8
## [37] rappdirs_0.3.3 stringr_1.4.0 digest_0.6.29
## [40] foreign_0.8-82 rmarkdown_2.14 base64enc_0.1-3
## [43] jpeg_0.1-9 pkgconfig_2.0.3 htmltools_0.5.2
## [46] dbplyr_2.2.0 fastmap_1.1.0 htmlwidgets_1.5.4
## [49] rlang_1.0.2 rstudioapi_0.13 RSQLite_2.2.14
## [52] shape_1.4.6 jquerylib_0.1.4 generics_0.1.2
## [55] zoo_1.8-10 jsonlite_1.8.0 dplyr_1.0.9
## [58] magrittr_2.0.3 Formula_1.2-4 Matrix_1.4-1
## [61] Rcpp_1.0.8.3 munsell_0.5.0 fansi_1.0.3
## [64] partykit_1.2-15 lifecycle_1.0.1 multcomp_1.4-19
## [67] stringi_1.7.6 yaml_2.3.5 inum_1.0-4
## [70] MASS_7.3-57 BiocFileCache_2.4.0 grid_4.2.0
## [73] blob_1.2.3 parallel_4.2.0 crayon_1.5.1
## [76] lattice_0.20-45 splines_4.2.0 knitr_1.39
## [79] mboost_2.9-7 pillar_1.7.0 boot_1.3-28
## [82] codetools_0.2-18 glue_1.6.2 evaluate_0.15
## [85] latticeExtra_0.6-29 data.table_1.14.2 vctrs_0.4.1
## [88] png_0.1-7 foreach_1.5.2 MatrixModels_0.5-0
## [91] gtable_0.3.0 purrr_0.3.4 assertthat_0.2.1
## [94] cachem_1.0.6 ggplot2_3.3.6 xfun_0.31
## [97] libcoin_1.0-9 pracma_2.3.8 tibble_3.1.7
## [100] iterators_1.0.14 memoise_2.0.1 cluster_2.1.3
## [103] TH.data_1.1-1 ellipsis_0.3.2 stabs_0.6-4
Xin Yu et al. 2019 Predicting disease progression in lung adenocarcinoma patients based on methylation correlated blocks using ensemble machine learning classifiers (under review)↩