Skip to content

What is meant by this?: "NOTE: though the clusters match the R output, the cluster names are shuffled" #6

Description

@jolespin

First off, thank you so much for creating this package. I've been needing something like this and wrote a wrapper with rpy2 but will use this instead from now on.

I am noticing some inconsistencies:
(1) The clustering looks the same but the colors from WGCNA seem to repeat themselves. Is this a WGCNA issue or an artifact of your note:

dynamicTreeCut contains methods for detection of clusters in hierarchical clustering dendrograms. "NOTE: though the clusters match the R output, the cluster names are shuffled"

(2) Can you elaborate on what you mean by the quote above? I keep getting clusters that overlap when I plot them ...

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions