Entering edit mode
9 months ago
Priya
•
0
Hi all,
I'm currently running a WGCNA analysis. I started with "step-by-step network construction and module detection" provided by Richard Chen click here to see the git hub link. The following steps I've done.
#first calculated soft power
power = c(c(1:10), seq(from = 12, to = 50, by = 2))
sft_test = pickSoftThreshold(norm_counts, powerVector = power, networkType = "signed", verbose = 5)
#calculated the adjacencies
softPower = 16
adjacency = adjacency(norm_counts, power = softPower)
TOM = TOMsimilarity(adjacency);
dissTOM = 1-TOM
#Clustering using TOM: produces dendrogram of genes
geneTree = hclust(as.dist(dissTOM), method = "average");
#module identification using dynamic tree cut
dynamicMods = cutreeDynamic(dendro = geneTree, distM = dissTOM, deepSplit = 2, pamRespectsDendro = FALSE, minClusterSize =30);
table(dynamicMods)
#convert numeric labels to colors
dynamicColors = labels2colors(dynamicMods)
table(dynamicColors)
#plot the dendrogram and colors underneath
pdf(file = "plots/gene_dendrogram_with_module_colors", width = 12, height = 9);
plotDendroAndColors(geneTree, dynamicColors, "Dynamic Tree Cut",dendroLabels = FALSE, hang = 0.03, addGuide = TRUE, guideHang = 0.05, main = "Gene dendrogram and module colors")
When I'm plotting this dendrogram, following error has been encountered:
Error in rect(trafo1$x, trafo1$y, trafo2$x, trafo2$y, col = as.character(C[, :
invalid color name 'dodgerblue3.1'
Can anyone suggest something to deal with this error.
Thank you!