Hello, this isn't quite a WGCNA question as it involves plotting WGCNA output, but I'll ask nonetheless. I'm trying to make a bar plot of KME values for a given probe within the network modules:
KME.colors
as.matrix(KME.vals)
dev.off()
par(mar = c(10, 5, 5, 5)); # bottom, left, top, right margins
barplot( as.matrix(KME.vals), main=paste( probe, "WGCNA KME values"), col=KME.colors, las=3,
ylab="Probe correlation to module")
Which outputs:
> KME.colors
[1] "orange" "purple" "grey" "blue" "lightyellow" "red" "darkgrey"
[8] "greenyellow" "darkgreen" "skyblue" "lightcyan" "darkorange" "tan" "cyan"
[15] "lightgreen" "royalblue" "pink" "midnightblue" "yellow" "grey60" "darkturquoise"
[22] "salmon" "brown" "white" "magenta" "black" "green" "darkred"
[29] "turquoise"
> as.matrix(KME.vals)
KMEorange KMEpurple KMEgrey KMEblue KMElightyellow KMEred KMEdarkgrey KMEgreenyellow
MCM4 (turquoise) 0.01462564 -0.02791667 -0.04086319 0.09019856 -0.1279744 -0.1456679 -0.147187 -0.1590669
KMEdarkgreen KMEskyblue KMElightcyan KMEdarkorange KMEtan KMEcyan KMElightgreen KMEroyalblue
MCM4 (turquoise) -0.1958627 -0.2175926 -0.2381884 0.2432537 -0.2707614 -0.2782734 -0.2814852 0.3066307
KMEpink KMEmidnightblue KMEyellow KMEgrey60 KMEdarkturquoise KMEsalmon KMEbrown KMEwhite
MCM4 (turquoise) -0.3369391 -0.3858618 0.4087018 -0.4163105 -0.4432651 0.4635529 0.468053 0.475234
KMEmagenta KMEblack KMEgreen KMEdarkred KMEturquoise
MCM4 (turquoise) -0.4954438 0.5961958 -0.6153285 -0.6885074 0.8033355
But every single bar in the resulting figure is orange, so for some reason the barplot() function doesn't like my KME.colors vector. What to do?
Oh and while we're on this the KME of the module a probe has been placed within should be the closest to 1, correct? And the least correlated module KME must be closest to -1?
Thanks, Rob