# #——包括= FALSE ----------------------------------------------------------- 库(BiocStyle ) ## ---- eval = FALSE -------------------------------------------------------------- # 如果(!requireNamespace(“BiocManager”,悄悄地= TRUE)) # install.packages (BiocManager) # BiocManager::安装(“sechm ") ## ----------------------------------------------------------------------------- suppressPackageStartupMessages({库(SummarizedExperiment)库(sechm)})数据(“Chen2017”,包=“sechm”)< - Chen2017 ## ----------------------------------------------------------------------------- g < - c(“Egr1”、“Nr4a1”、“安全系数”、“Egr2”、“Sgk1”、“弧”、“Dusp1”、“Fosb”、“Sik1”)sechm (,行缩放特性= g) #: sechm (SE、特性= g do.scale = TRUE ) ## ----------------------------------------------------------------------------- rowData (SE)美元meanLogCPM < - rowMeans(化验(SE) logcpm美元)sechm (SE、特性= g assayName =“logFC top_annotation = c(“条件”,“时间”),left_annotation = c(“meanLogCPM ")) ## ----------------------------------------------------------------------------- sechm (SE,特性= g。规模= TRUE, show_colnames = TRUE ) ## ----------------------------------------------------------------------------- sechm (SE,特性= g。规模= TRUE, row_title =“我的基因 ") ## ----------------------------------------------------------------------------- sechm (SE、特性= row.names (SE),马克= g。规模= TRUE, top_annotation = c(“条件”、“时间 ")) ## ----------------------------------------------------------------------------- sechm (SE,特性= g。规模= TRUE, top_annotation =“时间”,gaps_at = "状态 ") ## ----------------------------------------------------------------------------- # 恢复集群:sechm (SE、特性= row.names (SE)。scale=TRUE, sortRowsOn=NULL) # no reordered: sechm(SE, features=row.names(SE), do。规模= TRUE, sortRowsOn = NULL, cluster_rows = FALSE ) ## ----------------------------------------------------------------------------- # 我们第一次集群行,并保存构成了rowData:集群的rowData集群(SE) $ < - as.character (kmeans (t(规模(t(化验(SE)))), 5)集群)美元sechm (SE,特性= 1:30,做。scale=TRUE, toporder="cluster", left_annotation="cluster", show_rownames=FALSE) sechm(SE, features=1:30, do。规模= TRUE, gaps_row =“集群”,show_rownames = FALSE ) ## ---- fig.width = 9 ------------------------------------------------------------- 库(ComplexHeatmap) g2 < - c (g,“Gm14288”,尾巴(row.names (SE)))画(sechm (SE、特性= g2 assayName =“logFC”,减免= 1,column_title =“休息= 1”)+ sechm (SE、特性= g2 assayName =“logFC”,减免= 0.995,column_title =“休息= 0.995”,name = " logFC(2)”)+ sechm (SE、特性= g2 assayName =“logFC”,减免= 0.985,column_title =“休息= 0.985”,name = " logFC(3)”),merge_legends = TRUE ) ## ---- eval = FALSE -------------------------------------------------------------- # # 不运行# sechm (SE、特性= g2 hmcols = viridisLite:: cividis (10 )) ## ----------------------------------------------------------------------------- 元数据(SE)美元anno_colors元数据(SE) anno_colors条件<美元- c(控制=“白色”,Forskolin =“黑色”)sechm (= g2,特性,top_annotation = "条件 ") ## ---- colors_in_object --------------------------------------------------------- 元数据(SE)美元hmcols < - c(“darkred”、“白”、“darkblue”)sechm (SE, g。规模= TRUE) # #——anno_in_object ----------------------------------------------------------- 元数据(SE)美元default_view < -列表(化验=“logFC top_annotation = "状态 " ) ## ---- colors_in_options -------------------------------------------------------- setSechmOption(“hmcols”,价值= c(“白”,“灰色”、“黑色”))sechm (SE, g。scale = TRUE) ## ----------------------------------------------------------------------------- resetAllSechmOptions() metadata(SE)$hmcols <- NULL metadata(SE)$anno_colors <- NULL ## ----two_heatmaps------------------------------------------------------------- sechm(SE, features=g) + sechm(SE, features=g) ## ----crossHm------------------------------------------------------------------ # we build another SE object and introduce some variation in it: SE2 <- SE assays(SE2)$logcpm <- jitter(assays(SE2)$logcpm, factor=1000) crossHm(list(SE1=SE, SE2=SE2), g, do.scale = TRUE, top_annotation=c("Condition","Time")) ## ----crosshm2----------------------------------------------------------------- crossHm(list(SE1=SE, SE2=SE2), g, do.scale = TRUE, top_annotation=c("Condition","Time"), uniqueScale = TRUE) ## ----sessionInfo, echo=FALSE-------------------------------------------------- sessionInfo()