## ---- echo = true,警告= false,结果='hide'---------------------------------------------------------------------------------------------------------------------------------------------- #if(!requireNamespace("BiocManager", quietly = TRUE)) # install.packages("BiocManager") #BiocManager::install("EnMCB") ## ----echo=TRUE,warning=FALSE,results='hide'----------------------------------- suppressPackageStartupMessages(library(EnMCB)) methylation_dataset<-create_demo()res <-istendifymcb(甲基化_dataset)## ------ echo = true,警告= false,结果='hide'-------------------------------------------------------------------------------------- mcb <-res $ mcbinformation ## ----------------- true,parning = false,结果='hide'---------------------------------------------------------------------------------- MCB <-mcb [mcb [,“ cpgs_num”]> = 5,] ## ------------------------------=TRUE,warning=FALSE,results='hide'----------------------------------- #simulation forthe group data groups = c(rep("control",200),rep("dis",255)) DiffMCB_resutls<-DiffMCB(methylation_dataset, groups, MCB)$tab ## ----echo=TRUE,warning=FALSE,results='hide'----------------------------------- # sample the dataset into training set and测试集训练集<-Colnames(Methylation_dataset)%样本(colnames(甲基化_dataset),0.6*长度(colnames(甲基化_dataset))))testingsetset < - !,trainingset], Surv = demo_survival_data[trainingset], Method = "cox",ci = TRUE) #select the best onemodel<-models$best_cox_model$cox_model ## ----echo=TRUE,warning=FALSE,results='hide'----------------------------------- newcgdata<-data.frame(t(methylation_dataset[,testingset])))prediction_results <-predict(onemodel,newcgdata)## ------------ echo = true,警告= false,结果='hide'----------------------------------------------------------------------#您可以选择一个MCB:select_single_one = 1 em <-enbemble_model(t(t(mcb [select_single_one],])),triagh_set = methylation_dataset [,培训],surv_training= demo_survival_data [trainingset])## ---- echo = true,警告= false,结果='hide'---------------------------------------------------------------------------------------------------------------------------------------------------------------------tion_data =甲基化_dataset [,testingset])## ---- echo = true ------------------------------------------------------------------------------------------------------------------------------------------------------------------ sessionInfo()