Question: dynamicTreeCut and WGCNA show clusters overlapping. Why is this?
1
gravatar for jol.espinoz
14 months ago by
jol.espinoz20
jol.espinoz20 wrote:

Can somebody explain why I am seeing certain clusters overlap? I tried reproducing the results in Python and in R and I'm seeing a similar pattern.

I have 2 main questions:

(1) Do the colors from WGCNA get repeated? It looks like the 2nd red cluster from the left should be a different color based on my Python plots. Did I plot something incorrectly or is this a known bug of either WGCNA or dynamicTreeCut?

(2) If not (1), why are the clusters overlapping? Is there a parameter I can adjust that controls for this?

Here is the link to the dataframe: https://drive.google.com/file/d/1vp_jx8CfD90bvFcS6sbWN59U-_DQa48L/view?usp=sharing

Here's my Rcode:

library(dynamicTreeCut)
library(fastcluster)
library(WGCNA)

# Read in dataframe
read_dataframe = function(path, sep="\t") {
  df = read.table(path, sep=sep, row.names=1, header = TRUE, check.names=FALSE)
  return(df)
}
df_adj = read_dataframe("~/adj.tsv")

# Convert to dissimilarity
df_dism = 1 - df_adj

# Compute hierarchical clustering linkage
Z = hclust(as.dist(df_dism), method="ward.D2")

# Cut the dendrogram
treecut_output = cutreeDynamic(
  dendro=Z, 
  method="hybrid", 
  distM=df_dism, 
  minClusterSize = 10,
  deepSplit=2,
)

# Plot dendrogram
plotDendroAndColors(
  dendro=Z,
  colors=treecut_output,
)

image

Here is my python representation using the same parameters: image

ADD COMMENTlink written 14 months ago by jol.espinoz20
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 16.09
Traffic: 212 users visited in the last hour