gravatar for huynguyen96.dnu

2 hours ago by

Vietnam

Hi there, I constructed a co-expression network using WGCNA. As you could know, we identify co-expressed gene modules by performing hierarchical clustering method based on TOM-based dissimilarity. So, a distance matrix was computed here to draw a dendrogram of eigen-genes is TOM-based dissimilarity.

Now, I want to draw a heatmap that visualizes the overlap of eigen-genes among inter-modules using the function heatmap by the package ComplexHeatmap. But the problem is, the function heatmap does not provide the above TOM-based dissimilarity distance method. I wonder how to do it? The code lines I used to draw heatmap as follows:

plotTOM = dissTOM^7; #Transform dissTOM with a power to make moderately strong connections more visible in the heatmap

diag(plotTOM) = NA; #Set diagonal to NA for a nicer plot

sizeGrWindow(9,9)

heatmap(plotTOM, show_row_names = TRUE, show_column_names = FALSE,

   row_dend_reorder = TRUE, column_dend_reorder = TRUE,

   clustering_distance_rows = ???,

   clustering_distance_columns = ???,

   clustering_method_rows = "ward.D2",

   clustering_method_columns = "ward.D2")
  

I define my own distance in R like:

softPower = 6;

adjacency = adjacency(df, power = softPower); #df is my gene expression data

TOM = TOMsimilarity(adjacency);

dissTOM = 1-TOM #distance matrix



Source link