——标题:“06:基因集浓缩分析”作者:-名称:Martin Morgan隶属关系:Roswell Park综合癌症中心日期:“' r格式(Sys.time(), '%B %d, %Y') '”小装饰:> %\VignetteIndexEntry{06:基因集浓缩分析}%\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8}输出:BiocStyle::html_document: number_sections: yes toc: true——' ' ' {r style, echo = FALSE, results = 'asis'} knitr::opts_chunk$ Set (eval=as.logical(Sys. time))。gettenv ("KNITR_EVAL", "TRUE")),缓存=as.logical(Sys. value)。gettenv ("KNITR_CACHE", "TRUE")))选项(width = 75)#理论见[幻灯片][]##基准测试:最近的一条推文…最近的一条[tweet][]很好地总结了使用[GSEABenchmarkR][]包对基因集富集分析方法进行基准测试的工作。' ' ' {r, message=FALSE} library(浓缩铀浏览器)' ' ' # Practice ' ' ' {r, message = FALSE, echo = FALSE}库(DESeq2)库(气道)库(dplyr)库(org. hs . e.g. .db)库(GO.db)库(limma)数据输入和按摩{r}库(气道)数据(气道)气道$dex <- relevel(气道$dex, "untrt")' ' '差异表达分析' ' ' ' {r}库(DESeq2) des <- DESeqDataSet(气道,design = ~ cell + dex) des <- DESeq(des) res <- results(des){r} library(dplyr) library(tibble) tbl <- res %>% as.data.frame() %>% rownames_to_column("ENSEMBL") %>% as_tibble() tbl ' ' ' ##示例:超几何测试使用[limma][] '::goana() '需要ENTREZ标识符' ' ' {r}库(org.Hs. egl .db) tbl <- tbl %>% mutate(ENTREZID = mapIds(org.Hs. db, ENSEMBL, "ENTREZID", "ENSEMBL") %>% unname()) tbl ' ' '宇宙-必须是DE可测试的' ' ' {r} tbl <- tbl %>% filter(!is.na(padj), !is.na(ENTREZID)) tbl ' ' ' ' [limma][] '::goana() '——超几何' ' ' ' {r}库(limma) go <- goana(tbl$ENTREZID[tbl$padj < .05], tbl$ENTREZID, "Hs") %>% as_tibble()' ' '嗯,' goana() '返回GO术语,但我们也需要GO标识符' ' ' {r}库(GO.db) GO <- GO %>% mutate(GOID = mapIds(GO.db, .$Term, "GOID", " Term ") %>% unname() %>% dplyr::select(GOID, everything()) %>% arrange(P.DE){r} go %>% filter(grepl("糖皮质激素",Term)) ``` What genes in set? ```{r} genesets <- AnnotationDbi::select(org.Hs.eg.db, tbl$ENTREZID, "GO", "ENTREZID") %>% as_tibble() %>% dplyr::select(ENTREZID, GO, ONTOLOGY) %>% distinct() genesets ``` # Provenance ```{r} sessionInfo() ``` [limma]: //www.anjoumacpherson.com/packages/limma [GSEABenchmarkR]: //www.anjoumacpherson.com/packages/GSEABenchmarkR [tweet]: https://twitter.com/LeviWaldron1/status/1142092301403115521