Extracting modules from correlation and then module clustering
Co-expression in R is doable via gglot2 at the very least... I see if I can find the code.

Essentially you are performing a co-variance analysis, however Pearson' at 0.4 is a LOW cut-off and it should be 0.7.

I've got a lot on right now, so it will take a week or so before I foward the relevant code. R will have other methods outside ggplot2 however.



I was thinking ggcorr() and ggpairs() which both in the GGally package of R-cran. The output is very cute, well its ggplot2 which is trendy.

library (ggplot2)
library (GGally)
library (dplyr)

df &lt;- select(mydata, 1:5)
cor(df) # raw output 
ggcorr(df)


output: heatmap similar to Fig. a

ggpairs(df)


output: very fancy matrix plot Its pairwise scatterplots, diagrams and numbers, which is not represented in Fig. a to c, but its a very fancy version of Fig. d ... Its simplistic analysis, but its a very cute plot.

ggcorr uses pairwise (obviously) Pearson by default, which is the most versatile.

I can definitely say that 0.7 for Pearson for a straight correlation (not a covariance analysis) is conservative low and as a reviewer I would immediately complain about anything lower. A heatmap is different depending on its interpretation. 

The multivariate analysis of Pearson pairwise correlation, which is what you are requesting is a different question. UPGMA style analysis directly on the heatmap, is fine if there is "one heatspot", but otherwise has limitations IMO.