-
Notifications
You must be signed in to change notification settings - Fork 11
Description
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,
)
