# #——负载分析器,eval = FALSE ---------------------------------------------- # 如果(!requireNamespace(“BiocManager”,悄悄地= TRUE)) # install.packages (BiocManager) # BiocManager::安装(“TBSignatureProfiler ") ## ---- 设置 -------------------------------------------------------------------- suppressPackageStartupMessages({库(TBSignatureProfiler)库(SummarizedExperiment ) }) ## ---- 运行的应用程序,eval = FALSE ---------------------------------------------- # TBSPapp () ## ---- 加载数据 ------------------------------------------------------------- ## 艾滋病/结核病基因表达数据,包含在包hivtb_data <——TB_hiv # # #请注意,我们有25369个基因,33个样本,和1化验数量暗(hivtb_data) #我们开始只有一个分析化验(hivtb_data) # #——添加化验 --------------------------------------------------------------- ## 做一个日志,CPM和log CPM化验hivtb_data <- mkAssay(hivtb_data, log = TRUE,counts_to_CPM = TRUE) # # #查看,我们现在有4个化验分析(hivtb_data) # #——运行数据 ----------------------------------------------------------------- ## 列出所有签名分析器数据(“TBsignatures”)名称(TBsignatures) # #我们可以使用所有这些签名进行进一步分析siglist_hivtb < -名字(TBsignatures) # #——运行分析器 ------------------------------------------------------------- ## 运行TBSignatureProfiler得分< -签名数据捕捉。output(ssgsea_result <- runTBsigProfiler(input = hivtb_data, useAssay = "log_cpm", signatures = TBsignatures, algorithm = "ssGSEA", combineSigAndAlgorithm = TRUE, parallel。sz = 1)) ## ----show scores, message = FALSE--------------------------------------------- ##来自Profiler sigs的新colData项<- c("Anderson_42", "Anderson_OD_51", "Berry_393") ssgsea_print_results <- as.data.frame(colData(ssgsea_result))[, c("Disease", sigs)] ssgsea_print_results[, 2:4] <- round(ssgsea_print_results[, 2:4], 4) DT::datatable(ssgsea_print_results) ## ----所有sigs热图,message = FALSE,fig.height = 9 ------------------------ # 颜色渐变颜色< - RColorBrewer:啤酒。pal(6, "Spectral") col.me <- circlize::colorRamp2(seq(from = -2, to = 2, length。out = 6), colors) signatureHeatmap(ssgsea_result, name = "签名的热图,ssGSEA算法",signatureColNames = names(TBsignatures), annotationColNames = "疾病",scale = TRUE, showColumnNames = TRUE, choose_color = col.me) ## ----Boxplots all, message = FALSE, results = 'hide', fig.height = 9, fig.width=15---- signatureBoxplot(inputData = ssgsea_result, name = "签名的Boxplots, ssGSEA", signatureColNames = names(TBsignatures), annotationColName = "疾病", rotateLabels = FALSE) ## ----compareAlgs ex, warning = FALSE, message = FALSE------------------------- # Heatmap compareAlgs(hivtb_data, annotationColName = "Disease", scale = TRUE, algorithm = c("GSVA", "ssGSEA", "singscore", "PLAGE", "Zscore"), useAssay = "log_counts", signatures = TBsignatures[1], choose_color = col.me, show.pb = FALSE, parallel.sz = 1) # Boxplot compareAlgs(hivtb_data, annotationColName = "Disease", scale = TRUE, algorithm = c("GSVA", "ssGSEA", "singscore", "PLAGE", "Zscore"), useAssay = "log_counts", signatures = TBsignatures[1], choose_color = col.me, show.pb = FALSE, parallel.sz = 1, output = "boxplot") ## ----session info------------------------------------------------------------- sessionInfo()