Heatmap with grouping contorl vs treatment
library(ComplexHeatmap)
## Loading required package: grid
## ========================================
## ComplexHeatmap version 1.20.0
## Bioconductor page: http://bioconductor.org/packages/ComplexHeatmap/
## Github page: https://github.com/jokergoo/ComplexHeatmap
## Documentation: http://bioconductor.org/packages/ComplexHeatmap/
##
## If you use it in published research, please cite:
## Gu, Z. Complex heatmaps reveal patterns and correlations in multidimensional
## genomic data. Bioinformatics 2016.
## ========================================
library(circlize)
## ========================================
## circlize version 0.4.5
## CRAN page: https://cran.r-project.org/package=circlize
## Github page: https://github.com/jokergoo/circlize
## Documentation: http://jokergoo.github.io/circlize_book/book/
##
## If you use it in published research, please cite:
## Gu, Z. circlize implements and enhances circular visualization
## in R. Bioinformatics 2014.
## ========================================
library(grid)
setwd("C:/Users/shi-lab/Documents/20190115")
df_log2_std = read.csv("STAT5A_for_Heatmap_log2_zscore.csv", header=TRUE, sep=,)
rownames(df_log2_std) = df_log2_std$SYMBOL
df_log2_std = subset(df_log2_std, select=-SYMBOL)
head(df_log2_std)
## DZ_7_S3 DZ_9_S5 DZ_8_S4 DZ_10_S6
## 1 1.0619230 0.5913872 -1.1058176 -0.54749262
## 2 1.1220998 0.5434686 -1.0037739 -0.66179440
## 3 0.9543075 0.7284431 -1.1086233 -0.57412732
## 4 -1.0686481 -0.6309183 0.9382996 0.76126685
## 5 -0.8725394 -0.5889072 1.3725762 0.08887039
## 6 1.1688388 0.4208596 -1.1055923 -0.48410613
df_group = data.frame(type = c(rep("Control",2), rep("CASTA5",2)))
df_group_a = HeatmapAnnotation(df = df_group, col = list(type = c("Control" = "#df009d", "CASTA5" = "#3a016b")), show_legend = TRUE)
Heatmap(df_log2_std, name = "z-score", cluster_columns = FALSE, cluster_rows = TRUE, show_row_names = TRUE, top_annotation = df_group_a, row_names_gp = gpar(fontsize = 6), clustering_distance_rows = "euclidean")