## ---- fig.align='center', message=FALSE, warning=FALSE, eval=FALSE------------ # library(gsean) # library(TCGAbiolinks) # library(summarizeexperiment) ## TCGA LUAD # query <- GDCquery(project = "TCGA-LUAD", # data. txt)category = "基因表达",# data。type = "基因表达量化",# platform = "Illumina HiSeq", # file。Type = "normalized_results", # experimental。策略= "RNA-Seq", # legacy = TRUE) # GDCdownload(查询,方法= "api") # invisible(捕获。output(data <- GDCprepare(query))) # exprs。LUAD <- assay(data) # #删除重复的基因名称# exprs。LUAD <- exprs.LUAD[-which(duplicate (rownames(exprs.LUAD)))),] # #基因列表# recurr .mut.gene <- c("KRAS", "TP53", "STK11", "RBM10", "SPATA31C1", "KRTAP4-11", # "DCAF8L2", "AGAP6", "KEAP1", "SETD2", "ZNF679", "FSCB", # "BRAF", "ZNF770", "U2AF1", "SMARCA4", "HRNR", "EGFR") # # # KEGG_hsa # load(system. LUAD)文件(“数据”、“KEGG_hsa。rda", package = "gsean")) # # # GSEA # set.seed(1) #结果。GSEA <- gsean(KEGG_hsa, recursive .mut.)基因,exprs。LUAD,阈值= 0.7)#不可见(捕获。输出(p <- GSEA.barplot(结果。GSEA, category = 'pathway', # score = 'NES', pvalue = 'padj', # sort = 'padj', top = 20))) # p <- GSEA.barplot(result. nps);GSEA, category = 'pathway', score = 'NES', # pvalue = 'padj', sort = 'padj', top = 20) # p +主题(plot。margin = margin(10,10,75)) ## ---- fig.align='center', message=FALSE, warning=FALSE, eval=TRUE------------- library(gsean) library(pasilla) library(DESeq2) # pasilla count data pasCts <- system. align='center', message=FALSE, warning=FALSE, eval=TRUE文件(“extdata”、“pasilla_gene_counts。tsv”,包= " pasilla cts”,mustWork = TRUE) < - as.matrix (read.csv (pasCts, 9 = \ t, row.names =“gene_id”))条件< -因子(c(代表(“未经处理”,4),代表(“治疗”,3)))dds < - DESeqDataSetFromMatrix (countData = cts, colData = data.frame(条件),设计= ~ 0 +条件)#过滤保持< - rowSums(计数(dds)) > = 10 dds < - dds dds的差异表达基因[,]# < - DESeq (dds) resultsNames (dds) res < -结果(dds,对比=列表(“conditiontreated”、“conditionuntreated”), listValues = c(1, -1)) statistic <- res$stat names(statistic) <- rownames(res) exprs.pasilla <- counts(dds, normalized = TRUE) # convert gene id library(org.Dm.eg.db) gene.id <- AnnotationDbi::select(org.Dm.eg.db, names(statistic), "ENTREZID", "FLYBASE") names(statistic) <- gene.id[,2] rownames(exprs.pasilla) <- gene.id[,2] # GO_dme load(system.file("data", "GO_dme.rda", package = "gsean")) # GSEA set.seed(1) result.GSEA <- gsean(GO_dme, statistic, exprs.pasilla) invisible(capture.output(p <- GSEA.barplot(result.GSEA, category = 'pathway', score = 'NES', top = 50, pvalue = 'padj', sort = 'padj', numChar = 110) + theme(plot.margin = margin(10, 10, 10, 50)))) plotly::ggplotly(p) ## ----sessionInfo-------------------------------------------------------------- sessionInfo()