# #——回声= FALSE ------------------------------------------------------------ 美元knitr: opts_chunk集(= "发表评论,消息= FALSE,警告= FALSE) # # - eval = FALSE ------------------------------------------------------------- # 如果(!requireNamespace(“BiocManager”,静静地= TRUE) # install.packages(“BiocManager”)# # BiocManager::安装(“methylGSA ") ## ----------------------------------------------------------------------------- 库(methylGSA ) ## ----------------------------------------------------------------------------- 库(IlluminaHumanMethylation450kanno.ilmn12.hg19) # # - eval = FALSE ------------------------------------------------------------- # 图书馆(IlluminaHumanMethylationEPICanno.ilm10b4.hg19) # #----------------------------------------------------------------------------- 数据(cpgtoy)头(cpg)。pval, 20 ) ## ----------------------------------------------------------------------------- res1 = methylglm (cpg)。Pval = cpg。pval, minsize = 200, maxsize = 500, GS。type = " KEGG”)负责人(res1 15) # #——回声= FALSE --------------------------------------------------------------- glm_res = data.frame(“列”= c(“ID”,“描述(N /一组用户提供的基因)”、“大小”、“pvalue”,“padj”),“解释”= c(“基因身份证”,“基因集描述”、“基因的基因数量设置”,“逻辑回归假定值”,“假定值调整”)knitr: kable (glm_res ) ## ----------------------------------------------------------------------------- 库(org.Hs.eg.db) genes_04080 =选择(org.Hs.eg.db、“04080”、“符号”,keytype =“路径”)负责人(genes_04080) # # - eval = FALSE --------------------------------------------------------------- # # 包括所有的ID作为第二个参数选择函数# genes_all_pathway =选择(org.Hs.eg.db, as.character (res1 $ ID), #“符号”,keytype =“路径”)头(genes_all_pathway) # # # - eval = FALSE --------------------------------------------------------------- # 它= methylRRA (cpg)。Pval = cpg。pval, method = "ORA", # minsize = 200, maxsize = 210) # head(res2, 15) ## ----echo=FALSE--------------------------------------------------------------- ora_res = data.frame("Column" = c("ID", "Description(用户提供的基因集的描述)","Count", "overlap", "Size", "pvalue", "padj"), "Explanation" = c("基因集ID", "基因集描述","基因集中重要基因的数目","基因集中重要基因的名称","基因集中的基因数目","ORA中的p值",“假定值调整”)knitr: kable (ora_res) # # - eval = FALSE --------------------------------------------------------------- # res3 = methylRRA (cpg)。Pval = cpg。pval, method = "GSEA", # minsize = 200, maxsize = 210) # head(res3, 10) ## ----echo=FALSE--------------------------------------------------------------- gsea_res = data.frame( "Column" = c("ID", "Description (N/A for user supplied gene set)", "Size", "enrichmentScore", "NES", "pvalue", "padj"), "Explanation" = c("Gene set ID", "Gene set description", "Number of genes in gene set", "Enrichment score (see [3] for details)", "Normalized enrichment score (see [3] for details)", "p-value in GSEA", "Adjusted p-value") ) knitr::kable(gsea_res) ## ----eval=FALSE--------------------------------------------------------------- # res4 = methylgometh(cpg.pval = cpg.pval, sig.cut = 0.001, # minsize = 200, maxsize = 210) # head(res4, 15) ## ----------------------------------------------------------------------------- data(GSlisttoy) ## to make the display compact, only a proportion of each gene set is shown head(lapply(GS.list, function(x) x[1:30]), 3) ## ----eval=FALSE--------------------------------------------------------------- # library(BiocParallel) # res_p = methylglm(cpg.pval = cpg.pval, minsize = 200, # maxsize = 500, GS.type = "KEGG", parallel = TRUE) ## ----------------------------------------------------------------------------- data(CpG2Genetoy) head(CpG2Gene) ## ----------------------------------------------------------------------------- FullAnnot = prepareAnnot(CpG2Gene) ## ----------------------------------------------------------------------------- GS.list = GS.list[1:10] res5 = methylRRA(cpg.pval = cpg.pval, FullAnnot = FullAnnot, method = "ORA", GS.list = GS.list, GS.idtype = "SYMBOL", minsize = 100, maxsize = 300) head(res5, 10) ## ----eval=FALSE--------------------------------------------------------------- # res6 = methylglm(cpg.pval = cpg.pval, array.type = "450K", # GS.type = "Reactome", minsize = 100, maxsize = 110) # head(res6, 10) ## ----------------------------------------------------------------------------- barplot(res1, num = 8, colorby = "pvalue") ## ----sessionInfo-------------------------------------------------------------- sessionInfo()