Dear Scientist,
I respectfully would like to get your feedback(tutorial) on the following questions.
I have gene expression data from the same Biological replicates of two tissues of the brain(cortex and cerebellum)
I want to know if Cortex and Cerebellum genes have similarities in their expression/co-expressed/ for the condition I am studying. I did data normalization using DESeq2. Then, I break the data into two(cortex and cerebellum) for correlation analysis.
Now, my question is:
(1) How could I extract a cluster of correlated genes between the cortex and cerebellum from the two-dimensional hierarchically clustered heatmap for further analysis?
(2) How I could assign color bars for the different clusters of genes in the rows and columns-here theoretically asking color assignment for each cluster in the rows and columns as indicated in WGCNA approach.
Here simulated the data as follow.
## Cortex expression profile
set.seed(123)
cortex = matrix(rnorm(1000, 2), 100, 10)
rownames(cortex) = paste0("gene_", 1:100)
colnames(cortex) = LETTERS[1:10]
## cerebellum expression profile
set.seed(177)
cerebellam = matrix(rnorm(1000, 2), 100, 10)
rownames(cerebellam) = paste0("gen_", 1:100)
colnames(cerebellam) = LETTERS[1:10]
## similarity measure
Tissue_corrlation = cor(t(cortex), t(cerebellam))
##Heatmap
library(ComplexHeatmap)
Heatmap(Tissue_corrlation ,cluster_rows = as.dendrogram(hclust(dist(Tissue_corrlation))),
cluster_columns = as.dendrogram(hclust(dist(t(Tissue_corrlation )))))
Thank you!
Extracting genes or regions per cluster has been asked before
Saving individual clusters from heatmaps
and
https://github.com/jokergoo/ComplexHeatmap/issues/136
For question two please read the manual, I guess the Heatmap Decoration section is relevant: https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-annotations.html