Question: Differential analysis heatmap without hclust
1
gravatar for newbie
5 months ago by
newbie70
newbie70 wrote:

Hello,

I did a differential analysis between 160 tumor and 90 normal samples. I'm using edgeR package. I used the following code to make a differential analysis heatmap. I selected differential expressed genes based on FC > 2 and FDR < 0.05. This gave me 614 DEGs.

logCPM <- cpm(y, prior.count=2, log=TRUE)
o <- order(tr$table$PValue)
logCPM <- logCPM[o[1:614],] 
logCPM <- t(scale(t(logCPM)))
dim(logCPM)

library(matrixStats)
library(gplots)
library(ComplexHeatmap)
library(circlize)
library(RColorBrewer)

#Set annotation
ann <- data.frame(TvsN$Type)
colnames(ann) <- c("Type")
colours <- list("Type"=c("Tumor"="black","Normal"="brown"))
colAnn <- HeatmapAnnotation(df=ann, which="col", col=colours, annotation_width=unit(c(1, 4), "cm"), gap=unit(1, "mm"))

myCol <- colorRampPalette(c("navyblue", "white", "red"))(100)
myBreaks <- seq(-2,2, length.out=100)
hmap <- Heatmap(logCPM, name = "Z-Score",  col = colorRamp2(myBreaks, myCol), 
                show_row_names = FALSE, show_column_names = FALSE, cluster_rows = TRUE,
                cluster_columns = TRUE, show_column_dend = FALSE, show_row_dend = TRUE,
                row_dend_reorder = TRUE, column_dend_reorder = TRUE, clustering_method_rows = "ward.D2",
                clustering_method_columns = "ward.D2", width = unit(100, "mm"),
                top_annotation=colAnn)
draw(hmap, heatmap_legend_side="left", annotation_legend_side="right")

The heatmap was made using complex heatmap like above. I see that DEGs showing samples are clustered.

heatmap

I wanted to select 614 DEGs and sort the samples acc to their Type without using hclust like above. May I know how to do this?

thanq

ADD COMMENTlink modified 5 months ago by Jean-Karim Heriche21k • written 5 months ago by newbie70
1
gravatar for Jean-Karim Heriche
5 months ago by
EMBL Heidelberg, Germany
Jean-Karim Heriche21k wrote:

Read the docs about clustering in ComplexHeatmap. You can suppress clustering (and provide the data in the order you want) or give a custom clustering function or precomputed dendrogram.

ADD COMMENTlink written 5 months ago by Jean-Karim Heriche21k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1651 users visited in the last hour